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 | |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 9 | # NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 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, |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 13 | # we use this property to make sure libc.so has its own copy of the code from |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 14 | # libgcc.a it uses. |
| 15 | # |
| 16 | # DO NOT REMOVE --exclude-libs! |
| 17 | |
| 18 | LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a |
The Android Open Source Project | 4e468ed | 2008-12-17 18:03:48 -0800 | [diff] [blame] | 19 | |
| 20 | # for x86, exclude libgcc_eh.a for the same reasons as above |
Ying Wang | 0695aa7 | 2014-01-23 15:15:28 -0800 | [diff] [blame] | 21 | LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a |
| 22 | LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86) |
The Android Open Source Project | 4e468ed | 2008-12-17 18:03:48 -0800 | [diff] [blame] | 23 | |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 24 | LOCAL_SRC_FILES:= libdl.c |
Elliott Hughes | 7ac9751 | 2014-01-14 17:25:13 -0800 | [diff] [blame] | 25 | LOCAL_CFLAGS := -Wall -Wextra -Werror |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 26 | |
Elliott Hughes | 7ac9751 | 2014-01-14 17:25:13 -0800 | [diff] [blame] | 27 | LOCAL_MODULE := libdl |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 28 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 29 | |
| 30 | # NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a |
| 31 | # few symbols from libc. Using --no-undefined here results in having to link |
| 32 | # against libc creating a circular dependency which is removed and we end up |
| 33 | # with missing symbols. Since this library is just a bunch of stubs, we set |
| 34 | # LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags. |
| 35 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 36 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 37 | |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 38 | include $(BUILD_SHARED_LIBRARY) |