blob: d5fae0effd04df268b274e7a9cc58f48b008cc35 [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
Elliott Hughesd50a1de2018-02-05 17:30:57 -08007 srcs: [
8 "libdl.cpp",
9 "libdl_cfi.cpp",
10 ],
dimitryc5ea3eb2017-10-05 17:23:10 +020011
12 cflags: [
13 "-Wall",
14 "-Wextra",
15 "-Wunused",
16 "-Werror",
17 ],
18
19 // For private/CFIShadow.h.
20 include_dirs: ["bionic/libc"],
21
22 stl: "none",
23
24 sanitize: {
25 never: true,
26 },
27}
28
Dan Willemsen208ae172015-09-16 16:33:27 -070029cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080030 name: "libdl",
Dan Albert40f15ec2017-10-27 11:21:20 -070031 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080032
33 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070034
35 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
36 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
37 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
38 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
39 // we use this property to make sure libc.so has its own copy of the code from
40 // libgcc.a it uses.
41 //
42 // DO NOT REMOVE --exclude-libs!
43
44 ldflags: ["-Wl,--exclude-libs=libgcc.a"],
Dan Willemsen208ae172015-09-16 16:33:27 -070045
46 // for x86, exclude libgcc_eh.a for the same reasons as above
47 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080048 arm: {
49 version_script: "libdl.arm.map",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080050 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080051 },
52 arm64: {
53 version_script: "libdl.arm64.map",
54 },
55 mips: {
56 version_script: "libdl.mips.map",
57 },
58 mips64: {
59 version_script: "libdl.mips64.map",
60 },
Dan Willemsen208ae172015-09-16 16:33:27 -070061 x86: {
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080062 ldflags: [
63 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080064 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080065 ],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080066 version_script: "libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070067 },
68 x86_64: {
69 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080070 version_script: "libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070071 },
72 },
dimitrydc7cc622017-08-30 10:52:19 +020073 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020074 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020075 },
76 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070077 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020078 },
Dan Willemsen208ae172015-09-16 16:33:27 -070079 cflags: [
80 "-Wall",
81 "-Wextra",
82 "-Wunused",
83 "-Werror",
84 ],
85 stl: "none",
86
Dan Willemsen208ae172015-09-16 16:33:27 -070087 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
88 // few symbols from libc. Using --no-undefined here results in having to link
89 // against libc creating a circular dependency which is removed and we end up
90 // with missing symbols. Since this library is just a bunch of stubs, we set
91 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
92 allow_undefined_symbols: true,
93 system_shared_libs: [],
94
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080095 // This is placeholder library the actual implementation is (currently)
96 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -080097 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080098
99 sanitize: {
100 never: true,
101 },
102}
103
Dan Alberte8a91082016-08-04 13:45:44 -0700104ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700105 name: "libdl",
Dan Alberte8a91082016-08-04 13:45:44 -0700106 symbol_file: "libdl.map.txt",
107 first_version: "9",
108}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700109
110llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700111 name: "libdl",
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700112 symbol_file: "libdl.map.txt",
113}