summaryrefslogtreecommitdiff
path: root/profiles/prefix
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2016-05-22 16:17:02 +0900
committerBenda Xu <heroxbd@gentoo.org>2016-05-22 16:18:16 +0900
commit485d1720a3c24e2c25da188d6266c4b618e3104e (patch)
tree171c9373858b44451aef1aa43bf68db53cebdc7d /profiles/prefix
parentf7986ed8222ddbb5e9b107d5d358a132b4e0b48a (diff)
downloadgentoo-485d1720a3c24e2c25da188d6266c4b618e3104e.tar.gz
gentoo-485d1720a3c24e2c25da188d6266c4b618e3104e.tar.xz
p/p/linux-standalone/profile.bashrc: track RAP toolchain tricks.
Diffstat (limited to 'profiles/prefix')
-rw-r--r--profiles/prefix/linux-standalone/profile.bashrc29
1 files changed, 29 insertions, 0 deletions
diff --git a/profiles/prefix/linux-standalone/profile.bashrc b/profiles/prefix/linux-standalone/profile.bashrc
new file mode 100644
index 00000000000..1e4cfcb7b53
--- /dev/null
+++ b/profiles/prefix/linux-standalone/profile.bashrc
@@ -0,0 +1,29 @@
+# RAP specific patches that is pending upstream.
+# binutils: http://article.gmane.org/gmane.comp.gnu.binutils/67593
+
+if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == prepare ]]; then
+ cd "${S}"
+ einfo "Prefixifying glibc dynamic linker..."
+ for h in gcc/config/*/linux*.h; do
+ ebegin " Updating $h"
+ sed -i -r "s,(GLIBC_DYNAMIC_LINKER.*\")(/lib),\1${EPREFIX}\2," \
+ $h || eerror "Please file a bug about this"
+ eend $?
+ done
+
+ # use sysroot of toolchain to get currect include and library at compile time
+ EXTRA_ECONF="${EXTRA_ECONF} --with-sysroot=${EPREFIX}"
+
+ ebegin "remove --sysroot call on ld for native toolchain"
+ sed -i 's/--sysroot=%R//' \
+ gcc/gcc.c || eerror "Please file a bug about this"
+ eend $?
+fi
+
+if [[ ${CATEGORY}/${PN} == sys-devel/binutils && ${EBUILD_PHASE} == prepare ]]; then
+ cd "${S}"
+ ebegin "Prefixifying native library path"
+ sed -i -r "/NATIVE_LIB_DIRS/s,((/usr(/local|)|)/lib),${EPREFIX}\1,g" \
+ ld/configure.tgt || eerror "Please file a bug about this"
+ eend $?
+fi