Makefile.in 2.4 KB

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