diff options
author | nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-11 17:31:07 +0000 |
---|---|---|
committer | nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-11 17:31:07 +0000 |
commit | 6e6c7fc1e15525a10f48d4f5ac2edd853e2f5cb7 (patch) | |
tree | c674d4b5cbcfa29cc16dea6f58d98d91bfa6a14b /libgcc | |
parent | a3b46c9c686a3623e81e42fcb5851ffd01585c4f (diff) |
[i386][musl] Add cpuinfo to static libgcc only on *-musl*
The __cpu_indicator_init and __cpu_model symbols are not safe to use
from shared libgcc_s.so from ifunc resolvers, so since gcc-6, only
the definitions from static libgcc.a are used, however the symbols
are kept in libgcc_s as well for backward compatibility (with
appropriate symbol version). On targets without such backward
compatibility concern add cpuinfo to the static library only (this
avoids running the ctor, reduces libgcc_s size and elf abi concerns
about the versioned symbols).
libgcc/
2016-11-11 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use
i386/t-cpuinfo-static instead of i386/t-cpuinfo.
* config/i386/t-cpuinfo-static: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242268 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 6 | ||||
-rw-r--r-- | libgcc/config.host | 9 | ||||
-rw-r--r-- | libgcc/config/i386/t-cpuinfo-static | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e3a81f6b0261..f682e570f2fe 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-11 Szabolcs Nagy <szabolcs.nagy@arm.com> + + * config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use + i386/t-cpuinfo-static instead of i386/t-cpuinfo. + * config/i386/t-cpuinfo-static: New. + 2016-11-03 Martin Liska <mliska@suse.cz> * libgcov-profiler.c (__gcov_time_profiler): Remove. diff --git a/libgcc/config.host b/libgcc/config.host index 4291cfef5b47..64beb219f316 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1320,7 +1320,14 @@ esac case ${host} in i[34567]86-*-* | x86_64-*-*) - tmake_file="${tmake_file} i386/t-cpuinfo" + case ${host} in + *-musl*) + tmake_file="${tmake_file} i386/t-cpuinfo-static" + ;; + *) + tmake_file="${tmake_file} i386/t-cpuinfo" + ;; + esac ;; esac diff --git a/libgcc/config/i386/t-cpuinfo-static b/libgcc/config/i386/t-cpuinfo-static new file mode 100644 index 000000000000..5617bc14eed4 --- /dev/null +++ b/libgcc/config/i386/t-cpuinfo-static @@ -0,0 +1,4 @@ +# If the compatibility cpuinfo symbols in shared libgcc_s are not needed +# then they can be added to the static library only. + +LIB2ADD_ST += $(srcdir)/config/i386/cpuinfo.c |