Makefile.in 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  7. CFLAGS_dltest := -DLIBNAME="\"./libtest.so\""
  8. CFLAGS_dltest2 := -DLIBNAME="\"./libtest3.so\""
  9. LDFLAGS_dlstatic := -ldl
  10. LDFLAGS_dltest := -ldl
  11. LDFLAGS_dltest2 := -ldl
  12. LDFLAGS_dlundef := -ldl
  13. LDFLAGS_dlafk := -ldl ./libafk.so -Wl,-rpath,.
  14. LDFLAGS_test1 := -ldl
  15. LDFLAGS_test2 := -ldl
  16. LDFLAGS_test3 := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
  17. LDFLAGS_dladdr := -ldl
  18. LDFLAGS_testscope:= -ldl
  19. DEBUG_LIBS := X
  20. WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
  21. # Build libC.so without -mprefergot compilation flag to force a
  22. # R_SH_JMP_SLOT relocation instead of R_SH_GLOB_DAT for _libC_fini. This is
  23. # needed to resolve the _libC_fini symbol when used (by libC.so destructor),
  24. # whereas with GLOB_DAT relocation the resolution happens in the GOT entry
  25. # when the libC is loaded, for the same reason remove also the "-z now"
  26. # linker flag.
  27. # These are needed to spot the issue test case want raise.
  28. ifeq ($(TARGET_ARCH),sh)
  29. CFLAGS-OMIT-libC.c = -mprefergot
  30. endif
  31. LDFLAGS-OMIT-libC.c = -Wl,-z,now
  32. dltest: libtest.so
  33. dltest2: libtest3.so
  34. dlstatic: libstatic.so
  35. dlundef: libundef.so
  36. dlafk: libafk.so
  37. testscope:libA.so
  38. libafk.so: libafk-temp.so
  39. LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
  40. test1: libtest1.so
  41. test2: libtest1.so libtest2.so
  42. test3: libtest1.so libtest2.so
  43. libtest1.so: libtest2.so
  44. libB.so: libC.so
  45. libA.so: libB.so
  46. LDFLAGS_libtest.so := -lpthread
  47. LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
  48. LDFLAGS_libtest2.so := -Wl,-rpath,.
  49. LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.
  50. LDFLAGS_libC.so := -ldl
  51. LDFLAGS_libB.so := ./libC.so -Wl,-rpath,.
  52. LDFLAGS_libA.so := ./libB.so -Wl,-rpath,.