1 1.28 christos # $NetBSD: Makefile,v 1.28 2025/06/10 14:30:44 christos Exp $ 2 1.1 pooka # 3 1.1 pooka 4 1.3 skrll NOMAN= # defined 5 1.3 skrll 6 1.1 pooka .include <bsd.own.mk> 7 1.1 pooka 8 1.6 mrg .if ${MKPIC} != "no" 9 1.6 mrg 10 1.26 riastrad SUBDIR+= helper_dso1 11 1.26 riastrad SUBDIR+= helper_dso3 12 1.26 riastrad SUBDIR+= .WAIT 13 1.26 riastrad SUBDIR+= helper_dso2 14 1.26 riastrad SUBDIR+= .WAIT 15 1.26 riastrad SUBDIR+= helper_ifunc_dso 16 1.26 riastrad SUBDIR+= helper_symver_dso0 17 1.26 riastrad SUBDIR+= .WAIT 18 1.26 riastrad SUBDIR+= helper_symver_dso1 19 1.26 riastrad SUBDIR+= .WAIT 20 1.26 riastrad SUBDIR+= helper_symver_dso2 21 1.26 riastrad SUBDIR+= .WAIT 22 1.26 riastrad SUBDIR+= data 23 1.4 joerg 24 1.16 riastrad SUBDIR+= helper_def_dynamic 25 1.13 riastrad SUBDIR+= helper_def_static 26 1.18 riastrad SUBDIR+= helper_onlydef 27 1.14 riastrad SUBDIR+= .WAIT 28 1.17 riastrad SUBDIR+= helper_abuse_dynamic 29 1.17 riastrad SUBDIR+= helper_abuse_static 30 1.19 riastrad SUBDIR+= helper_onlyctor_dynamic 31 1.18 riastrad SUBDIR+= helper_onlyuse_dynamic 32 1.18 riastrad SUBDIR+= helper_onlyuse_static 33 1.16 riastrad SUBDIR+= helper_use_dynamic 34 1.13 riastrad SUBDIR+= helper_use_static 35 1.13 riastrad 36 1.1 pooka TESTSDIR= ${TESTSBASE}/libexec/ld.elf_so 37 1.1 pooka 38 1.26 riastrad TESTS_C+= t_dlerror-cleared 39 1.26 riastrad TESTS_C+= t_dlerror-false 40 1.26 riastrad TESTS_C+= t_dlinfo 41 1.26 riastrad TESTS_C+= t_dlvsym 42 1.26 riastrad TESTS_C+= t_hash 43 1.26 riastrad TESTS_C+= t_ifunc 44 1.22 riastrad TESTS_C+= t_ifunc_norelro 45 1.22 riastrad TESTS_C+= t_ifunc_norelro_now 46 1.26 riastrad TESTS_C+= t_ifunc_now 47 1.11 kamil TESTS_C+= t_rtld_r_debug 48 1.25 riastrad TESTS_C+= t_rtld_r_debug_nopie 49 1.13 riastrad TESTS_C+= t_tls_extern 50 1.21 riastrad 51 1.22 riastrad SRCS.t_ifunc_now= t_ifunc.c 52 1.22 riastrad SRCS.t_ifunc_norelro= t_ifunc.c 53 1.22 riastrad SRCS.t_ifunc_norelro_now= t_ifunc.c 54 1.22 riastrad 55 1.23 riastrad LDADD.t_ifunc+= ${${MKRELRO} != "no":?-Wl,-z,relro:} 56 1.23 riastrad LDADD.t_ifunc_now+= ${${MKRELRO} != "no":?-Wl,-z,relro:} -Wl,-z,now 57 1.24 riastrad LDADD.t_ifunc_norelro+= ${${MKRELRO} != "no":?-Wl,-z,norelro:} 58 1.24 riastrad LDADD.t_ifunc_norelro_now+= ${${MKRELRO} != "no":?-Wl,-z,norelro:} -Wl,-z,now 59 1.22 riastrad 60 1.25 riastrad SRCS.t_rtld_r_debug_nopie= t_rtld_r_debug.c 61 1.25 riastrad 62 1.25 riastrad # If the port doesn't support PIE anyway, well, no big deal, we have 63 1.25 riastrad # two copies of the same tiny test. 64 1.25 riastrad LDADD.t_rtld_r_debug_nopie+= -Wl,-no-pie 65 1.25 riastrad 66 1.21 riastrad .PATH: ${NETBSDSRCDIR}/libexec/ld.elf_so 67 1.21 riastrad SRCS.t_hash+= t_hash.c 68 1.21 riastrad SRCS.t_hash+= hash.c 69 1.21 riastrad CPPFLAGS.t_hash.c+= -I${NETBSDSRCDIR}/libexec/ld.elf_so 70 1.11 kamil 71 1.20 lukem COPTS.t_rtld_r_debug.c += ${CC_WNO_MAYBE_UNINITIALIZED} 72 1.2 skrll 73 1.2 skrll LDADD.t_dlerror-false= -Wl,-rpath,/var/nonexistent/lib 74 1.5 nonaka LDADD.t_dlvsym= -Wl,-rpath,${TESTSDIR}/h_helper_symver_dso2 75 1.22 riastrad .for t in t_ifunc t_ifunc_now t_ifunc_norelro t_ifunc_norelro_now 76 1.22 riastrad LDADD.${t}+= -Wl,-rpath,${TESTSDIR} -lutil 77 1.22 riastrad DPADD.${t}+= ${LIBUTIL} 78 1.22 riastrad .endfor 79 1.13 riastrad LDADD.t_tls_extern+= -Wl,-rpath,${TESTSDIR} 80 1.1 pooka 81 1.26 riastrad TESTS_SH+= t_df_1_noopen 82 1.26 riastrad TESTS_SH+= t_dl_symver 83 1.27 riastrad TESTS_SH+= t_r_rel 84 1.26 riastrad TESTS_SH+= t_thread_local_dtor 85 1.3 skrll 86 1.3 skrll BINDIR= ${TESTSDIR} 87 1.3 skrll PROGS+= h_df_1_noopen1 88 1.3 skrll SRCS.h_df_1_noopen1= h_df_1_noopen.c 89 1.3 skrll 90 1.3 skrll PROGS+= h_df_1_noopen2 91 1.3 skrll SRCS.h_df_1_noopen2= h_df_1_noopen.c 92 1.3 skrll LDADD.h_df_1_noopen2= -lpthread 93 1.3 skrll 94 1.9 joerg PROGS+= h_thread_local_dtor 95 1.9 joerg LDADD.h_thread_local_dtor= -Wl,-rpath,${TESTSDIR} -lpthread 96 1.9 joerg 97 1.8 joerg PROGS+= h_ifunc 98 1.8 joerg SRCS.h_ifunc= h_ifunc.c 99 1.8 joerg IFUNCDIR!= cd ${.CURDIR}/helper_ifunc_dso && ${PRINTOBJDIR} 100 1.8 joerg LDADD.h_ifunc= -Wl,-rpath,${TESTSDIR} -L${IFUNCDIR} -lh_helper_ifunc_dso 101 1.8 joerg 102 1.4 joerg PROGS+= h_locking 103 1.4 joerg SRCS.h_locking= h_locking.c 104 1.4 joerg LDADD.h_locking= -lpthread -Wl,--export-dynamic -Wl,-rpath,${TESTSDIR} 105 1.4 joerg 106 1.5 nonaka PROGS+= h_dl_symver_v0 107 1.5 nonaka SRCS.h_dl_symver_v0= h_dl_symver.c 108 1.5 nonaka V0ODIR!= cd ${.CURDIR}/helper_symver_dso0 && ${PRINTOBJDIR} 109 1.5 nonaka LDADD.h_dl_symver_v0= -L${V0ODIR} -lh_helper_symver_dso 110 1.5 nonaka 111 1.5 nonaka PROGS+= h_dl_symver_v1 112 1.5 nonaka SRCS.h_dl_symver_v1= h_dl_symver.c 113 1.5 nonaka V1ODIR!= cd ${.CURDIR}/helper_symver_dso1 && ${PRINTOBJDIR} 114 1.5 nonaka LDADD.h_dl_symver_v1= -L${V1ODIR} -lh_helper_symver_dso 115 1.5 nonaka 116 1.5 nonaka PROGS+= h_dl_symver_v2 117 1.5 nonaka SRCS.h_dl_symver_v2= h_dl_symver.c 118 1.5 nonaka V2ODIR!= cd ${.CURDIR}/helper_symver_dso2 && ${PRINTOBJDIR} 119 1.5 nonaka LDADD.h_dl_symver_v2= -L${V2ODIR} -lh_helper_symver_dso 120 1.5 nonaka 121 1.27 riastrad PROGS+= h_r_rel_pack 122 1.27 riastrad PROGS+= h_r_rel_nopack 123 1.27 riastrad 124 1.27 riastrad SRCS.h_r_rel_pack= h_r_rel.c 125 1.27 riastrad SRCS.h_r_rel_nopack= h_r_rel.c 126 1.27 riastrad 127 1.27 riastrad h_r_rel_pack: CTFMERGE=: # PR toolchain/59364: ctf tools needs update 128 1.28 christos LDFLAGS.h_r_rel_pack= ${LD_PACK_RELATIVE_RELOCS} 129 1.28 christos LDFLAGS.h_r_rel_nopack= ${LD_NOPACK_RELATIVE_RELOCS} 130 1.27 riastrad 131 1.7 mrg .include <bsd.test.mk> 132 1.7 mrg 133 1.7 mrg .else 134 1.7 mrg 135 1.7 mrg NOPROG= # defined 136 1.7 mrg .include <bsd.prog.mk> 137 1.7 mrg 138 1.6 mrg .endif 139