| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | # uClibc dlopen tests# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.# rules need a little love to work with glibc ...export UCLIBC_ONLY := 1TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr \	testscopeifneq ($(HAVE_SHARED),y)TESTS_DISABLED := test3LDFLAGS_libtest.so := -lpthreadendifCFLAGS_dltest    := -DLIBNAME="\"./libtest.so\""CFLAGS_dltest2   := -DLIBNAME="\"./libtest3.so\""LDFLAGS_dlstatic := -ldlLDFLAGS_dltest   := -ldlLDFLAGS_dltest2  := -ldlLDFLAGS_dlundef  := -ldlLDFLAGS_dlafk    := -ldl ./libafk.so -Wl,-rpath,.LDFLAGS_test1    := -ldlLDFLAGS_test2    := -ldlLDFLAGS_test3    := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.LDFLAGS_dladdr   := -ldlLDFLAGS_testscope:= -ldlDEBUG_LIBS := XWRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"# Build libC.so without -mprefergot compilation flag to force a# R_SH_JMP_SLOT relocation instead of R_SH_GLOB_DAT for _libC_fini. This is# needed to resolve the _libC_fini symbol when used (by libC.so destructor),# whereas with GLOB_DAT relocation the resolution happens in the GOT entry# when the libC is loaded, for the same reason remove also the "-z now"# linker flag.# These are needed to spot the issue test case want raise.ifeq ($(TARGET_ARCH),sh)CFLAGS-OMIT-libC.c = -mprefergotendifLDFLAGS-OMIT-libC.c = -Wl,-z,nowdltest: libtest.sodltest2: libtest3.sodlstatic: libstatic.sodlundef: libundef.sodlafk: libafk.sotestscope:libA.solibafk.so: libafk-temp.soLDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.test1: libtest1.sotest2: libtest1.so libtest2.sotest3: libtest1.so libtest2.solibtest1.so: libtest2.solibB.so: libC.solibA.so: libB.soLDFLAGS_libtest.so := -lpthreadLDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.LDFLAGS_libtest2.so := -Wl,-rpath,.LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.LDFLAGS_libC.so := -ldlLDFLAGS_libB.so := ./libC.so -Wl,-rpath,.LDFLAGS_libA.so := ./libB.so -Wl,-rpath,.
 |