]>
Commit | Line | Data |
---|---|---|
6d7e8eda | 1 | # Copyright (C) 1995-2023 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 | ||
5d28a896 | 22 | headers := bits/dlfcn.h bits/dl_find_object.h dlfcn.h |
94e365c6 | 23 | extra-libs := libdl |
6f1c7010 FW |
24 | libdl-routines := libdl-compat |
25 | routines = \ | |
602252b5 | 26 | dladdr \ |
492560a3 | 27 | dladdr1 \ |
d8cce17d | 28 | dlclose \ |
a23c28ec | 29 | dlerror \ |
6dfc0207 | 30 | dlinfo \ |
6a1ed327 | 31 | dlmopen \ |
0c1c3a77 | 32 | dlopen \ |
77f876c0 | 33 | dlsym \ |
add8d7ea | 34 | dlvsym \ |
a23c28ec | 35 | libc_dlerror_result \ |
94e365c6 UD |
36 | |
37 | extra-libs-others := libdl | |
38 | ||
6f1c7010 FW |
39 | libdl-shared-only-routines += libdl-compat |
40 | ||
41 | # Pretend that libdl.so is a linker script, so that the symbolic | |
42 | # link is not installed. | |
43 | install-lib-ldscripts = libdl.so | |
44 | $(inst_libdir)/libdl.so: | |
45 | ||
3f2e46a4 | 46 | ifeq ($(build-shared),yes) |
0c1c3a77 | 47 | routines += dlopenold |
6f1c7010 | 48 | shared-only-routines := dlopenold |
94e365c6 UD |
49 | endif |
50 | ||
4380ef5e | 51 | ifeq (yes,$(build-shared)) |
c3fd12a2 | 52 | tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ |
6de1f625 | 53 | bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ |
44a6213c | 54 | bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen |
4380ef5e | 55 | endif |
1c298d08 UD |
56 | modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \ |
57 | defaultmod2 errmsg1mod modatexit modcxaatexit \ | |
7237d704 | 58 | bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \ |
e4693aa7 | 59 | bug-atexit2-lib bug-dl-leaf-lib \ |
ccdb048d | 60 | bug-dl-leaf-lib-cb moddummy1 moddummy2 |
be1152ca | 61 | |
1a379ea0 UD |
62 | failtestmod.so-no-z-defs = yes |
63 | glreflib2.so-no-z-defs = yes | |
64 | errmsg1mod.so-no-z-defs = yes | |
65 | ||
2119dcfa | 66 | ifeq (yes,$(build-shared)) |
3d0f5d0c MR |
67 | tests += tststatic tststatic2 tststatic3 tststatic4 tststatic5 |
68 | tests-static += tststatic tststatic2 tststatic3 tststatic4 tststatic5 | |
69 | modules-names += modstatic modstatic2 modstatic3 modstatic5 | |
3dbbd2ff | 70 | tststatic-ENV = LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf |
f3bc5e5a | 71 | tststatic2-ENV = $(tststatic-ENV) |
f91f1c0f MR |
72 | tststatic3-ENV = $(tststatic-ENV) |
73 | tststatic4-ENV = $(tststatic-ENV) | |
3d0f5d0c | 74 | tststatic5-ENV = $(tststatic-ENV) |
e4693aa7 | 75 | |
d056c212 FW |
76 | tests-internal += \ |
77 | tst-dlinfo-phdr \ | |
78 | # tests-internal | |
79 | ||
e4693aa7 | 80 | ifneq (,$(CXX)) |
e4693aa7 | 81 | modules-names += bug-atexit3-lib |
44a6213c RM |
82 | else |
83 | tests-unsupported += bug-atexit3 | |
e4693aa7 | 84 | endif |
be1152ca UD |
85 | endif |
86 | ||
376e973a | 87 | extra-test-objs += $(modules-names:=.os) |
f08e9a26 | 88 | generated += $(modules-names:=.so) |
4380ef5e | 89 | |
94e365c6 | 90 | include ../Rules |
4380ef5e UD |
91 | |
92 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) | |
4380ef5e | 93 | |
5181d776 RM |
94 | ifeq ($(build-shared),yes) |
95 | # Build all the modules even when not actually running test programs. | |
96 | tests: $(test-modules) | |
97 | endif | |
98 | ||
4380ef5e UD |
99 | $(objpfx)glrefmain.out: $(objpfx)glrefmain \ |
100 | $(objpfx)glreflib1.so $(objpfx)glreflib2.so | |
d743ba1e | 101 | |
d743ba1e | 102 | $(objpfx)failtest.out: $(objpfx)failtestmod.so |
00213fe4 | 103 | |
00213fe4 | 104 | $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so |
3fe40015 | 105 | |
1c298d08 UD |
106 | $(objpfx)tst-dlinfo.out: $(objpfx)glreflib3.so |
107 | LDFLAGS-glreflib3.so = -Wl,-rpath,: | |
45e4762c | 108 | |
ad10cac8 | 109 | LDFLAGS-default = $(LDFLAGS-rdynamic) |
6f1c7010 | 110 | $(objpfx)default: $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so |
ad10cac8 | 111 | LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic) |
f116c77f | 112 | |
f116c77f | 113 | $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so |
c08bc50a | 114 | |
c08bc50a UD |
115 | $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so |
116 | ||
c08bc50a UD |
117 | $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so |
118 | ||
be1152ca UD |
119 | $(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so |
120 | ||
5f21997b UD |
121 | $(objpfx)tststatic2.out: $(objpfx)tststatic2 $(objpfx)modstatic.so \ |
122 | $(objpfx)modstatic2.so | |
123 | ||
f91f1c0f MR |
124 | $(objpfx)tststatic3.out: $(objpfx)tststatic3 $(objpfx)modstatic3.so |
125 | ||
f91f1c0f MR |
126 | $(objpfx)tststatic4.out: $(objpfx)tststatic4 $(objpfx)modstatic3.so |
127 | ||
3d0f5d0c MR |
128 | $(objpfx)tststatic5.out: $(objpfx)tststatic5 $(objpfx)modstatic5.so |
129 | ||
6f1c7010 | 130 | $(objpfx)bug-dlsym1: $(objpfx)bug-dlsym1-lib2.so |
c3fd12a2 RM |
131 | $(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \ |
132 | $(objpfx)bug-dlsym1-lib2.so | |
765ade4b | 133 | $(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so |
c3fd12a2 | 134 | |
7237d704 | 135 | $(objpfx)bug-atexit1.out: $(objpfx)bug-atexit1-lib.so |
7237d704 | 136 | |
7237d704 | 137 | $(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so |
c3fd12a2 | 138 | |
44a6213c | 139 | ifneq (,$(CXX)) |
fab7ce3f | 140 | LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh |
c23de0aa | 141 | $(objpfx)bug-atexit3-lib.so: $(libsupport) |
6de1f625 | 142 | $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so |
44a6213c | 143 | endif |
3b813b29 MF |
144 | |
145 | $(objpfx)bug-dl-leaf: $(objpfx)bug-dl-leaf-lib.so | |
146 | $(objpfx)bug-dl-leaf.out: $(objpfx)bug-dl-leaf-lib-cb.so | |
3b813b29 | 147 | $(objpfx)bug-dl-leaf-lib-cb.so: $(objpfx)bug-dl-leaf-lib.so |
ccdb048d | 148 | |
ccdb048d | 149 | $(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so |