]>
Commit | Line | Data |
---|---|---|
dff8da6b | 1 | # Copyright (C) 1995-2024 Free Software Foundation, Inc. |
94e365c6 UD |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
94e365c6 UD |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
94e365c6 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
94e365c6 UD |
17 | |
18 | subdir := dlfcn | |
a5f891ac JM |
19 | |
20 | include ../Makeconfig | |
21 | ||
c432e667 CD |
22 | headers := \ |
23 | bits/dl_find_object.h \ | |
24 | bits/dlfcn.h \ | |
25 | dlfcn.h \ | |
26 | # headers | |
94e365c6 | 27 | extra-libs := libdl |
6f1c7010 FW |
28 | libdl-routines := libdl-compat |
29 | routines = \ | |
602252b5 | 30 | dladdr \ |
492560a3 | 31 | dladdr1 \ |
d8cce17d | 32 | dlclose \ |
a23c28ec | 33 | dlerror \ |
6dfc0207 | 34 | dlinfo \ |
6a1ed327 | 35 | dlmopen \ |
0c1c3a77 | 36 | dlopen \ |
77f876c0 | 37 | dlsym \ |
add8d7ea | 38 | dlvsym \ |
a23c28ec | 39 | libc_dlerror_result \ |
c432e667 | 40 | # routines |
94e365c6 UD |
41 | |
42 | extra-libs-others := libdl | |
43 | ||
6f1c7010 FW |
44 | libdl-shared-only-routines += libdl-compat |
45 | ||
46 | # Pretend that libdl.so is a linker script, so that the symbolic | |
47 | # link is not installed. | |
48 | install-lib-ldscripts = libdl.so | |
49 | $(inst_libdir)/libdl.so: | |
50 | ||
3f2e46a4 | 51 | ifeq ($(build-shared),yes) |
0c1c3a77 | 52 | routines += dlopenold |
6f1c7010 | 53 | shared-only-routines := dlopenold |
94e365c6 UD |
54 | endif |
55 | ||
4380ef5e | 56 | ifeq (yes,$(build-shared)) |
c432e667 CD |
57 | tests = \ |
58 | bug-atexit1 \ | |
59 | bug-atexit2 \ | |
60 | bug-atexit3 \ | |
61 | bug-dl-leaf \ | |
62 | bug-dlopen1 \ | |
63 | bug-dlsym1 \ | |
64 | default \ | |
65 | errmsg1 \ | |
66 | failtest \ | |
67 | glrefmain \ | |
68 | tst-dladdr \ | |
69 | tst-dlinfo \ | |
70 | tst-rec-dlopen \ | |
71 | tstatexit \ | |
72 | tstcxaatexit \ | |
73 | # tests | |
4380ef5e | 74 | endif |
c432e667 CD |
75 | modules-names = \ |
76 | bug-atexit1-lib \ | |
77 | bug-atexit2-lib \ | |
78 | bug-dl-leaf-lib \ | |
79 | bug-dl-leaf-lib-cb \ | |
80 | bug-dlsym1-lib1 \ | |
81 | bug-dlsym1-lib2 \ | |
82 | defaultmod1 \ | |
83 | defaultmod2 \ | |
84 | errmsg1mod \ | |
85 | failtestmod \ | |
86 | glreflib1 \ | |
87 | glreflib2 \ | |
88 | glreflib3 \ | |
89 | modatexit \ | |
90 | modcxaatexit \ | |
91 | moddummy1 \ | |
92 | moddummy2 \ | |
93 | # modules-names | |
be1152ca | 94 | |
1a379ea0 UD |
95 | failtestmod.so-no-z-defs = yes |
96 | glreflib2.so-no-z-defs = yes | |
97 | errmsg1mod.so-no-z-defs = yes | |
98 | ||
2119dcfa | 99 | ifeq (yes,$(build-shared)) |
c432e667 CD |
100 | tests += \ |
101 | tststatic \ | |
102 | tststatic2 \ | |
103 | tststatic3 \ | |
104 | tststatic4 \ | |
105 | tststatic5 \ | |
106 | # tests | |
107 | tests-static += \ | |
108 | tststatic \ | |
109 | tststatic2 \ | |
110 | tststatic3 \ | |
111 | tststatic4 \ | |
112 | tststatic5 \ | |
113 | # tests-static | |
114 | modules-names += \ | |
115 | modstatic \ | |
116 | modstatic2 \ | |
117 | modstatic3 \ | |
118 | modstatic5 \ | |
119 | # modules-names | |
3dbbd2ff | 120 | tststatic-ENV = LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf |
f3bc5e5a | 121 | tststatic2-ENV = $(tststatic-ENV) |
f91f1c0f MR |
122 | tststatic3-ENV = $(tststatic-ENV) |
123 | tststatic4-ENV = $(tststatic-ENV) | |
3d0f5d0c | 124 | tststatic5-ENV = $(tststatic-ENV) |
e4693aa7 | 125 | |
d056c212 FW |
126 | tests-internal += \ |
127 | tst-dlinfo-phdr \ | |
128 | # tests-internal | |
129 | ||
e4693aa7 | 130 | ifneq (,$(CXX)) |
e4693aa7 | 131 | modules-names += bug-atexit3-lib |
44a6213c RM |
132 | else |
133 | tests-unsupported += bug-atexit3 | |
e4693aa7 | 134 | endif |
be1152ca UD |
135 | endif |
136 | ||
376e973a | 137 | extra-test-objs += $(modules-names:=.os) |
f08e9a26 | 138 | generated += $(modules-names:=.so) |
4380ef5e | 139 | |
94e365c6 | 140 | include ../Rules |
4380ef5e UD |
141 | |
142 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) | |
4380ef5e | 143 | |
5181d776 RM |
144 | ifeq ($(build-shared),yes) |
145 | # Build all the modules even when not actually running test programs. | |
146 | tests: $(test-modules) | |
147 | endif | |
148 | ||
4380ef5e UD |
149 | $(objpfx)glrefmain.out: $(objpfx)glrefmain \ |
150 | $(objpfx)glreflib1.so $(objpfx)glreflib2.so | |
d743ba1e | 151 | |
d743ba1e | 152 | $(objpfx)failtest.out: $(objpfx)failtestmod.so |
00213fe4 | 153 | |
00213fe4 | 154 | $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so |
3fe40015 | 155 | |
1c298d08 UD |
156 | $(objpfx)tst-dlinfo.out: $(objpfx)glreflib3.so |
157 | LDFLAGS-glreflib3.so = -Wl,-rpath,: | |
45e4762c | 158 | |
ad10cac8 | 159 | LDFLAGS-default = $(LDFLAGS-rdynamic) |
6f1c7010 | 160 | $(objpfx)default: $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so |
ad10cac8 | 161 | LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic) |
f116c77f | 162 | |
f116c77f | 163 | $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so |
c08bc50a | 164 | |
c08bc50a UD |
165 | $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so |
166 | ||
c08bc50a UD |
167 | $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so |
168 | ||
be1152ca UD |
169 | $(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so |
170 | ||
5f21997b UD |
171 | $(objpfx)tststatic2.out: $(objpfx)tststatic2 $(objpfx)modstatic.so \ |
172 | $(objpfx)modstatic2.so | |
173 | ||
f91f1c0f MR |
174 | $(objpfx)tststatic3.out: $(objpfx)tststatic3 $(objpfx)modstatic3.so |
175 | ||
f91f1c0f MR |
176 | $(objpfx)tststatic4.out: $(objpfx)tststatic4 $(objpfx)modstatic3.so |
177 | ||
3d0f5d0c MR |
178 | $(objpfx)tststatic5.out: $(objpfx)tststatic5 $(objpfx)modstatic5.so |
179 | ||
6f1c7010 | 180 | $(objpfx)bug-dlsym1: $(objpfx)bug-dlsym1-lib2.so |
c3fd12a2 RM |
181 | $(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \ |
182 | $(objpfx)bug-dlsym1-lib2.so | |
765ade4b | 183 | $(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so |
c3fd12a2 | 184 | |
7237d704 | 185 | $(objpfx)bug-atexit1.out: $(objpfx)bug-atexit1-lib.so |
7237d704 | 186 | |
7237d704 | 187 | $(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so |
c3fd12a2 | 188 | |
44a6213c | 189 | ifneq (,$(CXX)) |
fab7ce3f | 190 | LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh |
c23de0aa | 191 | $(objpfx)bug-atexit3-lib.so: $(libsupport) |
6de1f625 | 192 | $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so |
44a6213c | 193 | endif |
3b813b29 MF |
194 | |
195 | $(objpfx)bug-dl-leaf: $(objpfx)bug-dl-leaf-lib.so | |
196 | $(objpfx)bug-dl-leaf.out: $(objpfx)bug-dl-leaf-lib-cb.so | |
3b813b29 | 197 | $(objpfx)bug-dl-leaf-lib-cb.so: $(objpfx)bug-dl-leaf-lib.so |
ccdb048d | 198 | |
ccdb048d | 199 | $(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so |