blob: 3889bdb2daa604229a627202ff1a6c897315aed1 [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001//
2// libdl
3//
dimitryc5ea3eb2017-10-05 17:23:10 +02004cc_library_static {
5 name: "libdl_static",
6
Ian Pedowitzb6310c22018-01-18 16:26:19 -08007 srcs: ["libdl.cpp", "libdl_cfi.cpp"],
dimitryc5ea3eb2017-10-05 17:23:10 +02008
9 cflags: [
10 "-Wall",
11 "-Wextra",
12 "-Wunused",
13 "-Werror",
14 ],
15
16 // For private/CFIShadow.h.
17 include_dirs: ["bionic/libc"],
18
19 stl: "none",
20
21 sanitize: {
22 never: true,
23 },
24}
25
Dan Willemsen208ae172015-09-16 16:33:27 -070026cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080027 name: "libdl",
28
29 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070030
31 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
32 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
33 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
34 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
35 // we use this property to make sure libc.so has its own copy of the code from
36 // libgcc.a it uses.
37 //
38 // DO NOT REMOVE --exclude-libs!
39
40 ldflags: ["-Wl,--exclude-libs=libgcc.a"],
Dan Willemsen208ae172015-09-16 16:33:27 -070041
42 // for x86, exclude libgcc_eh.a for the same reasons as above
43 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080044 arm: {
45 version_script: "libdl.arm.map",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080046 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080047 },
48 arm64: {
49 version_script: "libdl.arm64.map",
50 },
51 mips: {
52 version_script: "libdl.mips.map",
53 },
54 mips64: {
55 version_script: "libdl.mips64.map",
56 },
Dan Willemsen208ae172015-09-16 16:33:27 -070057 x86: {
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080058 ldflags: [
59 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080060 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080061 ],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080062 version_script: "libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070063 },
64 x86_64: {
65 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080066 version_script: "libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070067 },
68 },
dimitrydc7cc622017-08-30 10:52:19 +020069 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020070 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020071 },
72 static: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -080073 srcs: [ "libdl_static.c" ],
dimitrydc7cc622017-08-30 10:52:19 +020074 },
Dan Willemsen208ae172015-09-16 16:33:27 -070075 cflags: [
76 "-Wall",
77 "-Wextra",
78 "-Wunused",
79 "-Werror",
80 ],
81 stl: "none",
82
Dan Willemsen208ae172015-09-16 16:33:27 -070083 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
84 // few symbols from libc. Using --no-undefined here results in having to link
85 // against libc creating a circular dependency which is removed and we end up
86 // with missing symbols. Since this library is just a bunch of stubs, we set
87 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
88 allow_undefined_symbols: true,
89 system_shared_libs: [],
90
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080091 // This is placeholder library the actual implementation is (currently)
92 // provided by the linker.
Ian Pedowitzb6310c22018-01-18 16:26:19 -080093 shared_libs: [ "ld-android" ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080094
95 sanitize: {
96 never: true,
97 },
98}
99
Dan Alberte8a91082016-08-04 13:45:44 -0700100ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700101 name: "libdl",
Dan Alberte8a91082016-08-04 13:45:44 -0700102 symbol_file: "libdl.map.txt",
103 first_version: "9",
104}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700105
106llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700107 name: "libdl",
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700108 symbol_file: "libdl.map.txt",
109}