2 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
4 # rules need a little love to work with glibc ...
5 export UCLIBC_ONLY := 1
7 TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr \
10 ifneq ($(HAVE_SHARED),y)
11 TESTS_DISABLED := test3
12 LDFLAGS_libtest.so := -lpthread
15 CFLAGS_dltest := -DLIBNAME="\"./libtest.so\""
16 CFLAGS_dltest2 := -DLIBNAME="\"./libtest3.so\""
18 LDFLAGS_dlstatic := -ldl
19 LDFLAGS_dltest := -ldl
20 LDFLAGS_dltest2 := -ldl
21 LDFLAGS_dlundef := -ldl
22 LDFLAGS_dlafk := -ldl ./libafk.so -Wl,-rpath,.
25 LDFLAGS_test3 := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
26 LDFLAGS_dladdr := -ldl
27 LDFLAGS_testscope:= -ldl
30 WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
32 # Build libC.so without -mprefergot compilation flag to force a
33 # R_SH_JMP_SLOT relocation instead of R_SH_GLOB_DAT for _libC_fini. This is
34 # needed to resolve the _libC_fini symbol when used (by libC.so destructor),
35 # whereas with GLOB_DAT relocation the resolution happens in the GOT entry
36 # when the libC is loaded, for the same reason remove also the "-z now"
38 # These are needed to spot the issue test case want raise.
40 ifeq ($(TARGET_ARCH),sh)
41 CFLAGS-OMIT-libC.c = -mprefergot
43 LDFLAGS-OMIT-libC.c = -Wl,-z,now
47 dlstatic: libstatic.so
51 libafk.so: libafk-temp.so
52 LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
54 test2: libtest1.so libtest2.so
55 test3: libtest1.so libtest2.so
56 libtest1.so: libtest2.so
59 LDFLAGS_libtest.so := -lpthread
60 LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
61 LDFLAGS_libtest2.so := -Wl,-rpath,.
62 LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.
63 LDFLAGS_libC.so := -ldl
64 LDFLAGS_libB.so := ./libC.so -Wl,-rpath,.
65 LDFLAGS_libA.so := ./libB.so -Wl,-rpath,.