aboutsummaryrefslogtreecommitdiff
path: root/libdl
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-09-16 16:33:27 -0700
committerDan Willemsen <dwillemsen@google.com>2015-09-16 16:50:01 -0700
commit208ae17e5f05ce26f2fa830c6d60c055d1d3f86a (patch)
tree95857ecee983b8e7741f96c229b5762db0fd4f68 /libdl
parent14545d4ce3dd446f20a14dcff37d60ff8d756f7a (diff)
downloadbionic-208ae17e5f05ce26f2fa830c6d60c055d1d3f86a.tar.gz
Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
Diffstat (limited to 'libdl')
-rw-r--r--libdl/Android.bp47
1 files changed, 47 insertions, 0 deletions
diff --git a/libdl/Android.bp b/libdl/Android.bp
new file mode 100644
index 000000000..46dd0eb7e
--- /dev/null
+++ b/libdl/Android.bp
@@ -0,0 +1,47 @@
+//
+// libdl
+//
+cc_library {
+
+ // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
+ // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
+ // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
+ // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
+ // we use this property to make sure libc.so has its own copy of the code from
+ // libgcc.a it uses.
+ //
+ // DO NOT REMOVE --exclude-libs!
+
+ ldflags: ["-Wl,--exclude-libs=libgcc.a"],
+ version_script: "libdl.map",
+
+ // for x86, exclude libgcc_eh.a for the same reasons as above
+ arch: {
+ x86: {
+ ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
+ },
+ x86_64: {
+ ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
+ },
+ },
+ srcs: ["libdl.c"],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Wunused",
+ "-Werror",
+ ],
+ stl: "none",
+
+ name: "libdl",
+
+ // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
+ // few symbols from libc. Using --no-undefined here results in having to link
+ // against libc creating a circular dependency which is removed and we end up
+ // with missing symbols. Since this library is just a bunch of stubs, we set
+ // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
+ allow_undefined_symbols: true,
+ system_shared_libs: [],
+
+ sanitize: ["never"],
+}