t-slibgcc-sld 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Build a shared libgcc library for ELF with symbol versioning
  2. # with the Solaris linker.
  3. SHLIB_LDFLAGS = -Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
  4. -Wl,-M,$(SHLIB_MAP)
  5. ifeq ($(enable_shared),yes)
  6. # Linker mapfile to enforce direct binding to libgcc_s unwinder
  7. # (PR target/59788).
  8. # Emit v2 mapfile syntax if possible, otherwise ld -z guidance complains
  9. # every time the mapfile is used.
  10. libgcc-unwind.map: libgcc-std.ver
  11. ifeq ($(solaris_ld_v2_maps),yes)
  12. @(echo '$$mapfile_version 2'; \
  13. echo "SYMBOL_SCOPE {"; \
  14. for f in `grep _Unwind_ $< | sort`; do \
  15. echo " $$f { FLAGS = EXTERN DIRECT };"; \
  16. done; \
  17. echo "};" ) > $@
  18. else
  19. @(echo "{"; \
  20. for f in `grep _Unwind_ $< | sort`; do \
  21. echo " $$f = EXTERN DIRECT;"; \
  22. done; \
  23. echo "};" ) > $@
  24. endif
  25. # Copy libgcc-unwind.map to the place where gcc will look for it at build-time.
  26. install-libgcc-unwind-map-forbuild: libgcc-unwind.map
  27. dest=$(gcc_objdir)/tmp$$$$-$<; \
  28. cp $< $$dest; \
  29. chmod a+r $$dest; \
  30. sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/$<
  31. all: install-libgcc-unwind-map-forbuild
  32. install-libgcc-unwind-map: libgcc-unwind.map
  33. $(INSTALL_DATA) $< $(DESTDIR)$(slibdir)
  34. install: install-libgcc-unwind-map
  35. endif