Skip to content

Commit

Permalink
sys-devel/gcc: Fix build of gcc-4.9.4 by gcc-6.4.0, bug 638056
Browse files Browse the repository at this point in the history
Solution found by Zorry

Closes: https://bugs.gentoo.org/638056
Package-Manager: Portage-2.3.14, Repoman-2.3.6
  • Loading branch information
akhuettel committed Nov 19, 2017
1 parent a60d22e commit 5075159
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
66 changes: 66 additions & 0 deletions sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From 41a4aa66eac45c8862a79351647ec06dd03bd1f5 Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Dec 2014 11:24:37 +0000
Subject: [PATCH] PR bootstrap/64023 * Makefile.tpl
(EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS to POSTSTAGE1_LDFLAGS and
STAGE1_LIBS to POSTSTAGE1_LIBS. Add -B to libstdc++-v3/src/.libs and
libstdc++-v3/libsupc++/.libs to CXX. * Makefile.in: Regenerated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218705 138bc75d-0d04-0410-961f-82ee72b054a4
---
ChangeLog | 9 +++++++++
Makefile.in | 6 +++++-
Makefile.tpl | 6 +++++-
3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index ba5ae4c2ecb..8ffc313f157 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -835,7 +835,9 @@ EXTRA_TARGET_FLAGS = \
'AS=$(COMPILER_AS_FOR_TARGET)' \
'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
+ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
@@ -853,6 +855,8 @@ EXTRA_TARGET_FLAGS = \
'WINDRES=$$(WINDRES_FOR_TARGET)' \
'WINDMC=$$(WINDMC_FOR_TARGET)' \
'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
+ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
+ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
"TFLAGS=$$TFLAGS"

TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index dcbc6b1b143..bb8227eaafa 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -641,7 +641,9 @@ EXTRA_TARGET_FLAGS = \
'AS=$(COMPILER_AS_FOR_TARGET)' \
'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
+ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
@@ -659,6 +661,8 @@ EXTRA_TARGET_FLAGS = \
'WINDRES=$$(WINDRES_FOR_TARGET)' \
'WINDMC=$$(WINDMC_FOR_TARGET)' \
'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
+ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
+ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
"TFLAGS=$$TFLAGS"

TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
--
2.15.0

5 changes: 4 additions & 1 deletion sys-devel/gcc/gcc-4.9.4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ src_prepare() {
EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
fi

# Bug 638056
epatch "${FILESDIR}/${P}-bootstrap.patch"

toolchain_src_prepare

use vanilla && return 0
#Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
# Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
}

0 comments on commit 5075159

Please sign in to comment.