diff -r fda76d0c4b84 -r 7a73b8b4ac8a make/common/NativeCompilation.gmk --- a/make/common/NativeCompilation.gmk Thu Apr 12 02:54:38 2018 -0700 +++ b/make/common/NativeCompilation.gmk Mon Apr 16 00:48:00 2018 -0700 @@ -372,6 +372,10 @@ $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) endif + # Add sys root specific cflags last + $1_EXTRA_CFLAGS += $(SYSROOT_CFLAGS) + $1_EXTRA_CXXFLAGS += $(SYSROOT_CFLAGS) + # Now call add_native_source for each source file we are going to compile. $$(foreach p,$$($1_SRCS), \ $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \ @@ -417,6 +421,8 @@ $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) endif + $1_EXTRA_LDFLAGS += $(SYSROOT_LDFLAGS) + $1 := $$($1_TARGET) ifneq (,$$($1_LIBRARY)) # Generating a dynamic library.