Makefile.in 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # uClibc-ng dlopen tests
  2. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  3. TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr \
  4. testscope nodelete nodelete1 tst-origin
  5. ifneq ($(HAVE_SHARED),y)
  6. TESTS_DISABLED := test3
  7. LDFLAGS_libtest.so := -lpthread
  8. endif
  9. CFLAGS_dltest := -DLIBNAME="\"./libtest.so\""
  10. CFLAGS_dltest2 := -DLIBNAME="\"./libtest3.so\""
  11. LDFLAGS_dlstatic := -ldl
  12. LDFLAGS_dltest := -ldl
  13. LDFLAGS_dltest2 := -ldl
  14. LDFLAGS_dlundef := -ldl
  15. LDFLAGS_dlafk := -ldl ./libafk.so -Wl,-rpath,.
  16. LDFLAGS_test1 := -ldl
  17. LDFLAGS_test2 := -ldl
  18. LDFLAGS_test3 := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
  19. LDFLAGS_dladdr := -ldl
  20. LDFLAGS_testscope:= -ldl
  21. LDFLAGS_tst-origin:= -ldl -Wl,-rpath,\$$ORIGIN/testlib
  22. DEBUG_LIBS := X
  23. WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
  24. testlib:
  25. @mkdir $@
  26. testlib/libtest31.so: libtest3.so | testlib
  27. @cp $^ $@
  28. EXTRA_DIRS := testlib
  29. # Build libC.so without -mprefergot compilation flag to force a
  30. # R_SH_JMP_SLOT relocation instead of R_SH_GLOB_DAT for _libC_fini. This is
  31. # needed to resolve the _libC_fini symbol when used (by libC.so destructor),
  32. # whereas with GLOB_DAT relocation the resolution happens in the GOT entry
  33. # when the libC is loaded, for the same reason remove also the "-z now"
  34. # linker flag.
  35. # These are needed to spot the issue test case want raise.
  36. ifeq ($(TARGET_ARCH),sh)
  37. CFLAGS-OMIT-libC.c = -mprefergot
  38. endif
  39. LDFLAGS-OMIT-libC.c = -Wl,-z,now
  40. dltest: libtest.so
  41. dltest2: libtest3.so
  42. dlstatic: libstatic.so
  43. dlundef: libundef.so
  44. dlafk: libafk.so
  45. testscope:libA.so
  46. libafk.so: libafk-temp.so
  47. LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
  48. test1: libtest1.so
  49. test2: libtest1.so libtest2.so
  50. test3: libtest1.so libtest2.so
  51. tst-origin: testlib/libtest31.so
  52. libtest1.so: libtest2.so
  53. libB.so: libC.so
  54. libA.so: libB.so
  55. LDFLAGS_libtest.so := -lpthread
  56. LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
  57. LDFLAGS_libtest2.so := -Wl,-rpath,.
  58. LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.
  59. LDFLAGS_libC.so := -ldl
  60. LDFLAGS_libB.so := ./libC.so -Wl,-rpath,.
  61. LDFLAGS_libA.so := ./libB.so -Wl,-rpath,.
  62. nodelete: nodelmod1.so nodelmod2.so nodelmod3.so
  63. nodelmod3.so: nodelmod4.so
  64. LDFLAGS_nodelete := -rdynamic -ldl
  65. LDFLAGS_nodelmod1.so := -Wl,-z,nodelete
  66. LDFLAGS_nodelmod3.so := ./nodelmod4.so
  67. LDFLAGS_nodelmod4.so := -Wl,-z,nodelete
  68. nodelete1: nodelmod1.so nodelmod2.so
  69. LDFLAGS_nodelete1 := -rdynamic -ldl