commit 3300cf3d3e2a83b6b6c438fd40b8a9a6b164900e
parent d1f3dc2a94c8cb46bb67259642a1059983de36be
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 10:21:16 +0100
libc: Improve gcc-ssc
The crt file should be the first object in the list, because it pulls the main
symbol and maybe other required symbols. For many platforms it is not a big
issue because the crt only uses the main symbol, but in some other cases it
may pull other symbols. Also, forcing -g didn't make too much sense, and it
was not difficult to handle it correctly.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/libc/gcc-scc.sh b/src/libc/gcc-scc.sh
@@ -6,7 +6,7 @@ while getopts gr:a:s:o:c o
do
case $o in
g)
- # ignored silently
+ g=-g
;;
r)
root=$OPTARG
@@ -52,8 +52,8 @@ OpenBSD)
esac
includes="-nostdinc -I$inc -I$arch_inc -I$sys_inc -I$sys_arch_inc"
-cflags="-std=c99 -g -w -fno-pie -fno-stack-protector -ffreestanding -static"
-ldflags="-g -z nodefaultlib -static -L$lib"
+cflags="-std=c99 -w -fno-pie -fno-stack-protector -ffreestanding -static"
+ldflags="-z nodefaultlib -static -L$lib"
if test ${onlycc:-0} -eq 1
then
@@ -63,7 +63,7 @@ else
do
case $i in
*.c)
- $cc $cflags $includes -c "$i"
+ $cc $g $cflags $includes -c "$i"
;;
esac
done
@@ -82,5 +82,5 @@ else
esac
done
- $ld $ldflags $nopie "$@" $crt -lc -lcrt -o "$out"
+ $ld $g $ldflags $nopie $crt "$@" -lc -lcrt -o "$out"
fi