The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
| 3 | # |
| 4 | # libdl |
| 5 | # |
| 6 | |
| 7 | include $(CLEAR_VARS) |
| 8 | |
| 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 | LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a |
| 19 | LOCAL_SRC_FILES:= libdl.c |
| 20 | |
| 21 | LOCAL_MODULE:= libdl |
| 22 | |
| 23 | # NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a |
| 24 | # few symbols from libc. Using --no-undefined here results in having to link |
| 25 | # against libc creating a circular dependency which is removed and we end up |
| 26 | # with missing symbols. Since this library is just a bunch of stubs, we set |
| 27 | # LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags. |
| 28 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
| 29 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 30 | |
| 31 | include $(BUILD_SHARED_LIBRARY) |
| 32 | |
| 33 | BUILD_DLTEST:=0 |
| 34 | ifeq ($(BUILD_DLTEST),1) |
| 35 | |
| 36 | # |
| 37 | # dltest |
| 38 | # |
| 39 | |
| 40 | include $(CLEAR_VARS) |
| 41 | |
| 42 | LOCAL_SRC_FILES:= dltest.c |
| 43 | |
| 44 | LOCAL_MODULE:= dltest |
| 45 | |
| 46 | LOCAL_SHARED_LIBRARIES := libdl |
| 47 | |
| 48 | include $(BUILD_EXECUTABLE) |
| 49 | |
| 50 | endif |