gcc: cross build support.
This commit is contained in:
parent
0ae77ad0d4
commit
9b5a2567f2
2 changed files with 144 additions and 15 deletions
102
srcpkgs/gcc/patches/armhf-triplet-trunk.diff
Normal file
102
srcpkgs/gcc/patches/armhf-triplet-trunk.diff
Normal file
|
@ -0,0 +1,102 @@
|
|||
--- gcc/ada/gcc-interface/Makefile.in 2012-06-12 09:12:37.000000000 -0600
|
||||
+++ gcc/ada/gcc-interface/Makefile.in 2012-07-06 19:53:20.740322776 -0600
|
||||
@@ -1867,7 +1867,7 @@
|
||||
LIBRARY_VERSION := $(LIB_VERSION)
|
||||
endif
|
||||
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),)
|
||||
+ifeq ($(strip $(filter-out arm%-linux,$(arch)-$(osys)) $(if $(findstring eabi,$(word 4,$(targ))),,$(word 4,$(targ)))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
--- gcc/config.gcc 2012-06-04 03:51:00.000000000 -0600
|
||||
+++ gcc/config.gcc 2012-07-06 19:53:20.724697276 -0600
|
||||
@@ -842,7 +842,7 @@
|
||||
esac
|
||||
tmake_file="${tmake_file} arm/t-arm"
|
||||
case ${target} in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
|
||||
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
|
||||
# Define multilib configuration for arm-linux-androideabi.
|
||||
@@ -869,7 +869,7 @@
|
||||
tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
|
||||
tmake_file="arm/t-arm arm/t-arm-elf"
|
||||
case ${target} in
|
||||
- arm*-*-uclinux*eabi)
|
||||
+ arm*-*-uclinux*eabi*)
|
||||
tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
|
||||
tmake_file="$tmake_file arm/t-bpabi"
|
||||
# The BPABI long long divmod functions return a 128-bit value in
|
||||
--- gcc/testsuite/lib/target-supports.exp 2012-04-09 03:24:22.000000000 -0600
|
||||
+++ gcc/testsuite/lib/target-supports.exp 2012-07-06 19:53:20.732510026 -0600
|
||||
@@ -3840,7 +3840,7 @@
|
||||
|| [istarget i?86-*-*]
|
||||
|| [istarget x86_64-*-*]
|
||||
|| [istarget alpha*-*-*]
|
||||
- || [istarget arm*-*-linux-gnueabi]
|
||||
+ || [istarget arm*-*-linux-*eabi*]
|
||||
|| [istarget bfin*-*linux*]
|
||||
|| [istarget hppa*-*linux*]
|
||||
|| [istarget s390*-*-*]
|
||||
@@ -3870,7 +3870,7 @@
|
||||
|| [istarget i?86-*-*]
|
||||
|| [istarget x86_64-*-*]
|
||||
|| [istarget alpha*-*-*]
|
||||
- || [istarget arm*-*-linux-gnueabi]
|
||||
+ || [istarget arm*-*-linux-*eabi*]
|
||||
|| [istarget hppa*-*linux*]
|
||||
|| [istarget s390*-*-*]
|
||||
|| [istarget powerpc*-*-*]
|
||||
--- libgcc/config.host 2012-04-30 11:39:57.000000000 -0600
|
||||
+++ libgcc/config.host 2012-07-06 19:53:20.787199276 -0600
|
||||
@@ -327,7 +327,7 @@
|
||||
arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
|
||||
case ${host} in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
|
||||
tm_file="$tm_file arm/bpabi-lib.h"
|
||||
unwind_header=config/arm/unwind-arm.h
|
||||
--- libjava/configure.ac 2012-05-21 12:14:01.000000000 -0600
|
||||
+++ libjava/configure.ac 2012-07-06 19:53:20.709071776 -0600
|
||||
@@ -931,7 +931,7 @@
|
||||
# on Darwin -single_module speeds up loading of the dynamic libraries.
|
||||
extra_ldflags_libjava=-Wl,-single_module
|
||||
;;
|
||||
-arm*linux*eabi)
|
||||
+arm*-*-linux-*eabi*)
|
||||
# Some of the ARM unwinder code is actually in libstdc++. We
|
||||
# could in principle replicate it in libgcj, but it's better to
|
||||
# have a dependency on libstdc++.
|
||||
--- libstdc++-v3/configure.host 2012-02-10 11:10:12.000000000 -0700
|
||||
+++ libstdc++-v3/configure.host 2012-07-06 19:53:20.748135526 -0600
|
||||
@@ -340,7 +340,7 @@
|
||||
fi
|
||||
esac
|
||||
case "${host}" in
|
||||
- arm*-*-linux-*eabi)
|
||||
+ arm*-*-linux-*eabi*)
|
||||
port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
|
||||
;;
|
||||
esac
|
||||
--- libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc 2011-09-21 05:23:11.000000000 -0600
|
||||
+++ libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc 2012-07-06 19:53:20.771573776 -0600
|
||||
@@ -1,5 +1,5 @@
|
||||
// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
|
||||
-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-*eabi* } }
|
||||
|
||||
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
||||
--- libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc 2011-09-21 05:23:11.000000000 -0600
|
||||
+++ libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc 2012-07-06 19:53:20.763761026 -0600
|
||||
@@ -1,5 +1,5 @@
|
||||
// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
|
||||
-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
|
||||
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-*eabi* } }
|
||||
|
||||
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
|
@ -15,13 +15,14 @@ checksum=8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084
|
|||
|
||||
if [ "${XBPS_MACHINE}" = "x86_64" ]; then
|
||||
# Required stuff for multilib packages.
|
||||
makedepends="${makedepends} glibc32-devel"
|
||||
subpackages="gcc-multilib gcc-c++-multilib gcc-objc-multilib libgcc32"
|
||||
subpackages="${subpackages} libgomp32 libmudflap32-devel libmudflap32"
|
||||
subpackages="${subpackages} libobjc32 libssp32 libstdc++32-devel"
|
||||
subpackages="${subpackages} libstdc++32 libitm32"
|
||||
|
||||
_triplet="${XBPS_MACHINE}-unknown-linux-gnu"
|
||||
makedepends="${makedepends} glibc32-devel"
|
||||
subpackages="gcc-multilib gcc-c++-multilib gcc-objc-multilib libgcc32
|
||||
libgomp32 libmudflap32-devel libmudflap32
|
||||
libobjc32 libssp32 libstdc++32-devel
|
||||
libstdc++32 libitm32"
|
||||
elif [ "$XBPS_MACHINE" = "armv6l" ]; then
|
||||
_triplet="arm-linux-gnueabihf"
|
||||
else
|
||||
_triplet="${XBPS_MACHINE}-pc-linux-gnu"
|
||||
fi
|
||||
|
@ -34,21 +35,45 @@ subpackages="${subpackages} libgcc libgo libssp libssp-devel libstdc++
|
|||
libobjc-devel libgfortran libgfortran-devel gcc-fortran gcc-c++
|
||||
gcc-objc gcc-objc++ gcc-go"
|
||||
|
||||
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
|
||||
# XXX enable default langs: objc, obj-c++, fortran and go.
|
||||
makedepends="perl flex"
|
||||
crossmakedepends="libfl-devel zlib-devel gmp-devel mpfr-devel mpc-devel
|
||||
ppl-devel>=1.0 cloog-devel"
|
||||
subpackages="libgcc libssp libssp-devel libstdc++
|
||||
libstdc++-devel libgomp libgomp-devel
|
||||
libitm libmudflap libmudflap-devel gcc-c++"
|
||||
fi
|
||||
|
||||
do_configure() {
|
||||
# As specified in the LFS book, disable installing libiberty.
|
||||
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
|
||||
# Do not run fixincludes
|
||||
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
|
||||
|
||||
./configure --libexecdir=/usr/lib \
|
||||
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
|
||||
export CC="$XBPS_CROSS_TRIPLET-gcc --sysroot=/usr/$XBPS_CROSS_TRIPLET"
|
||||
export CC_FOR_TARGET="$CC"
|
||||
export GCC="$CC"
|
||||
export GCC_FOR_TARGET="$CC"
|
||||
export CXX="$XBPS_CROSS_TRIPLET-g++ --sysroot=/usr/$XBPS_CROSS_TRIPLET"
|
||||
export CXX_FOR_TARGET="$CXX"
|
||||
export CFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
_args="--disable-multilib --with-float=hard"
|
||||
_langs="c,c++,lto"
|
||||
else
|
||||
_langs="c,c++,objc,obj-c++,fortran,go,lto"
|
||||
fi
|
||||
|
||||
./configure ${CONFIGURE_SHARED_ARGS} --libexecdir=/usr/lib \
|
||||
--enable-clocale=gnu --disable-bootstrap --libdir=/usr/lib \
|
||||
--enable-threads=posix --enable-__cxa_atexit --enable-multilib \
|
||||
--enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-tls \
|
||||
--disable-rpath --with-system-zlib --enable-shared --enable-lto \
|
||||
--enable-linker-build-id --enable-gnu-unique-object \
|
||||
--enable-checking=release --disable-libstdcxx-pch \
|
||||
--with-ppl --enable-cloog-backend=isl --enable-libstdcxx-time \
|
||||
${CONFIGURE_SHARED_ARGS}
|
||||
--enable-tls --enable-languages=${_langs} ${_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
|
@ -87,12 +112,14 @@ do_install() {
|
|||
|
||||
# Remove unused stuff for multilib.
|
||||
if [ "${XBPS_MACHINE}" = "x86_64" ]; then
|
||||
rm -f ${DESTDIR}/usr/lib32/libffi*
|
||||
rm -f ${DESTDIR}/usr/lib32/libgfortran*
|
||||
rm -f ${DESTDIR}/usr/lib32/libgo.{a,so*}
|
||||
rm -f ${DESTDIR}/usr/lib32/libgobegin.a
|
||||
rm -f ${DESTDIR}/usr/lib32/libquadmath*
|
||||
rm -rf ${DESTDIR}/usr/lib32/go
|
||||
if [ -d ${DESTDIR}/usr/lib32 ]; then
|
||||
rm -f ${DESTDIR}/usr/lib32/libffi*
|
||||
rm -f ${DESTDIR}/usr/lib32/libgfortran*
|
||||
rm -f ${DESTDIR}/usr/lib32/libgo.{a,so*}
|
||||
rm -f ${DESTDIR}/usr/lib32/libgobegin.a
|
||||
rm -f ${DESTDIR}/usr/lib32/libquadmath*
|
||||
rm -rf ${DESTDIR}/usr/lib32/go
|
||||
fi
|
||||
fi
|
||||
|
||||
# Remove all python scripts in libdir.
|
||||
|
|
Loading…
Add table
Reference in a new issue