blob: fb01ec27fa47d44c20ade71b279e5bf8d399af71 [file] [log] [blame]
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -07001LOCAL_PATH:= $(call my-dir)
2
3#
4# libdl
5#
6
7include $(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
18LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080019
20# for x86, exclude libgcc_eh.a for the same reasons as above
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080021ifeq ($(TARGET_ARCH),x86)
22LOCAL_LDFLAGS += -Wl,--exclude-libs=libgcc_eh.a
23endif
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080024
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070025LOCAL_SRC_FILES:= libdl.c
26
27LOCAL_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.
34LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
35LOCAL_SYSTEM_SHARED_LIBRARIES :=
36
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070037include $(BUILD_SHARED_LIBRARY)
38
39BUILD_DLTEST:=0
40ifeq ($(BUILD_DLTEST),1)
41
42#
43# dltest
44#
45
46include $(CLEAR_VARS)
47
48LOCAL_SRC_FILES:= dltest.c
49
50LOCAL_MODULE:= dltest
51
52LOCAL_SHARED_LIBRARIES := libdl
53
54include $(BUILD_EXECUTABLE)
55
56endif