@@ -92,3 +92,50 @@ src_prepare() {
92
92
eapply " ${FILESDIR} " /${PN} -13-fix-cross-fixincludes.patch
93
93
eapply_user
94
94
}
95
+
96
+ src_configure () {
97
+ local myconf=()
98
+ case ${CTARGET} :" ${USE} " in
99
+ powerpc* -darwin* )
100
+ # bug #381179
101
+ filter-flags " -mcpu=*" " -mtune=*"
102
+ # bug #657522
103
+ # A bug in configure checks whether -no-pie works, but the
104
+ # compiler doesn't pass -no-pie onto the linker if -fno-PIE
105
+ # isn't passed, so the configure check always finds -no-pie
106
+ # is accepted. (Likewise, when -fno-PIE is passed, the
107
+ # compiler passes -no_pie onto the linker.)
108
+ # Since our linker doesn't grok this, avoid above checks to
109
+ # be run
110
+ # NOTE: later ld64 does grok -no_pie, not -no-pie (as checked)
111
+ export gcc_cv_c_no_fpie=no
112
+ export gcc_cv_no_pie=no
113
+ ;;
114
+ * -darwin20)
115
+ # use sysroot with the linker, #756160
116
+ export gcc_cv_ld_sysroot=yes
117
+ ;;
118
+ * -solaris* )
119
+ # todo: some magic for native vs. GNU linking?
120
+ myconf+=( --with-gnu-ld --with-gnu-as --enable-largefile )
121
+ ;;
122
+ i[34567]86-* -linux* :* " prefix " * )
123
+ # to allow the linux-x86-on-amd64.patch become useful, we need
124
+ # to enable multilib, even if there is just one multilib option.
125
+ myconf+=( --enable-multilib )
126
+ if [[ ${CBUILD:- ${CHOST} } == " ${CHOST} " ]]; then
127
+ # we might be on x86_64-linux, but don't do cross-compile, so
128
+ # tell the host-compiler to really create 32bits (for stage1)
129
+ # (real x86-linux-gcc also accept -m32).
130
+ append-flags -m32
131
+ fi
132
+ ;;
133
+ esac
134
+
135
+ # Since GCC 4.1.2 some non-posix (?) /bin/sh compatible code is used, at
136
+ # least on Solaris, and AIX /bin/sh is way too slow,
137
+ # so force it to use $BASH (that portage uses) - it can't be EPREFIX
138
+ # in case that doesn't exist yet
139
+ export CONFIG_SHELL=" ${CONFIG_SHELL:- ${BASH} } "
140
+ toolchain_src_configure " ${myconf[@]} "
141
+ }
0 commit comments