Makefile.in 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # uClibc TLS tests
  2. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  3. TESTS := tst-tls1 tst-tls2 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 \
  4. tst-tls8 tst-tls9 tst-tls10 tst-tls11 tst-tls12 tst-tls13 \
  5. tst-tls14 tst-tls15 tst-tls16 tst-tls17 tst-tls18 tst-tls-at-ctor \
  6. tst-tls1-static tst-tls2-static tst-tls9-static
  7. TESTS_DISABLED := tst-tls1-static tst-tls2-static tst-tls9-static
  8. #all these tests require shared libraries
  9. ifeq ($(HAVE_SHARED),)
  10. TESTS_DISABLED := $(TESTS)
  11. endif
  12. ifeq ($(TARGET_ARCH),arc)
  13. TESTS_DISABLED += tst-tls12 tst-tls-at-ctor
  14. endif
  15. # All these tests need tls.h, which is not installed with glibc
  16. GLIBC_TESTS_DISABLED := $(addsuffix _glibc,$(filter-out $(TESTS_DISABLED),$(TESTS)))
  17. PTDIR := $(top_builddir)libpthread/nptl
  18. SYSDEPS_DIR := $(top_srcdir)libc/sysdeps
  19. EXTRA_CFLAGS := -DNOT_IN_libc=1 \
  20. -std=gnu99 -I. \
  21. -I$(SYSDEPS_DIR)/linux \
  22. -I$(SYSDEPS_DIR)/linux/$(TARGET_ARCH) \
  23. -I$(PTDIR) \
  24. -I$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH) \
  25. -I$(PTDIR)/sysdeps/$(TARGET_ARCH) \
  26. -I$(PTDIR)/sysdeps/unix/sysv/linux \
  27. -I$(PTDIR)/sysdeps/pthread \
  28. -I$(PTDIR)/sysdeps/pthread/bits \
  29. -I$(PTDIR)/sysdeps/generic \
  30. -I$(top_builddir)ldso/include \
  31. -I$(top_builddir)ldso/ldso/$(TARGET_ARCH) \
  32. -I$(top_builddir)include \
  33. -include $(top_builddir)include/libc-symbols.h
  34. tlsmod17a-suffixes := 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  35. tlsmod18a-suffixes := 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  36. CFLAGS_tst-tlsmod1.so := -fPIC -DSHARED -shared
  37. CFLAGS_tst-tlsmod2.so := -fPIC -DSHARED -shared
  38. CFLAGS_tst-tlsmod3.so := -fPIC -DSHARED -shared
  39. CFLAGS_tst-tlsmod4.so := -fPIC -DSHARED -shared
  40. CFLAGS_tst-tlsmod5.so := -fPIC -DSHARED -shared
  41. CFLAGS_tst-tlsmod6.so := -fPIC -DSHARED -shared
  42. CFLAGS_tst-tlsmod7.so := -fPIC -DSHARED -shared
  43. CFLAGS_tst-tlsmod8.so := -fPIC -DSHARED -shared
  44. CFLAGS_tst-tlsmod9.so := -fPIC -DSHARED -shared
  45. CFLAGS_tst-tlsmod10.so := -fPIC -DSHARED -shared
  46. CFLAGS_tst-tlsmod11.so := -fPIC -DSHARED -shared
  47. CFLAGS_tst-tlsmod12.so := -fPIC -DSHARED -shared
  48. CFLAGS_tst-tlsmod13.so := -fPIC -DSHARED -shared
  49. CFLAGS_tst-tlsmod13a.so := -fPIC -DSHARED -shared
  50. CFLAGS_tst-tlsmod14a.so := -fPIC -DSHARED -shared
  51. CFLAGS_tst-tlsmod14b.so := -fPIC -DSHARED -shared
  52. CFLAGS_tst-tlsmod15a.so := -fPIC -DSHARED -shared
  53. CFLAGS_tst-tlsmod15b.so := -fPIC -DSHARED -shared
  54. CFLAGS_tst-tlsmod16a.so := -fPIC -DSHARED -shared
  55. CFLAGS_tst-tlsmod16b.so := -fPIC -DSHARED -shared
  56. CFLAGS_tst-tlsmod17a.so := -fPIC -DSHARED -shared
  57. CFLAGS_tst-tlsmod17b.so := -fPIC -DSHARED -shared
  58. CFLAGS_tst-tlsmod18a.so := -fPIC -DSHARED -shared
  59. CFLAGS_tst-tlsmod-at-ctor.so := -fPIC -DSHARED -shared
  60. LDFLAGS_tst-tlsmod1.so := -shared -static-libgcc -L$(top_builddir)lib
  61. LDFLAGS_tst-tlsmod2.so := -shared -static-libgcc -L$(top_builddir)lib
  62. LDFLAGS_tst-tlsmod3.so := -shared -static-libgcc -L$(top_builddir)lib \
  63. tst-tlsmod2.so
  64. LDFLAGS_tst-tlsmod4.so := -shared -static-libgcc -L$(top_builddir)lib
  65. LDFLAGS_tst-tlsmod5.so := -shared -static-libgcc -L$(top_builddir)lib
  66. LDFLAGS_tst-tlsmod6.so := -shared -static-libgcc -L$(top_builddir)lib
  67. LDFLAGS_tst-tlsmod7.so := -shared -static-libgcc -L$(top_builddir)lib
  68. LDFLAGS_tst-tlsmod8.so := -shared -static-libgcc -L$(top_builddir)lib \
  69. tst-tlsmod7.so
  70. LDFLAGS_tst-tlsmod9.so := -shared -static-libgcc -L$(top_builddir)lib \
  71. tst-tlsmod8.so
  72. LDFLAGS_tst-tlsmod10.so := -shared -static-libgcc -L$(top_builddir)lib \
  73. tst-tlsmod9.so
  74. LDFLAGS_tst-tlsmod11.so := -shared -static-libgcc -L$(top_builddir)lib
  75. LDFLAGS_tst-tlsmod12.so := -shared -static-libgcc -L$(top_builddir)lib \
  76. tst-tlsmod11.so
  77. LDFLAGS_tst-tlsmod13.so := -shared -static-libgcc -L$(top_builddir)lib
  78. LDFLAGS_tst-tlsmod13a.so := -shared -static-libgcc -L$(top_builddir)lib \
  79. tst-tlsmod13.so
  80. LDFLAGS_tst-tlsmod14a.so := -shared -static-libgcc -L$(top_builddir)lib
  81. LDFLAGS_tst-tlsmod14b.so := -shared -static-libgcc -L$(top_builddir)lib
  82. LDFLAGS_tst-tlsmod15a.so := -shared -static-libgcc -L$(top_builddir)lib
  83. LDFLAGS_tst-tlsmod15b.so := -shared -static-libgcc -L$(top_builddir)lib
  84. LDFLAGS_tst-tlsmod16a.so := -shared -static-libgcc -L$(top_builddir)lib
  85. LDFLAGS_tst-tlsmod16b.so := -shared -static-libgcc -L$(top_builddir)lib
  86. LDFLAGS_tst-tlsmod17a.so := -shared -static-libgcc -L$(top_builddir)lib
  87. LDFLAGS_tst-tlsmod17b.so := -shared -static-libgcc -L$(top_builddir)lib \
  88. $(patsubst %,tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
  89. LDFLAGS_tst-tlsmod18a.so := -shared -static-libgcc -L$(top_builddir)lib
  90. LDFLAGS_tst-tlsmod-at-ctor.so := -shared -static-libgcc -L$(top_builddir)lib
  91. LDFLAGS_tst-tls3 := tst-tlsmod1.so tst-tlsmod4.so
  92. LDFLAGS_tst-tls4 := -ldl
  93. LDFLAGS_tst-tls5 := -ldl
  94. LDFLAGS_tst-tls6 := -ldl
  95. LDFLAGS_tst-tls7 := -ldl
  96. LDFLAGS_tst-tls8 := -ldl
  97. LDFLAGS_tst-tls9 := -ldl
  98. LDFLAGS_tst-tls10 := -Wl,-rpath-link=. tst-tlsmod8.so tst-tlsmod7.so
  99. LDFLAGS_tst-tls11 := -Wl,-rpath-link=. tst-tlsmod9.so tst-tlsmod10.so
  100. LDFLAGS_tst-tls12 := -Wl,-rpath-link=. tst-tlsmod11.so tst-tlsmod12.so
  101. LDFLAGS_tst-tls13 := -ldl -Wl,-rpath-link=.
  102. LDFLAGS_tst-tls14 := -ldl -Wl,-rpath-link=. tst-tlsmod14a.so
  103. LDFLAGS_tst-tls15 := -ldl -Wl,-rpath-link=.
  104. LDFLAGS_tst-tls16 := -ldl -Wl,-rpath-link=.
  105. LDFLAGS_tst-tls17 := -ldl -Wl,-rpath-link=.
  106. LDFLAGS_tst-tls18 := -ldl -Wl,-rpath-link=.
  107. LDFLAGS_tst-tls-at-ctor := tst-tlsmod-at-ctor.so
  108. tst-tls3: tst-tlsmod1.so tst-tlsmod4.so
  109. tst-tls4: tst-tlsmod2.so
  110. tst-tls5: tst-tlsmod2.so
  111. tst-tls6: tst-tlsmod2.so
  112. tst-tls7: tst-tlsmod2.so tst-tlsmod3.so
  113. tst-tls8: tst-tlsmod2.so tst-tlsmod3.so tst-tlsmod4.so
  114. tst-tls9: tst-tlsmod5.so tst-tlsmod6.so
  115. tst-tls10: tst-tlsmod7.so tst-tlsmod8.so
  116. tst-tls11: tst-tlsmod9.so tst-tlsmod10.so
  117. tst-tls12: tst-tlsmod11.so tst-tlsmod12.so
  118. tst-tls13: tst-tlsmod13.so tst-tlsmod13a.so
  119. tst-tls14: tst-tlsmod14a.so tst-tlsmod14b.so
  120. tst-tls15: tst-tlsmod15b.so
  121. tst-tls16: tst-tlsmod16a.so tst-tlsmod16b.so
  122. tst-tls17: tst-tlsmod17b.so
  123. tst-tlsmod17b.so: $(patsubst %,tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
  124. tst-tlsmod17a%.so: tst-tlsmod17a.c
  125. $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_tst-tlsmod17a.so) $< -o $@ \
  126. -DN=$* -Wl,-soname,$@ $(LDFLAGS) $(EXTRA_LIBS) \
  127. $(LDFLAGS_tst-tlsmod17a.so)
  128. tst-tls18: $(patsubst %,tst-tlsmod18a%.so,$(tlsmod18a-suffixes))
  129. tst-tlsmod18a%.so: tst-tlsmod18a.c
  130. $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_tst-tlsmod18a.so) $< -o $@ \
  131. -DN=$* -Wl,-soname,$@ $(LDFLAGS) $(EXTRA_LIBS) \
  132. $(LDFLAGS_tst-tlsmod18a.so)
  133. tst-tls-at-ctor: tst-tlsmod-at-ctor.so
  134. ifeq ($(TARGET_ARCH),mips)
  135. RET_tst-tls15 := 1
  136. endif
  137. WRAPPER := env LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"