1LOCAL_PATH := $(call my-dir)
2
3include $(CLEAR_VARS)
4LOCAL_MODULE := static-executable
5LOCAL_SRC_FILES := main.cxx
6LOCAL_CFLAGS += -fexceptions
7
8# Note that by default ndk-build system doesn't support static executable,
9# but option "-static" can instruct gcc to link with proper crt*o files to
10# generate static executable.
11LOCAL_LDFLAGS += -static
12
13# Be aware that -Wl,--eh-frame-hdr is also needed for "-static" (at least for
14# x86 and mips which use eh frames) since crt files are now in C, and the trick
15# in the previous *S file to iterate all eh frames and record ranges is gone
16LOCAL_LDFLAGS += -Wl,--eh-frame-hdr
17
18include $(BUILD_EXECUTABLE)
19
20