Makefile.in 2.0 KB

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