scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 2ae5e83c782bb01c922eddfaa7ac2264c2f64c56
parent 383f380ad18c01f99b8a5427f1b803680e936162
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  2 Oct 2021 21:44:23 +0200

tests/libc: Fix cc.sh for OpenBSD

The option to disable pie linking must be passed to the linker
itself, and the option to disable pie code generation is a
different option.

Diffstat:
Mtests/libc/execute/cc.sh | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/libc/execute/cc.sh b/tests/libc/execute/cc.sh @@ -41,13 +41,16 @@ obj=${1%.c}.o cc=${CROSS_COMPILE}gcc ld=${CROSS_COMPILE}ld -includes="-nostdinc -I$inc -I$arch_inc -I$sys_inc" -flags="-std=c99 -g -w -fno-stack-protector --freestanding -static" - if ${cc} -nopie 2>&1 | grep unrecogn >/dev/null then pie=-no-pie +else + pie=-nopie fi -${cc} $flags $pie $includes -c $1 -${ld} -g -z nodefaultlib -static -L$lib $obj $crt -lc -lcrt -o $out +includes="-nostdinc -I$inc -I$arch_inc -I$sys_inc" +cflags="-std=c99 -g -w -fno-pie -fno-stack-protector -ffreestanding -static" +ldflags="-g -z nodefaultlib -static $pie -L$lib" + +$cc $cflags $includes -c $1 +$ld $ldflags $obj $crt -lc -lcrt -o $out