OSDN Git Service

Merge remote-tracking branch 'goog/lmp-mr1-ub-dev' into manualmerge
[android-x86/bionic.git] / libdl / Android.mk
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
20 # for x86, exclude libgcc_eh.a for the same reasons as above
21 LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a
22 LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86)
23
24 LOCAL_SRC_FILES:= libdl.c
25 LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
26 LOCAL_CXX_STL := none
27
28 LOCAL_MODULE := libdl
29 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
30
31 # NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
32 # few symbols from libc. Using --no-undefined here results in having to link
33 # against libc creating a circular dependency which is removed and we end up
34 # with missing symbols. Since this library is just a bunch of stubs, we set
35 # LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
36 LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
37 LOCAL_SYSTEM_SHARED_LIBRARIES :=
38
39 include $(BUILD_SHARED_LIBRARY)
40
41 # A dummy libdl.a. Need for static executables using the LLVM unwinder. Most
42 # functions default to failure, others use a sensible default (dl_iterate_phdr()
43 # returns 0, as would happen if the user iterated over every phdr).
44 include $(CLEAR_VARS)
45 LOCAL_SRC_FILES:= libdl.c
46 LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
47 LOCAL_CXX_STL := none
48
49 LOCAL_MODULE := libdl
50 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
51 include $(BUILD_STATIC_LIBRARY)