Makefile 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. # The i387 `long double' is a distinct type we support.
  2. long-double-fcts = yes
  3. ifeq (yes,$(have-z-mark-plt))
  4. # Always generate DT_X86_64_PLT* tags.
  5. sysdep-LDFLAGS += -Wl,-z,mark-plt
  6. # Never generate DT_X86_64_PLT* tags on ld.so to avoid changing its own
  7. # PLT.
  8. LDFLAGS-rtld += -Wl,-z,nomark-plt
  9. endif
  10. ifeq ($(subdir),csu)
  11. gen-as-const-headers += link-defines.sym
  12. gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
  13. endif
  14. ifeq ($(subdir),gmon)
  15. sysdep_routines += _mcount
  16. # We cannot compile _mcount.S with -pg because that would create
  17. # recursive calls when ENTRY is used. Just copy the normal static
  18. # object.
  19. sysdep_noprof += _mcount
  20. ifeq (yes,$(have-x86-apx))
  21. CFLAGS-mcount.c += -mno-apxf
  22. endif
  23. endif
  24. ifeq ($(subdir),string)
  25. sysdep_routines += \
  26. strcasecmp_l-nonascii \
  27. strcspn-generic \
  28. strncase_l-nonascii \
  29. strpbrk-generic \
  30. strspn-generic \
  31. varshift \
  32. # sysdep_routines
  33. gen-as-const-headers += locale-defines.sym
  34. tests += \
  35. tst-rsi-strlen \
  36. # tests
  37. endif
  38. ifeq ($(subdir),elf)
  39. # There is no good reason to use MMX in x86-64 ld.so with GCC.
  40. CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
  41. -mno-mmx)
  42. modules-names += ifuncmod8
  43. $(objpfx)ifuncmain8: $(objpfx)ifuncmod8.so
  44. tests += tst-quad1 tst-quad2
  45. modules-names += tst-quadmod1 tst-quadmod2
  46. $(objpfx)tst-quad1: $(objpfx)tst-quadmod1.so
  47. $(objpfx)tst-quad2: $(objpfx)tst-quadmod2.so
  48. quad-pie-test += tst-quad1pie tst-quad2pie
  49. tests += $(quad-pie-test)
  50. tests-pie += $(quad-pie-test)
  51. test-extras += tst-quadmod1pie tst-quadmod2pie
  52. extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
  53. $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
  54. $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
  55. CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
  56. CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
  57. tests += tst-platform-1
  58. modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
  59. extra-test-objs += tst-platformmod-2.o
  60. CFLAGS-tst-platform-1.c = -mno-avx
  61. CFLAGS-tst-platformmod-1.c = -mno-avx
  62. CFLAGS-tst-platformmod-2.c = -mno-avx
  63. LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
  64. $(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
  65. $(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
  66. # Turn off AVX512F and AVX2 so that GLRO(dl_platform) is
  67. # always set to x86_64.
  68. tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
  69. GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
  70. tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
  71. tst-audit10 tst-sse tst-avx tst-avx512
  72. test-extras += tst-audit4-aux tst-audit10-aux \
  73. tst-avx-aux tst-avx512-aux
  74. extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o \
  75. tst-avx-aux.o tst-avx512-aux.o
  76. ifeq ($(have-insert),yes)
  77. tests += tst-split-dynreloc
  78. LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds
  79. tst-split-dynreloc-ENV = LD_BIND_NOW=1
  80. endif
  81. modules-names += tst-auditmod3a tst-auditmod3b \
  82. tst-auditmod4a tst-auditmod4b \
  83. tst-auditmod5a tst-auditmod5b \
  84. tst-auditmod6a tst-auditmod6b tst-auditmod6c \
  85. tst-auditmod7a tst-auditmod7b \
  86. tst-auditmod10a tst-auditmod10b \
  87. tst-ssemod tst-avxmod tst-avx512mod
  88. $(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
  89. $(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
  90. tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
  91. $(objpfx)tst-audit4: $(objpfx)tst-audit4-aux.o $(objpfx)tst-auditmod4a.so
  92. $(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
  93. tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
  94. $(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
  95. $(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
  96. tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
  97. $(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
  98. $(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
  99. $(objpfx)tst-auditmod6c.so
  100. tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
  101. $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
  102. $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
  103. tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
  104. $(objpfx)tst-audit10: $(objpfx)tst-audit10-aux.o $(objpfx)tst-auditmod10a.so
  105. $(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so
  106. tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so
  107. $(objpfx)tst-sse: $(objpfx)tst-ssemod.so
  108. $(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so
  109. $(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so
  110. AVX-CFLAGS=-mavx -mno-vzeroupper
  111. CFLAGS-tst-audit4-aux.c += $(AVX-CFLAGS)
  112. CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
  113. CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
  114. CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
  115. CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
  116. CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
  117. CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
  118. CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
  119. AVX512-CFLAGS = -mavx512f
  120. CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
  121. CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
  122. CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
  123. CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
  124. $(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
  125. $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
  126. $(objpfx)tst-glibc-hwcaps.out: \
  127. $(objpfx)libmarkermod2.so \
  128. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so \
  129. $(objpfx)libmarkermod3.so \
  130. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so \
  131. $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so \
  132. $(objpfx)libmarkermod4.so \
  133. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so \
  134. $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so \
  135. $(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so \
  136. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so: $(objpfx)libmarkermod2-2.so
  137. $(make-target-directory)
  138. cp $< $@
  139. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so: $(objpfx)libmarkermod3-2.so
  140. $(make-target-directory)
  141. cp $< $@
  142. $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so: $(objpfx)libmarkermod3-3.so
  143. $(make-target-directory)
  144. cp $< $@
  145. $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so: $(objpfx)libmarkermod4-2.so
  146. $(make-target-directory)
  147. cp $< $@
  148. $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so: $(objpfx)libmarkermod4-3.so
  149. $(make-target-directory)
  150. cp $< $@
  151. $(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so: $(objpfx)libmarkermod4-4.so
  152. $(make-target-directory)
  153. cp $< $@
  154. ifeq (no,$(build-hardcoded-path-in-tests))
  155. # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
  156. # interferes with its test objectives.
  157. tests-container += tst-glibc-hwcaps-cache
  158. endif
  159. ifeq (yes,$(have-z-mark-plt))
  160. tests += \
  161. tst-plt-rewrite1 \
  162. tst-plt-rewrite2 \
  163. # tests
  164. modules-names += \
  165. tst-plt-rewritemod1 \
  166. tst-plt-rewritemod2 \
  167. # modules-names
  168. tst-plt-rewrite1-no-pie = yes
  169. LDFLAGS-tst-plt-rewrite1 = -Wl,-z,now
  170. ifeq ($(have-test-cc-cflags-fsemantic-interposition),yes)
  171. CFLAGS-tst-plt-rewritemod1.c += -fsemantic-interposition
  172. endif
  173. LDFLAGS-tst-plt-rewritemod1.so = -Wl,-z,now
  174. tst-plt-rewrite1-ENV = GLIBC_TUNABLES=glibc.cpu.plt_rewrite=1 LD_DEBUG=files:bindings
  175. $(objpfx)tst-plt-rewrite1: $(objpfx)tst-plt-rewritemod1.so
  176. $(objpfx)tst-plt-rewrite1.out: /dev/null $(objpfx)tst-plt-rewrite1
  177. $(tst-plt-rewrite1-ENV) $(make-test-out) > $@ 2>&1; \
  178. grep -q -E "changing 'bar' PLT entry in .*/elf/tst-plt-rewritemod1.so' to direct branch" $@; \
  179. $(evaluate-test)
  180. tst-plt-rewrite2-no-pie = yes
  181. LDFLAGS-tst-plt-rewrite2 = -Wl,-z,now
  182. LDFLAGS-tst-plt-rewritemod2.so = -Wl,-z,now,-z,undefs
  183. tst-plt-rewrite2-ENV = GLIBC_TUNABLES=glibc.cpu.plt_rewrite=2
  184. $(objpfx)tst-plt-rewrite2: $(objpfx)tst-plt-rewritemod2.so
  185. endif
  186. tests-special += $(objpfx)check-dt-x86-64-plt.out
  187. $(objpfx)check-dt-x86-64-plt.out: $(common-objpfx)libc.so
  188. LC_ALL=C $(READELF) -V -W $< \
  189. | sed -ne '/.gnu.version_d/, /.gnu.version_r/ p' \
  190. | grep GLIBC_ABI_DT_X86_64_PLT > $@; \
  191. $(evaluate-test)
  192. generated += check-dt-x86-64-plt.out
  193. test-internal-extras += tst-gnu2-tls2mod1
  194. tests-special += $(objpfx)check-rtld.out
  195. $(objpfx)rtld.reloc: $(objpfx)rtld.os
  196. @rm -f $@T
  197. LC_ALL=C $(READELF) -rW $< > $@T
  198. test -s $@T
  199. mv -f $@T $@
  200. common-generated += $(objpfx)rtld.reloc
  201. # Verify that there are no run-time relocations against __ehdr_start nor
  202. # _end.
  203. $(objpfx)check-rtld.out: $(objpfx)rtld.reloc
  204. LC_ALL=C; \
  205. if grep -E "R_X86_64_64.*(__ehdr_start|_end)" $^ > $@; \
  206. then false; else true; fi; \
  207. $(evaluate-test)
  208. generated += check-rtld.out
  209. endif # $(subdir) == elf
  210. ifeq ($(subdir),wcsmbs)
  211. sysdep_routines += \
  212. wcpcpy-generic \
  213. wcpncpy-generic \
  214. wcscat-generic \
  215. wcscpy-generic \
  216. wcsncat-generic \
  217. wcsncmp-generic \
  218. wcsncpy-generic \
  219. wcsnlen-generic \
  220. # sysdep_routines
  221. tests += \
  222. tst-rsi-wcslen \
  223. # tests
  224. endif
  225. ifeq ($(subdir),setjmp)
  226. ifneq ($(enable-cet),no)
  227. tests += \
  228. tst-setjmp-cet \
  229. # tests
  230. tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
  231. endif
  232. endif
  233. ifneq ($(enable-cet),no)
  234. # Add -fcf-protection to CFLAGS when CET is enabled.
  235. CFLAGS-.o += -fcf-protection
  236. CFLAGS-.os += -fcf-protection
  237. CFLAGS-.op += -fcf-protection
  238. CFLAGS-.oS += -fcf-protection
  239. # Compile assembly codes with <cet.h> when CET is enabled.
  240. asm-CPPFLAGS += -fcf-protection -include cet.h
  241. ifeq ($(subdir),elf)
  242. sysdep-dl-routines += dl-cet
  243. tests += \
  244. tst-cet-legacy-1 \
  245. tst-cet-legacy-10 \
  246. tst-cet-legacy-10-static \
  247. tst-cet-legacy-10a \
  248. tst-cet-legacy-10a-static \
  249. tst-cet-legacy-1a \
  250. tst-cet-legacy-2 \
  251. tst-cet-legacy-2a \
  252. tst-cet-legacy-3 \
  253. tst-cet-legacy-4 \
  254. tst-cet-legacy-5a \
  255. tst-cet-legacy-6a \
  256. tst-cet-legacy-7 \
  257. tst-cet-legacy-8 \
  258. tst-cet-legacy-9 \
  259. tst-cet-legacy-9-static \
  260. # tests
  261. tests-static += \
  262. tst-cet-legacy-10-static \
  263. tst-cet-legacy-10a-static \
  264. tst-cet-legacy-9-static \
  265. # tests-static
  266. tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
  267. tests += \
  268. tst-shstk-legacy-1a \
  269. tst-shstk-legacy-1a-static \
  270. tst-shstk-legacy-1b \
  271. tst-shstk-legacy-1b-static \
  272. tst-shstk-legacy-1c \
  273. tst-shstk-legacy-1c-static \
  274. tst-shstk-legacy-1d \
  275. tst-shstk-legacy-1d-static \
  276. tst-shstk-legacy-1e \
  277. tst-shstk-legacy-1e-static \
  278. tst-shstk-legacy-1f \
  279. tst-shstk-legacy-1g \
  280. # tests
  281. modules-names += \
  282. tst-shstk-legacy-mod-1 \
  283. # modules-names
  284. tests-static += \
  285. tst-shstk-legacy-1a-static \
  286. tst-shstk-legacy-1b-static \
  287. tst-shstk-legacy-1c-static \
  288. tst-shstk-legacy-1d-static \
  289. tst-shstk-legacy-1e-static \
  290. # tests-static
  291. extra-objs += \
  292. tst-shstk-legacy-1-extra.o \
  293. # extra-objs
  294. tests += \
  295. tst-cet-legacy-4a \
  296. tst-cet-legacy-4b \
  297. tst-cet-legacy-4c \
  298. tst-cet-legacy-5b \
  299. tst-cet-legacy-6b \
  300. # tests
  301. modules-names += \
  302. tst-cet-legacy-mod-1 \
  303. tst-cet-legacy-mod-2 \
  304. tst-cet-legacy-mod-4 \
  305. tst-cet-legacy-mod-5a \
  306. tst-cet-legacy-mod-5b \
  307. tst-cet-legacy-mod-5c \
  308. tst-cet-legacy-mod-6a \
  309. tst-cet-legacy-mod-6b \
  310. tst-cet-legacy-mod-6c \
  311. # modules-names
  312. CFLAGS-tst-cet-legacy-2.c += -fcf-protection=none -fcf-protection=branch
  313. CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
  314. CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
  315. CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
  316. CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
  317. CFLAGS-tst-cet-legacy-4.c += -fcf-protection=none -fcf-protection=branch
  318. CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
  319. CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
  320. CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
  321. CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
  322. CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
  323. ifeq ($(enable-cet),permissive)
  324. CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
  325. endif
  326. CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
  327. CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
  328. CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=none -fcf-protection=branch
  329. CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
  330. CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
  331. CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
  332. ifeq ($(enable-cet),permissive)
  333. CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
  334. endif
  335. CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
  336. CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
  337. CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=none -fcf-protection=branch
  338. CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
  339. CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
  340. CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
  341. CFLAGS-tst-cet-legacy-10.c += -mshstk
  342. CFLAGS-tst-cet-legacy-10-static.c += -mshstk
  343. CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none -mshstk
  344. CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none -mshstk
  345. tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  346. tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  347. tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  348. tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  349. tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  350. tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  351. CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
  352. CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
  353. CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
  354. CFLAGS-tst-shstk-legacy-1d-static.c += -fcf-protection=none
  355. CFLAGS-tst-shstk-legacy-1f.c += -fcf-protection=none
  356. $(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
  357. $(objpfx)tst-cet-legacy-mod-2.so
  358. $(objpfx)tst-cet-legacy-1a: $(objpfx)tst-cet-legacy-mod-1.so \
  359. $(objpfx)tst-cet-legacy-mod-2.so
  360. $(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so
  361. $(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
  362. $(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so
  363. $(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
  364. $(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
  365. $(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
  366. $(objpfx)tst-cet-legacy-mod-5b.so
  367. $(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
  368. $(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
  369. $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
  370. $(objpfx)tst-cet-legacy-mod-6b.so
  371. $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
  372. $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
  373. LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
  374. $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
  375. tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
  376. $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
  377. tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
  378. $(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
  379. tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
  380. $(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
  381. $(objpfx)tst-cet-legacy-mod-5b.so
  382. tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
  383. $(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
  384. $(objpfx)tst-cet-legacy-mod-6b.so
  385. tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
  386. tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
  387. tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
  388. tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  389. tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  390. $(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
  391. $(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
  392. tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  393. tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  394. $(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
  395. $(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
  396. tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
  397. tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
  398. $(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
  399. $(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
  400. tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  401. tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  402. $(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
  403. $(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
  404. $(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
  405. $(objpfx)tst-shstk-legacy-1e-static: $(objpfx)tst-shstk-legacy-1-extra.o
  406. $(objpfx)tst-shstk-legacy-1e.out: \
  407. $(..)/sysdeps/x86_64/tst-shstk-legacy-1e.sh $(objpfx)tst-shstk-legacy-1e
  408. $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
  409. $(evaluate-test)
  410. $(objpfx)tst-shstk-legacy-1e-static.out: \
  411. $(..)/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh \
  412. $(objpfx)tst-shstk-legacy-1e-static
  413. $(SHELL) $< $(common-objpfx) 2> $@; \
  414. $(evaluate-test)
  415. tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
  416. $(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
  417. $(objpfx)tst-shstk-legacy-mod-1.so: \
  418. $(objpfx)tst-shstk-legacy-mod-1.os \
  419. $(objpfx)tst-shstk-legacy-1-extra.os
  420. $(objpfx)tst-shstk-legacy-1g: $(objpfx)tst-shstk-legacy-mod-1.so
  421. $(objpfx)tst-shstk-legacy-1g.out: \
  422. $(..)/sysdeps/x86_64/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
  423. $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
  424. $(evaluate-test)
  425. ifeq (yes,$(build-shared))
  426. tests-special += $(objpfx)check-cet.out
  427. endif
  428. # FIXME: Can't use all-built-dso in elf/Makefile since this file is
  429. # processed before elf/Makefile. Duplicate it here.
  430. cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
  431. $(filter-out $(common-objpfx)linkobj/libc.so, \
  432. $(sort $(wildcard $(addprefix $(common-objpfx), \
  433. */lib*.so \
  434. iconvdata/*.so))))
  435. $(cet-built-dso:=.note): %.note: %
  436. @rm -f $@T
  437. LC_ALL=C $(READELF) -n $< > $@T
  438. test -s $@T
  439. mv -f $@T $@
  440. common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
  441. $(objpfx)check-cet.out: $(..)sysdeps/x86_64/check-cet.awk \
  442. $(cet-built-dso:=.note)
  443. LC_ALL=C $(AWK) -f $^ > $@; \
  444. $(evaluate-test)
  445. generated += check-cet.out
  446. endif # $(subdir) == elf
  447. endif # $(enable) != no
  448. do-tests-clean common-mostlyclean: tst-x86_64-1-clean
  449. .PHONY: tst-x86_64-1-clean
  450. tst-x86_64-1-clean:
  451. -rm -rf $(objpfx)x86_64
  452. $(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
  453. $(make-target-directory)
  454. rm -f $@
  455. ln $< $@