blob: e9b79d79c543e20b3b1a5736b2f3ce84c377aa85 [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",
24 },
25 arm64: {
26 version_script: "libdl.arm64.map",
27 },
28 mips: {
29 version_script: "libdl.mips.map",
30 },
31 mips64: {
32 version_script: "libdl.mips64.map",
33 },
Dan Willemsen208ae172015-09-16 16:33:27 -070034 x86: {
35 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080036 version_script: "libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070037 },
38 x86_64: {
39 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080040 version_script: "libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070041 },
42 },
43 srcs: ["libdl.c"],
44 cflags: [
45 "-Wall",
46 "-Wextra",
47 "-Wunused",
48 "-Werror",
49 ],
50 stl: "none",
51
Dan Willemsen208ae172015-09-16 16:33:27 -070052 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
53 // few symbols from libc. Using --no-undefined here results in having to link
54 // against libc creating a circular dependency which is removed and we end up
55 // with missing symbols. Since this library is just a bunch of stubs, we set
56 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
57 allow_undefined_symbols: true,
58 system_shared_libs: [],
59
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080060 // This is placeholder library the actual implementation is (currently)
61 // provided by the linker.
62 shared_libs: [ "ld-android" ],
63
64 sanitize: {
65 never: true,
66 },
67}
68
69cc_library {
70 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
71 // libgcc.a are made static to ld-android.so. This in turn ensures that libraries that
72 // a) pull symbols from libgcc.a and b) depend on ld-android.so will not rely on ld-android.so
73 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
74 // we use this property to make sure libc.so has its own copy of the code from
75 // libgcc.a it uses.
76 //
77 // DO NOT REMOVE --exclude-libs!
78
79 ldflags: ["-Wl,--exclude-libs=libgcc.a"],
80
81 // for x86, exclude libgcc_eh.a for the same reasons as above
82 arch: {
83 x86: {
84 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
85 },
86 x86_64: {
87 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
88 },
89 },
90 srcs: ["ld_android.c"],
91 cflags: [
92 "-Wall",
93 "-Wextra",
94 "-Wunused",
95 "-Werror",
96 ],
97 stl: "none",
98
99 name: "ld-android",
100
101 // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
102 // few symbols from libc. Using --no-undefined here results in having to link
103 // against libc creating a circular dependency which is removed and we end up
104 // with missing symbols. Since this library is just a bunch of stubs, we set
105 // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
106 allow_undefined_symbols: true,
107 system_shared_libs: [],
108
Colin Cross27c43c52016-04-07 13:27:24 -0700109 sanitize: {
110 never: true,
111 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700112}
Dan Alberte8a91082016-08-04 13:45:44 -0700113
114ndk_library {
115 name: "libdl.ndk",
116 symbol_file: "libdl.map.txt",
117 first_version: "9",
118}