• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// libdl
3//
4cc_library_static {
5    name: "libdl_static",
6
7    srcs: [
8        "libdl.cpp",
9        "libdl_cfi.cpp",
10    ],
11
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
29cc_library {
30    name: "libdl",
31    static_ndk_lib: true,
32
33    defaults: ["linux_bionic_supported"],
34
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"],
45
46    // for x86, exclude libgcc_eh.a for the same reasons as above
47    arch: {
48        arm: {
49            version_script: "libdl.arm.map",
50            ldflags: ["-Wl,--hash-style=both"],
51        },
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        },
61        x86: {
62            ldflags: [
63                "-Wl,--exclude-libs=libgcc_eh.a",
64                "-Wl,--hash-style=both",
65            ],
66            version_script: "libdl.x86.map",
67        },
68        x86_64: {
69            ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
70            version_script: "libdl.x86_64.map",
71        },
72    },
73    shared: {
74        whole_static_libs: ["libdl_static"],
75    },
76    static: {
77        srcs: ["libdl_static.c"],
78    },
79    cflags: [
80        "-Wall",
81        "-Wextra",
82        "-Wunused",
83        "-Werror",
84    ],
85    stl: "none",
86
87    nocrt: true,
88    system_shared_libs: [],
89
90    // This is placeholder library the actual implementation is (currently)
91    // provided by the linker.
92    shared_libs: ["ld-android"],
93
94    sanitize: {
95        never: true,
96    },
97}
98
99ndk_library {
100    name: "libdl",
101    symbol_file: "libdl.map.txt",
102    first_version: "9",
103}
104
105llndk_library {
106    name: "libdl",
107    symbol_file: "libdl.map.txt",
108}
109