From patchwork Fri Sep 3 08:55:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Avoid stack protection when building libgcc Date: Thu, 02 Sep 2010 22:55:04 -0000 From: Chung-Lin Tang X-Patchwork-Id: 63596 Message-Id: <4C80B7E8.5090600@codesourcery.com> To: gcc-patches Hi, this patch adds explicit avoiding of stack protection in libgcc build options. Many Linux distros enable -fstack-protector by default, building libgcc with it, and causing a link dependency on libssp that's sometimes inconvenient. For a scenario, please see here: http://lists.linaro.org/pipermail/linaro-toolchain/2010-August/000144.html Ok, for trunk? Thanks, Chung-Lin Index: Makefile.in =================================================================== --- Makefile.in (revision 163797) +++ Makefile.in (working copy) @@ -650,6 +650,7 @@ LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \ -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ + -fno-stack-protector \ $(INHIBIT_LIBC_CFLAGS) # Additional options to use when compiling libgcc2.a. @@ -663,6 +664,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ -finhibit-size-directive -fno-inline -fno-exceptions \ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ + -fno-stack-protector \ $(INHIBIT_LIBC_CFLAGS) # Additional sources to handle exceptions; overridden by targets as needed.