commit:     47c9af8ca53f3612be6e4ddfb0090644cde4d94a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  2 17:03:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb  2 17:03:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=47c9af8c

crossdev: disable SSP for freestanding/no libc targets

Otherwise, we end up with a mess like:
```
[...]
/usr/libexec/gcc/arm-none-eabi/ld: 
/usr/lib/gcc/arm-none-eabi/12/../../../../arm-none-eabi/lib/libg.a(libc_a-stack_protector.o):
 in function `__stack_chk_fail':
stack_protector.c:(.text.__stack_chk_fail+0x60): undefined reference to `_exit'
[...]
```

Signed-off-by: Sam James <sam <AT> gentoo.org>

 crossdev | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crossdev b/crossdev
index 902d9dc..bd13f7f 100755
--- a/crossdev
+++ b/crossdev
@@ -334,10 +334,11 @@ parse_target() {
                        LPKG="newlib"
                        KPKG="[none]"
                        STAGE_DEFAULT=${STAGE_LIBC}
-                       GMASK+=" hardened"
+                       GMASK+=" default-stack-clash-protection hardened ssp"
                        GUSE+=" cxx -openmp" #489798
                        GUSE+=" -fortran" #589672, needs syscalls
                        GUSE+=" -hardened" #687598, needs 
-fstack-check=specific support
+                       GUSE+=" -default-stack-clash-protection -ssp" # SSP 
isn't supported for freestanding anyway
                        MULTILIB_USE="yes" #407275
                        WITH_DEF_HEADERS="no"
                        ;;

Reply via email to