aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config/t-slibgcc-sld
blob: 03c6a65955173334f8b06bb88af6391c31a63ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Build a shared libgcc library for ELF with symbol versioning
# with the Solaris linker.

SHLIB_LDFLAGS = -Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
	-Wl,-M,$(SHLIB_MAP)

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
	dest=$(gcc_objdir)/tmp$$$$-$<; \
	cp $< $$dest; \
	chmod a+r $$dest; \
	sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/$<

all: install-libgcc-unwind-map-forbuild

install-libgcc-unwind-map: libgcc-unwind.map
	$(INSTALL_DATA) $< $(DESTDIR)$(slibdir)

install: install-libgcc-unwind-map

endif