Skip to content

Commit a58e5f2

Browse files
committed
scripts/bootstrap-prefix: pull in libffi as part of the compiler
We need an updated linker to compile libffi on Darwin 9, so make libffi part of the compiler dependencies, such that we can build the linker first, and then finish libffi. Signed-off-by: Fabian Groffen <[email protected]>
1 parent 9d17a67 commit a58e5f2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/bootstrap-prefix.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ efetch() {
112112

113113
configure_cflags() {
114114
export CPPFLAGS="-I${ROOT}/tmp/usr/include"
115+
# keep it fairly reasonable (no -march or whatever)
116+
export OVERRIDE_CFLAGS="-O2 -pipe"
117+
export OVERRIDE_CXXFLAGS="-O2 -pipe"
115118

116119
case ${CHOST} in
117120
*-darwin*)
@@ -151,7 +154,7 @@ configure_cflags() {
151154

152155
configure_toolchain() {
153156
linker="sys-devel/binutils"
154-
local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc"
157+
local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc dev-libs/libffi"
155158
compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc"
156159
compiler_stage1="${gcc_deps} sys-devel/gcc-config"
157160
compiler_type="gcc"
@@ -190,7 +193,8 @@ configure_toolchain() {
190193
local cvers="${ccvers#*)}"; cvers="${cvers%%.*}"
191194
# GCC-5 has C11 see above
192195
if [[ ${cvers} -ge 5 ]] ; then
193-
: # ok!
196+
: # ok! stage1 bootstrapped one, get us a linker too
197+
linker="=sys-devel/binutils-apple-3.2.6*"
194198
else
195199
# FIXME: should probably stage1 bootstrap GCC-5
196200
# or something
@@ -1846,7 +1850,6 @@ bootstrap_stage2() {
18461850
app-arch/xz-utils
18471851
sys-apps/sed
18481852
sys-apps/baselayout
1849-
dev-libs/libffi
18501853
sys-devel/m4
18511854
sys-devel/flex
18521855
sys-apps/diffutils # needed by bison-3 build system
@@ -1904,7 +1907,7 @@ bootstrap_stage2() {
19041907
EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} ${disable_darwin_rpath}" \
19051908
MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \
19061909
GCC_MAKE_TARGET=all \
1907-
OVERRIDE_CXXFLAGS="${CPPFLAGS} -O2 -pipe" \
1910+
OVERRIDE_CXXFLAGS="${CPPFLAGS} ${OVERRIDE_CXXFLAGS}" \
19081911
TPREFIX="${ROOT}" \
19091912
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \
19101913
emerge_pkgs --nodeps ${pkg} || return 1

0 commit comments

Comments
 (0)