diff options
Diffstat (limited to 'gcc/Makefile.in')
-rw-r--r-- | gcc/Makefile.in | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b47733cef50..bf07f83f4cb 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -237,6 +237,12 @@ LINKER = $(CC) LINKER_FLAGS = $(CFLAGS) endif +# We don't want to compile the compiler with -fPIE, it make PCH fail. +COMPILER += @NO_PIE_CFLAGS@ + +# Link with -no-pie since we compile the compiler with -fno-PIE. +LINKER += @NO_PIE_FLAG@ + # Like LINKER, but use a mutex for serializing front end links. ifeq (@DO_LINK_MUTEX@,true) LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER) @@ -750,6 +756,8 @@ CC_FOR_BUILD = @CC_FOR_BUILD@ CXX_FOR_BUILD = @CXX_FOR_BUILD@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE +BUILD_CFLAGS += @NO_PIE_CFLAGS@ +BUILD_CXXFLAGS += @NO_PIE_CFLAGS@ # Native compiler that we use. This may be C++ some day. COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) @@ -761,6 +769,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) # Native linker and preprocessor flags. For x-fragment overrides. BUILD_LDFLAGS=@BUILD_LDFLAGS@ +BUILD_LDFLAGS += @NO_PIE_FLAG@ BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) @@ -1819,6 +1828,12 @@ libgcc.mvars: config.status Makefile specs xgcc$(exeext) echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars + if test @enable_default_pie@ = yes; then \ + NO_PIE_CFLAGS="-fno-PIE"; \ + else \ + NO_PIE_CFLAGS=; \ + fi; \ + echo NO_PIE_CFLAGS = "$$NO_PIE_CFLAGS" >> tmp-libgcc.mvars mv tmp-libgcc.mvars libgcc.mvars |