toolchain.eclass: filter out -mstackrealign, bug #688580
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 26 Oct 2019 16:33:17 +0000 (17:33 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 26 Oct 2019 16:36:09 +0000 (17:36 +0100)
-mstackrealign breaks stack unwinding via _Unwind_RaiseException
in libgcc_s.so.1. Not clear why exactly. Probably by breaking
unwinding information during realignment.

The change works it around by dropping -mstackrealign when building gcc.

Reported-by: Erik
Bug: https://bugs.gentoo.org/688580
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index b1ba774ea0c8bbe019700e48542d7195316dad1e..7e88900737ac84176cd875befe9ac9114c0af348 100644 (file)
@@ -1547,6 +1547,13 @@ gcc_do_filter_flags() {
                filter-flags -Wstack-protector
        fi
 
+       if tc_version_is_between 6 8 ; then
+               # -mstackrealign triggers crashes in exception throwing
+               # at least on ada: bug #688580
+               # The reason is unknown. Drop the flag for now.
+               filter-flags -mstackrealign
+       fi
+
        if tc_version_is_at_least 3.4 ; then
                case $(tc-arch) in
                        amd64|x86)