Support gethostbyname_r_ERANGE.
[android-sdk/platform-bionic.git] / linker / Android.mk
1 LOCAL_PATH := $(call my-dir)
3 include $(CLEAR_VARS)
5 LOCAL_SRC_FILES:= \
6     debugger.cpp \
7     dlfcn.cpp \
8     linker.cpp \
9     linker_allocator.cpp \
10     linker_environ.cpp \
11     linker_libc_support.c \
12     linker_phdr.cpp \
13     rt.cpp \
15 LOCAL_SRC_FILES_arm     := arch/arm/begin.S
16 LOCAL_SRC_FILES_arm64   := arch/arm64/begin.S
17 LOCAL_SRC_FILES_x86     := arch/x86/begin.c
18 LOCAL_SRC_FILES_x86_64  := arch/x86_64/begin.S
19 LOCAL_SRC_FILES_mips    := arch/mips/begin.S
20 LOCAL_SRC_FILES_mips64  := arch/mips64/begin.S
22 # GNU assembler aborted with clang's output for linker.cpp:
23 # Assertion failure in get_line_subseg at
24 #   /s/ndk-toolchain/src/build/../binutils/binutils-2.24/gas/dwarf2dbg.c line 271.
25 ifeq ($(TARGET_ARCH),mips)
26     LOCAL_CLANG_CFLAGS += -integrated-as
27 endif
29 LOCAL_LDFLAGS := \
30     -shared \
31     -Wl,-Bsymbolic \
32     -Wl,--exclude-libs,ALL \
34 LOCAL_CFLAGS += \
35     -fno-stack-protector \
36     -Wstrict-overflow=5 \
37     -fvisibility=hidden \
38     -Wall -Wextra -Wunused -Werror \
40 LOCAL_CONLYFLAGS += \
41     -std=gnu99 \
43 LOCAL_CPPFLAGS += \
44     -std=gnu++11 \
46 # We need to access Bionic private headers in the linker.
47 LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/
49 # we don't want crtbegin.o (because we have begin.o), so unset it
50 # just for this module
51 LOCAL_NO_CRT := true
52 # TODO: split out the asflags.
53 LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
55 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
57 LOCAL_STATIC_LIBRARIES := libc_nomalloc
59 LOCAL_FORCE_STATIC_EXECUTABLE := true
61 LOCAL_MODULE := linker
62 LOCAL_MODULE_STEM_32 := linker
63 LOCAL_MODULE_STEM_64 := linker64
64 LOCAL_MULTILIB := both
66 # Leave the symbols in the shared library so that stack unwinders can produce
67 # meaningful name resolution.
68 LOCAL_STRIP_MODULE := keep_symbols
70 # Insert an extra objcopy step to add prefix to symbols.
71 # Note we are using "=" instead of ":=" to defer the evaluation,
72 # because LOCAL_2ND_ARCH_VAR_PREFIX or linked_module isn't set properly yet at this point.
73 LOCAL_POST_LINK_CMD = $(hide) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) \
74   --prefix-symbols=__dl_ $(linked_module)
76 include $(BUILD_EXECUTABLE)
78 include $(call first-makefiles-under,$(LOCAL_PATH))