* 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
+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
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@
# 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
set_use_emutls
set_have_cc_tls
vis_hide
+solaris_ld_v2_maps
real_host_noncanonical
accel_dir_suffix
force_explicit_eh_registry
;;
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.
;;
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.