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 |
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 |
The Android Open Source Project | 4e468ed | 2008-12-17 18:03:48 -0800 | [diff] [blame] | 21 | ifeq ($(TARGET_ARCH),x86) |
| 22 | LOCAL_LDFLAGS += -Wl,--exclude-libs=libgcc_eh.a |
| 23 | endif |
The Android Open Source Project | 4e468ed | 2008-12-17 18:03:48 -0800 | [diff] [blame] | 24 | |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 25 | LOCAL_SRC_FILES:= libdl.c |
| 26 | |
| 27 | LOCAL_MODULE:= libdl |
| 28 | |
| 29 | # NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a |
| 30 | # few symbols from libc. Using --no-undefined here results in having to link |
| 31 | # against libc creating a circular dependency which is removed and we end up |
| 32 | # with missing symbols. Since this library is just a bunch of stubs, we set |
| 33 | # LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags. |
| 34 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
| 35 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 36 | |
Shin-ichiro KAWASAKI | efecfde | 2009-08-31 16:39:32 +0900 | [diff] [blame] | 37 | ifeq ($(TARGET_ARCH),sh) |
| 38 | # for SuperH, additional code is necessary to handle .ctors section. |
| 39 | GEN_SOBEGIN := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o |
| 40 | $(GEN_SOBEGIN): $(LOCAL_PATH)/arch-sh/sobegin.S |
| 41 | @mkdir -p $(dir $@) |
| 42 | $(TARGET_CC) -o $@ -c $< |
| 43 | |
| 44 | GEN_SOEND := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o |
| 45 | $(GEN_SOEND): $(LOCAL_PATH)/arch-sh/soend.S |
| 46 | @mkdir -p $(dir $@) |
| 47 | $(TARGET_CC) -o $@ -c $< |
| 48 | |
| 49 | LOCAL_ADDITIONAL_DEPENDENCIES := $(GEN_SOBEGIN) $(GEN_SOEND) |
| 50 | endif |
| 51 | |
The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 52 | include $(BUILD_SHARED_LIBRARY) |
| 53 | |
| 54 | BUILD_DLTEST:=0 |
| 55 | ifeq ($(BUILD_DLTEST),1) |
| 56 | |
| 57 | # |
| 58 | # dltest |
| 59 | # |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | |
| 63 | LOCAL_SRC_FILES:= dltest.c |
| 64 | |
| 65 | LOCAL_MODULE:= dltest |
| 66 | |
| 67 | LOCAL_SHARED_LIBRARIES := libdl |
| 68 | |
| 69 | include $(BUILD_EXECUTABLE) |
| 70 | |
| 71 | endif |