Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1 | // |
| 2 | // libdl |
| 3 | // |
| 4 | cc_library { |
| 5 | |
| 6 | // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from |
| 7 | // libgcc.a are made static to libdl.so. This in turn ensures that libraries that |
| 8 | // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so |
| 9 | // to provide those symbols, but will instead pull them from libgcc.a. Specifically, |
| 10 | // we use this property to make sure libc.so has its own copy of the code from |
| 11 | // libgcc.a it uses. |
| 12 | // |
| 13 | // DO NOT REMOVE --exclude-libs! |
| 14 | |
| 15 | ldflags: ["-Wl,--exclude-libs=libgcc.a"], |
| 16 | version_script: "libdl.map", |
| 17 | |
| 18 | // for x86, exclude libgcc_eh.a for the same reasons as above |
| 19 | arch: { |
| 20 | x86: { |
| 21 | ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"], |
| 22 | }, |
| 23 | x86_64: { |
| 24 | ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"], |
| 25 | }, |
| 26 | }, |
| 27 | srcs: ["libdl.c"], |
| 28 | cflags: [ |
| 29 | "-Wall", |
| 30 | "-Wextra", |
| 31 | "-Wunused", |
| 32 | "-Werror", |
| 33 | ], |
| 34 | stl: "none", |
| 35 | |
| 36 | name: "libdl", |
| 37 | |
| 38 | // NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a |
| 39 | // few symbols from libc. Using --no-undefined here results in having to link |
| 40 | // against libc creating a circular dependency which is removed and we end up |
| 41 | // with missing symbols. Since this library is just a bunch of stubs, we set |
| 42 | // LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags. |
| 43 | allow_undefined_symbols: true, |
| 44 | system_shared_libs: [], |
| 45 | |
| 46 | sanitize: ["never"], |
| 47 | } |