| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
subdir := dlfcn |
| 19 |
|
| 20 |
include ../Makeconfig |
| 21 |
|
| 22 |
headers := \ |
| 23 |
bits/dl_find_object.h \ |
| 24 |
bits/dlfcn.h \ |
| 25 |
dlfcn.h \ |
| 26 |
# headers |
| 27 |
extra-libs := libdl |
| 28 |
libdl-routines := libdl-compat |
| 29 |
routines = \ |
| 30 |
dladdr \ |
| 31 |
dladdr1 \ |
| 32 |
dlclose \ |
| 33 |
dlerror \ |
| 34 |
dlinfo \ |
| 35 |
dlmopen \ |
| 36 |
dlopen \ |
| 37 |
dlsym \ |
| 38 |
dlvsym \ |
| 39 |
libc_dlerror_result \ |
| 40 |
# routines |
| 41 |
|
| 42 |
extra-libs-others := libdl |
| 43 |
|
| 44 |
libdl-shared-only-routines += libdl-compat |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
install-lib-ldscripts = libdl.so |
| 49 |
$(inst_libdir)/libdl.so: |
| 50 |
|
| 51 |
ifeq ($(build-shared),yes) |
| 52 |
routines += dlopenold |
| 53 |
shared-only-routines := dlopenold |
| 54 |
endif |
| 55 |
|
| 56 |
ifeq (yes,$(build-shared)) |
| 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 |
| 74 |
endif |
| 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 |
| 94 |
|
| 95 |
failtestmod.so-no-z-defs = yes |
| 96 |
glreflib2.so-no-z-defs = yes |
| 97 |
errmsg1mod.so-no-z-defs = yes |
| 98 |
|
| 99 |
ifeq (yes,$(build-shared)) |
| 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 |
| 120 |
tststatic-ENV = LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf |
| 121 |
tststatic2-ENV = $(tststatic-ENV) |
| 122 |
tststatic3-ENV = $(tststatic-ENV) |
| 123 |
tststatic4-ENV = $(tststatic-ENV) |
| 124 |
tststatic5-ENV = $(tststatic-ENV) |
| 125 |
|
| 126 |
tests-internal += \ |
| 127 |
tst-dlinfo-phdr \ |
| 128 |
# tests-internal |
| 129 |
|
| 130 |
ifneq (,$(CXX)) |
| 131 |
modules-names += bug-atexit3-lib |
| 132 |
else |
| 133 |
tests-unsupported += bug-atexit3 |
| 134 |
endif |
| 135 |
endif |
| 136 |
|
| 137 |
extra-test-objs += $(modules-names:=.os) |
| 138 |
generated += $(modules-names:=.so) |
| 139 |
|
| 140 |
include ../Rules |
| 141 |
|
| 142 |
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) |
| 143 |
|
| 144 |
ifeq ($(build-shared),yes) |
| 145 |
|
| 146 |
tests: $(test-modules) |
| 147 |
endif |
| 148 |
|
| 149 |
$(objpfx)glrefmain.out: $(objpfx)glrefmain \ |
| 150 |
$(objpfx)glreflib1.so $(objpfx)glreflib2.so |
| 151 |
|
| 152 |
$(objpfx)failtest.out: $(objpfx)failtestmod.so |
| 153 |
|
| 154 |
$(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so |
| 155 |
|
| 156 |
$(objpfx)tst-dlinfo.out: $(objpfx)glreflib3.so |
| 157 |
LDFLAGS-glreflib3.so = -Wl,-rpath,: |
| 158 |
|
| 159 |
LDFLAGS-default = $(LDFLAGS-rdynamic) |
| 160 |
$(objpfx)default: $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so |
| 161 |
LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic) |
| 162 |
|
| 163 |
$(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so |
| 164 |
|
| 165 |
$(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so |
| 166 |
|
| 167 |
$(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so |
| 168 |
|
| 169 |
$(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so |
| 170 |
|
| 171 |
$(objpfx)tststatic2.out: $(objpfx)tststatic2 $(objpfx)modstatic.so \ |
| 172 |
$(objpfx)modstatic2.so |
| 173 |
|
| 174 |
$(objpfx)tststatic3.out: $(objpfx)tststatic3 $(objpfx)modstatic3.so |
| 175 |
|
| 176 |
$(objpfx)tststatic4.out: $(objpfx)tststatic4 $(objpfx)modstatic3.so |
| 177 |
|
| 178 |
$(objpfx)tststatic5.out: $(objpfx)tststatic5 $(objpfx)modstatic5.so |
| 179 |
|
| 180 |
$(objpfx)bug-dlsym1: $(objpfx)bug-dlsym1-lib2.so |
| 181 |
$(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \ |
| 182 |
$(objpfx)bug-dlsym1-lib2.so |
| 183 |
$(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so |
| 184 |
|
| 185 |
$(objpfx)bug-atexit1.out: $(objpfx)bug-atexit1-lib.so |
| 186 |
|
| 187 |
$(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so |
| 188 |
|
| 189 |
ifneq (,$(CXX)) |
| 190 |
LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh |
| 191 |
$(objpfx)bug-atexit3-lib.so: $(libsupport) |
| 192 |
$(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so |
| 193 |
endif |
| 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 |
| 197 |
$(objpfx)bug-dl-leaf-lib-cb.so: $(objpfx)bug-dl-leaf-lib.so |
| 198 |
|
| 199 |
$(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so |