aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2018-09-18 07:04:15 +0000
committerRainer Orth <ro@gcc.gnu.org>2018-09-18 07:04:15 +0000
commit53c6feb2b2621bdfe3415dd6f664283917817491 (patch)
tree7410a7bb6984cef1930df018183c75fc75a692b5
parente6bf23cce3ed63800f4545cd9a79e3500b24625c (diff)
downloadgcc-53c6feb2b2621bdfe3415dd6f664283917817491.zip
gcc-53c6feb2b2621bdfe3415dd6f664283917817491.tar.gz
gcc-53c6feb2b2621bdfe3415dd6f664283917817491.tar.bz2
Use v2 map syntax in libgcc-unwind.map if Solaris ld supports it
* configure.ac (solaris_ld_v2_maps): New test. * configure: Regenerate. * Makefile.in (solaris_ld_v2_maps): New variable. * config/t-slibgcc-sld (libgcc-unwind.map): Emit v2 mapfile syntax if supported. From-SVN: r264382
-rw-r--r--libgcc/ChangeLog8
-rw-r--r--libgcc/Makefile.in1
-rw-r--r--libgcc/config/t-slibgcc-sld11
-rw-r--r--libgcc/configure21
-rw-r--r--libgcc/configure.ac15
5 files changed, 56 insertions, 0 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 8a350e1..3a7602f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (solaris_ld_v2_maps): New test.
+ * configure: Regenerate.
+ * Makefile.in (solaris_ld_v2_maps): New variable.
+ * config/t-slibgcc-sld (libgcc-unwind.map): Emit v2 mapfile syntax
+ if supported.
+
2018-08-23 Richard Earnshaw <rearnsha@arm.com>
PR target/86951
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 0c5b264..0766de5 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -44,6 +44,7 @@ enable_vtable_verify = @enable_vtable_verify@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
with_aix_soname = @with_aix_soname@
+solaris_ld_v2_maps = @solaris_ld_v2_maps@
enable_execute_stack = @enable_execute_stack@
unwind_header = @unwind_header@
md_unwind_header = @md_unwind_header@
diff --git a/libgcc/config/t-slibgcc-sld b/libgcc/config/t-slibgcc-sld
index 0b95391..03c6a65 100644
--- a/libgcc/config/t-slibgcc-sld
+++ b/libgcc/config/t-slibgcc-sld
@@ -8,12 +8,23 @@ ifeq ($(enable_shared),yes)
# Linker mapfile to enforce direct binding to libgcc_s unwinder
# (PR target/59788).
+# Emit v2 mapfile syntax if possible, otherwise ld -z guidance complains
+# every time the mapfile is used.
libgcc-unwind.map: libgcc-std.ver
+ifeq ($(solaris_ld_v2_maps),yes)
+ @(echo '$$mapfile_version 2'; \
+ echo "SYMBOL_SCOPE {"; \
+ for f in `grep _Unwind_ $< | sort`; do \
+ echo " $$f { FLAGS = EXTERN DIRECT };"; \
+ done; \
+ echo "};" ) > $@
+else
@(echo "{"; \
for f in `grep _Unwind_ $< | sort`; do \
echo " $$f = EXTERN DIRECT;"; \
done; \
echo "};" ) > $@
+endif
# Copy libgcc-unwind.map to the place where gcc will look for it at build-time.
install-libgcc-unwind-map-forbuild: libgcc-unwind.map
diff --git a/libgcc/configure b/libgcc/configure
index 090e548..f0b6116 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -570,6 +570,7 @@ sfp_machine_header
set_use_emutls
set_have_cc_tls
vis_hide
+solaris_ld_v2_maps
real_host_noncanonical
accel_dir_suffix
force_explicit_eh_registry
@@ -5176,6 +5177,26 @@ EOF
;;
esac
+# Check if Solaris linker support v2 linker mapfile syntax.
+# Link with -nostartfiles -nodefaultlibs since neither are present while
+# building libgcc.
+case ${host} in
+*-*-solaris2*)
+ solaris_ld_v2_maps=no
+ echo 'int main(void) {return 0;}' > conftest.c
+ echo '$mapfile_version 2' > conftest.map
+ if { ac_try='${CC-cc} -nostartfiles -nodefaultlibs -Wl,-M,conftest.map -o conftest conftest.c 1>&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ solaris_ld_v2_maps=yes
+ fi
+ ;;
+esac
+
+
# Check if xtensa target is configured for windowed ABI and thus needs to use
# custom unwind code.
# This is after config.host so we can augment tmake_file.
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 9d0bbca..5fcbac6 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -459,6 +459,21 @@ EOF
;;
esac
+# Check if Solaris linker support v2 linker mapfile syntax.
+# Link with -nostartfiles -nodefaultlibs since neither are present while
+# building libgcc.
+case ${host} in
+*-*-solaris2*)
+ solaris_ld_v2_maps=no
+ echo 'int main(void) {return 0;}' > conftest.c
+ echo '$mapfile_version 2' > conftest.map
+ if AC_TRY_COMMAND([${CC-cc} -nostartfiles -nodefaultlibs -Wl,-M,conftest.map -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
+ solaris_ld_v2_maps=yes
+ fi
+ ;;
+esac
+AC_SUBST(solaris_ld_v2_maps)
+
# Check if xtensa target is configured for windowed ABI and thus needs to use
# custom unwind code.
# This is after config.host so we can augment tmake_file.