diff options
author | Nick Kralevich <nnk@google.com> | 2012-07-10 10:46:19 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2012-07-10 10:51:41 -0700 |
commit | 6334c662cae4cd9b61f5f3185048b0cd3633dad7 (patch) | |
tree | 6214371613d1a579ac61f611af27402d906c7218 /libc/Android.mk | |
parent | 8f08e1c902c726ac5230776c238e5edb6f51f440 (diff) | |
download | bionic-6334c662cae4cd9b61f5f3185048b0cd3633dad7.zip bionic-6334c662cae4cd9b61f5f3185048b0cd3633dad7.tar.gz bionic-6334c662cae4cd9b61f5f3185048b0cd3633dad7.tar.bz2 |
Don't use -fstack-protector on ssp.c
libc's stack protector initialization routine (__guard_setup)
is in bionic/ssp.c. This code deliberately modifies the stack
canary. This code should never be compiled with -fstack-protector-all
otherwise it will crash (mismatched canary value).
Force bionic/ssp.c to be compiled with -fno-stack-protector
Change-Id: Ib95a5736e4bafe1a460d6b4e522ca660b417d8d6
Diffstat (limited to 'libc/Android.mk')
-rw-r--r-- | libc/Android.mk | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index 6b1bba4..0c4fa6a 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -292,7 +292,6 @@ libc_common_src_files := \ bionic/sched_cpucount.c \ bionic/semaphore.c \ bionic/sha1.c \ - bionic/ssp.c \ bionic/stubs.c \ bionic/system_properties.c \ bionic/tdelete.c \ @@ -619,6 +618,25 @@ ALL_GENERATED_SOURCES += $(GEN) WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) # ======================================================== +# libbionic_ssp.a - stack protector code +# ======================================================== +# +# The stack protector code needs to be compiled +# with -fno-stack-protector, since it modifies the +# stack canary. + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := bionic/ssp.c +LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector +LOCAL_C_INCLUDES := $(libc_common_c_includes) +LOCAL_MODULE := libbionic_ssp +LOCAL_SYSTEM_SHARED_LIBRARIES := + +include $(BUILD_STATIC_LIBRARY) + + +# ======================================================== # libc_common.a # ======================================================== include $(CLEAR_VARS) @@ -630,6 +648,7 @@ LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND endif LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_common +LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) |