blob: 9f67ee80d4c28f8cb2f6992447fe12af6bf3d5fd [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001//
2// libdl
3//
4cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -08005 name: "libdl",
6
7 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -07008
9 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
10 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
11 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
12 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
13 // we use this property to make sure libc.so has its own copy of the code from
14 // libgcc.a it uses.
15 //
16 // DO NOT REMOVE --exclude-libs!
17
18 ldflags: ["-Wl,--exclude-libs=libgcc.a"],
Dan Willemsen208ae172015-09-16 16:33:27 -070019
20 // for x86, exclude libgcc_eh.a for the same reasons as above
21 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080022 arm: {
23 version_script: "libdl.arm.map",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080024 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080025 },
26 arm64: {
27 version_script: "libdl.arm64.map",
28 },
29 mips: {
30 version_script: "libdl.mips.map",
31 },
32 mips64: {
33 version_script: "libdl.mips64.map",
34 },
Dan Willemsen208ae172015-09-16 16:33:27 -070035 x86: {
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080036 ldflags: [
37 "-Wl,--exclude-libs=libgcc_eh.a",
38 "-Wl,--hash-style=both",
39 ],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080040 version_script: "libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070041 },
42 x86_64: {
43 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080044 version_script: "libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070045 },
46 },
dimitrydc7cc622017-08-30 10:52:19 +020047 shared: {
48 srcs: ["libdl.c", "libdl_cfi.cpp"],
49 },
50 static: {
51 srcs: [ "libdl_static.c" ],
52 },
Dan Willemsen208ae172015-09-16 16:33:27 -070053 cflags: [
54 "-Wall",
55 "-Wextra",
56 "-Wunused",
57 "-Werror",
58 ],
59 stl: "none",
60
Dan Willemsen208ae172015-09-16 16:33:27 -070061 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
62 // few symbols from libc. Using --no-undefined here results in having to link
63 // against libc creating a circular dependency which is removed and we end up
64 // with missing symbols. Since this library is just a bunch of stubs, we set
65 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
66 allow_undefined_symbols: true,
67 system_shared_libs: [],
68
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -070069 // For private/CFIShadow.h.
70 include_dirs: ["bionic/libc"],
71
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080072 // This is placeholder library the actual implementation is (currently)
73 // provided by the linker.
74 shared_libs: [ "ld-android" ],
75
76 sanitize: {
77 never: true,
78 },
79}
80
81cc_library {
82 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
83 // libgcc.a are made static to ld-android.so. This in turn ensures that libraries that
84 // a) pull symbols from libgcc.a and b) depend on ld-android.so will not rely on ld-android.so
85 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
86 // we use this property to make sure libc.so has its own copy of the code from
87 // libgcc.a it uses.
88 //
89 // DO NOT REMOVE --exclude-libs!
90
91 ldflags: ["-Wl,--exclude-libs=libgcc.a"],
92
93 // for x86, exclude libgcc_eh.a for the same reasons as above
94 arch: {
95 x86: {
96 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
97 },
98 x86_64: {
99 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
100 },
101 },
102 srcs: ["ld_android.c"],
103 cflags: [
104 "-Wall",
105 "-Wextra",
106 "-Wunused",
107 "-Werror",
108 ],
109 stl: "none",
110
111 name: "ld-android",
Dan Willemsen82295962017-03-15 14:23:50 -0700112 defaults: ["linux_bionic_supported"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800113
114 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
115 // few symbols from libc. Using --no-undefined here results in having to link
116 // against libc creating a circular dependency which is removed and we end up
117 // with missing symbols. Since this library is just a bunch of stubs, we set
118 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
119 allow_undefined_symbols: true,
120 system_shared_libs: [],
121
Colin Cross27c43c52016-04-07 13:27:24 -0700122 sanitize: {
123 never: true,
124 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700125}
Dan Alberte8a91082016-08-04 13:45:44 -0700126
127ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700128 name: "libdl",
Dan Alberte8a91082016-08-04 13:45:44 -0700129 symbol_file: "libdl.map.txt",
130 first_version: "9",
131}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700132
133llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700134 name: "libdl",
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700135 symbol_file: "libdl.map.txt",
136}