commit: cb41e7e05c55f6ef64e7a617869bbb644899e724
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 2 23:17:29 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 2 23:18:51 2022 +0000
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=cb41e7e0
crossdev: force off USE=hardened where no SSP
This fixes e.g. hppa2.0-unknown-linux-gnu where the stack
grows up and hence we lack SSP, but also -fstack-clash-protection
which is forced on by USE=hardened.
glibc failed to build before this with:
```
checking for broken __attribute__((alias()))... yes
configure: error: working alias attribute support required
* ERROR: cross-hppa2.0-unknown-linux-gnu/glibc-2.35-r4::crossdev failed
(configure phase):
```
config.log:
```
configure:4199: checking if compiler warns about alias for function with
incompatible types
cc1: error: '-fstack-clash-protection' is not supported on targets where the
stack grows from lower to higher addresses [-Werror]
conftest.c:9:34: error: 'foo_alias' alias between functions of incompatible
types 'int(const void *, int)' and 'int (*(void))(const void *, int)'
[-Werror=attribute-alias=]
9 | extern __typeof (__redirect_foo) foo_alias __attribute__ ((alias
("foo")));
| ^~~~~~~~~
conftest.c:4:28: note: aliased declaration here
4 | __typeof (__redirect_foo) *foo_impl (void)
| ^~~~~~~~
cc1: all warnings being treated as errors
```
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 7ec9a9d..a7566ba 100755
--- a/crossdev
+++ b/crossdev
@@ -437,7 +437,8 @@ parse_target() {
# Running a hardened profile on the host forces ssp #831165
if [[ $ssp_support = "no" ]]; then
# ssp is >=gcc-6, nossp is <gcc-6
- GMASK+=" ssp -nossp"
+ # blacklist hardened too because it'll force
-fstack-clash-protection
+ GMASK+=" ssp hardened -nossp"
GFORCE+=" nossp"
fi
}