1 |
commit: cb41e7e05c55f6ef64e7a617869bbb644899e724 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 2 23:17:29 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 2 23:18:51 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=cb41e7e0 |
7 |
|
8 |
crossdev: force off USE=hardened where no SSP |
9 |
|
10 |
This fixes e.g. hppa2.0-unknown-linux-gnu where the stack |
11 |
grows up and hence we lack SSP, but also -fstack-clash-protection |
12 |
which is forced on by USE=hardened. |
13 |
|
14 |
glibc failed to build before this with: |
15 |
``` |
16 |
checking for broken __attribute__((alias()))... yes |
17 |
configure: error: working alias attribute support required |
18 |
* ERROR: cross-hppa2.0-unknown-linux-gnu/glibc-2.35-r4::crossdev failed (configure phase): |
19 |
``` |
20 |
|
21 |
config.log: |
22 |
``` |
23 |
configure:4199: checking if compiler warns about alias for function with incompatible types |
24 |
cc1: error: '-fstack-clash-protection' is not supported on targets where the stack grows from lower to higher addresses [-Werror] |
25 |
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=] |
26 |
9 | extern __typeof (__redirect_foo) foo_alias __attribute__ ((alias ("foo"))); |
27 |
| ^~~~~~~~~ |
28 |
conftest.c:4:28: note: aliased declaration here |
29 |
4 | __typeof (__redirect_foo) *foo_impl (void) |
30 |
| ^~~~~~~~ |
31 |
cc1: all warnings being treated as errors |
32 |
``` |
33 |
|
34 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
35 |
|
36 |
crossdev | 3 ++- |
37 |
1 file changed, 2 insertions(+), 1 deletion(-) |
38 |
|
39 |
diff --git a/crossdev b/crossdev |
40 |
index 7ec9a9d..a7566ba 100755 |
41 |
--- a/crossdev |
42 |
+++ b/crossdev |
43 |
@@ -437,7 +437,8 @@ parse_target() { |
44 |
# Running a hardened profile on the host forces ssp #831165 |
45 |
if [[ $ssp_support = "no" ]]; then |
46 |
# ssp is >=gcc-6, nossp is <gcc-6 |
47 |
- GMASK+=" ssp -nossp" |
48 |
+ # blacklist hardened too because it'll force -fstack-clash-protection |
49 |
+ GMASK+=" ssp hardened -nossp" |
50 |
GFORCE+=" nossp" |
51 |
fi |
52 |
} |