blob: 9a9c75606e427c3aa0a7543fc4db88aef4eb2afb [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
Elliott Hughesae5c6442012-08-13 14:06:05 -07009# NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070010# 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 Hughesae5c6442012-08-13 14:06:05 -070013# we use this property to make sure libc.so has its own copy of the code from
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070014# libgcc.a it uses.
15#
16# DO NOT REMOVE --exclude-libs!
17
Dmitriy Ivanovbc750472015-10-30 17:43:27 -070018LOCAL_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
Ying Wang1682c632014-01-23 15:15:28 -080021LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a
22LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080023
Dmitriy Ivanovbc750472015-10-30 17:43:27 -070024LOCAL_LDFLAGS_arm += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm.map
25LOCAL_LDFLAGS_arm64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm64.map
26LOCAL_LDFLAGS_mips += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips.map
27LOCAL_LDFLAGS_mips64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips64.map
28LOCAL_LDFLAGS_x86 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86.map
29LOCAL_LDFLAGS_x86_64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86_64.map
30
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070031LOCAL_SRC_FILES:= libdl.c
Elliott Hughesd2867962014-06-03 15:22:34 -070032LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
Dan Albert3ec67de2014-09-16 10:10:25 -070033LOCAL_CXX_STL := none
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070034
Elliott Hughes7ac97512014-01-14 17:25:13 -080035LOCAL_MODULE := libdl
Elliott Hughesae5c6442012-08-13 14:06:05 -070036LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070037
38# NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a
39# few symbols from libc. Using --no-undefined here results in having to link
40# against libc creating a circular dependency which is removed and we end up
41# with missing symbols. Since this library is just a bunch of stubs, we set
42# LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags.
43LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
Elliott Hughesae5c6442012-08-13 14:06:05 -070044LOCAL_SYSTEM_SHARED_LIBRARIES :=
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070045
Dan Albert11ea08c2015-06-16 13:57:54 -070046LOCAL_SANITIZE := never
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070047include $(BUILD_SHARED_LIBRARY)
Dan Alberta4ed64d2014-09-26 15:23:07 -070048
49# A dummy libdl.a. Need for static executables using the LLVM unwinder. Most
50# functions default to failure, others use a sensible default (dl_iterate_phdr()
51# returns 0, as would happen if the user iterated over every phdr).
52include $(CLEAR_VARS)
53LOCAL_SRC_FILES:= libdl.c
54LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
55LOCAL_CXX_STL := none
56
57LOCAL_MODULE := libdl
58LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert11ea08c2015-06-16 13:57:54 -070059LOCAL_SANITIZE := never
Dan Alberta4ed64d2014-09-26 15:23:07 -070060include $(BUILD_STATIC_LIBRARY)