cross-profiles: simplify and rename some of them to match XBPS_TARGET_MACHINE.

- XBPS_TARGET_ARCH var renamed to XBPS_TARGET_MACHINE (gets rid of an extra var).
- Renamed cross profiles to match XBPS_TARGET_MACHINE.
- Added symlinks to keep compatibility with old profiles.
This commit is contained in:
Juan RP 2016-04-27 16:47:05 +02:00
parent 2269952b63
commit b722ed3c8b
25 changed files with 62 additions and 57 deletions

View file

@ -4,7 +4,7 @@ CROSS PROFILES
This directory contains cross profiles to allow cross compilation for the specified target.
A cross profile file must provide the following variables:
- XBPS_TARGET_ARCH (as returned by uname -m)
- XBPS_TARGET_MACHINE (as returned by uname -m + optional -musl suffix)
- XBPS_CROSS_TRIPLET (the cross compiler triplet)
- XBPS_CROSS_CFLAGS (C compiler flags for the cross compiler)
- XBPS_CROSS_CXXFLAGS (C++ compiler flags for the cross compiler)

View file

@ -1,6 +1,6 @@
# Cross build profile for ARMv8.
XBPS_TARGET_ARCH="aarch64-musl"
XBPS_TARGET_MACHINE="aarch64-musl"
XBPS_CROSS_TRIPLET="aarch64-linux-musl"
XBPS_CROSS_CFLAGS="-march=armv8-a"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for ARMv8.
XBPS_TARGET_ARCH="aarch64"
XBPS_TARGET_MACHINE="aarch64"
XBPS_CROSS_TRIPLET="aarch64-linux-gnu"
XBPS_CFLAGS="-O2 -pipe" # XXX not yet supported: -fstack-protector-strong
XBPS_CXXFLAGS="$XBPS_CFLAGS"

View file

@ -1,6 +0,0 @@
# Cross build profile for ARM GNU EABI5 Soft Float and Musl libc.
XBPS_TARGET_ARCH="armv5tel-musl"
XBPS_CROSS_TRIPLET="arm-linux-musleabi"
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv5tel-musl.sh

View file

@ -1,6 +0,0 @@
# Cross build profile for ARM GNU EABI5 Soft Float.
XBPS_TARGET_ARCH="armv5tel"
XBPS_CROSS_TRIPLET="arm-linux-gnueabi"
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv5tel.sh

View file

@ -0,0 +1,6 @@
# Cross build profile for ARM GNU EABI5 Soft Float and Musl libc.
XBPS_TARGET_MACHINE="armv5tel-musl"
XBPS_CROSS_TRIPLET="arm-linux-musleabi"
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1,6 @@
# Cross build profile for ARM GNU EABI5 Soft Float.
XBPS_TARGET_MACHINE="armv5tel"
XBPS_CROSS_TRIPLET="arm-linux-gnueabi"
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +0,0 @@
# Cross build profile for ARM EABI5 Hard Float and Musl libc.
XBPS_TARGET_ARCH="armv6l-musl"
XBPS_CROSS_TRIPLET="arm-linux-musleabihf"
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv6l-musl.sh

View file

@ -1,6 +0,0 @@
# Cross build profile for ARM GNU EABI5 Hard Float.
XBPS_TARGET_ARCH="armv6l"
XBPS_CROSS_TRIPLET="arm-linux-gnueabihf"
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv6l.sh

View file

@ -0,0 +1,6 @@
# Cross build profile for ARM EABI5 Hard Float and Musl libc.
XBPS_TARGET_MACHINE="armv6l-musl"
XBPS_CROSS_TRIPLET="arm-linux-musleabihf"
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1,6 @@
# Cross build profile for ARM GNU EABI5 Hard Float.
XBPS_TARGET_MACHINE="armv6l"
XBPS_CROSS_TRIPLET="arm-linux-gnueabihf"
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +0,0 @@
# Cross build profile for ARMv7 EABI Hard Float and Musl libc.
XBPS_TARGET_ARCH="armv7l-musl"
XBPS_CROSS_TRIPLET="armv7l-linux-musleabihf"
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv7l-musl.sh

View file

@ -1,6 +0,0 @@
# Cross build profile for ARMv7 GNU EABI Hard Float.
XBPS_TARGET_ARCH="armv7l"
XBPS_CROSS_TRIPLET="armv7l-linux-gnueabihf"
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1 @@
armv7l.sh

View file

@ -0,0 +1,6 @@
# Cross build profile for ARMv7 EABI Hard Float and Musl libc.
XBPS_TARGET_MACHINE="armv7l-musl"
XBPS_CROSS_TRIPLET="armv7l-linux-musleabihf"
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -0,0 +1,6 @@
# Cross build profile for ARMv7 GNU EABI Hard Float.
XBPS_TARGET_MACHINE="armv7l"
XBPS_CROSS_TRIPLET="armv7l-linux-gnueabihf"
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for i686 and Musl libc.
XBPS_TARGET_ARCH="i686-musl"
XBPS_TARGET_MACHINE="i686-musl"
XBPS_CROSS_TRIPLET="i686-linux-musl"
XBPS_CROSS_CFLAGS="-march=i686"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for i686 GNU.
XBPS_TARGET_ARCH="i686"
XBPS_TARGET_MACHINE="i686"
XBPS_CROSS_TRIPLET="i686-pc-linux-gnu"
XBPS_CROSS_CFLAGS="-march=i686"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for MIPS32 BE soft float.
XBPS_TARGET_ARCH="mips-musl"
XBPS_TARGET_MACHINE="mips-musl"
XBPS_CROSS_TRIPLET="mips-linux-musl"
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for MIPS32 LE soft float.
XBPS_TARGET_ARCH="mipsel-musl"
XBPS_TARGET_MACHINE="mipsel-musl"
XBPS_CROSS_TRIPLET="mipsel-linux-musl"
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for MIPS32 LE hardfloat.
XBPS_TARGET_ARCH="mipselhf-musl"
XBPS_TARGET_MACHINE="mipselhf-musl"
XBPS_CROSS_TRIPLET="mipsel-linux-muslhf"
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -mhard-float"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -1,6 +1,6 @@
# Cross build profile for x86_64 and Musl libc.
XBPS_TARGET_ARCH="x86_64-musl"
XBPS_TARGET_MACHINE="x86_64-musl"
XBPS_CROSS_TRIPLET="x86_64-linux-musl"
XBPS_CROSS_CFLAGS="-mtune=generic"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"

View file

@ -57,7 +57,7 @@ bulk_build() {
if [ "$XBPS_CROSS_BUILD" ]; then
source ${XBPS_COMMONDIR}/cross-profiles/${XBPS_CROSS_BUILD}.sh
export XBPS_ARCH=${XBPS_TARGET_ARCH}
export XBPS_ARCH=${XBPS_TARGET_MACHINE}
fi
if ! command -v xbps-checkvers &>/dev/null; then
msg_error "xbps-src: cannot find xbps-checkvers(8) command!\n"

View file

@ -149,7 +149,7 @@ chroot_sync_repos() {
$XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys
# Make sure to sync index for remote repositories.
if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE \
xbps-install -r $XBPS_MASTERDIR/$XBPS_CROSS_BASE -S
fi
fi

View file

@ -228,7 +228,7 @@ setup_pkg() {
if [ -n "$cross" ]; then
source_file $XBPS_CROSSPFDIR/${cross}.sh
_vars="TARGET_ARCH CROSS_TRIPLET CROSS_CFLAGS CROSS_CXXFLAGS"
_vars="TARGET_MACHINE CROSS_TRIPLET CROSS_CFLAGS CROSS_CXXFLAGS"
for f in ${_vars}; do
eval val="\$XBPS_$f"
if [ -z "$val" ]; then
@ -237,15 +237,14 @@ setup_pkg() {
fi
done
export XBPS_TARGET_MACHINE=$XBPS_TARGET_ARCH
export XBPS_CROSS_BASE=/usr/$XBPS_CROSS_TRIPLET
XBPS_INSTALL_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH $XBPS_INSTALL_CMD -c /host/repocache -r $XBPS_CROSS_BASE"
XBPS_QUERY_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH $XBPS_QUERY_CMD -c /host/repocache -r $XBPS_CROSS_BASE"
XBPS_RECONFIGURE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH $XBPS_RECONFIGURE_CMD -r $XBPS_CROSS_BASE"
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH $XBPS_REMOVE_CMD -r $XBPS_CROSS_BASE"
XBPS_RINDEX_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH $XBPS_RINDEX_CMD"
XBPS_UHELPER_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH xbps-uhelper -r $XBPS_CROSS_BASE"
XBPS_INSTALL_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_INSTALL_CMD -c /host/repocache -r $XBPS_CROSS_BASE"
XBPS_QUERY_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_QUERY_CMD -c /host/repocache -r $XBPS_CROSS_BASE"
XBPS_RECONFIGURE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_RECONFIGURE_CMD -r $XBPS_CROSS_BASE"
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_REMOVE_CMD -r $XBPS_CROSS_BASE"
XBPS_RINDEX_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_RINDEX_CMD"
XBPS_UHELPER_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE xbps-uhelper -r $XBPS_CROSS_BASE"
else
export XBPS_TARGET_MACHINE=${XBPS_ARCH:-$XBPS_MACHINE}

View file

@ -10,7 +10,7 @@ remove_pkg_cross_deps() {
if [ -z "$XBPS_REMOVE_XCMD" ]; then
source_file $XBPS_CROSSPFDIR/${XBPS_CROSS_BUILD}.sh
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH xbps-remove -r /usr/$XBPS_CROSS_TRIPLET"
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE xbps-remove -r /usr/$XBPS_CROSS_TRIPLET"
fi
$XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1
@ -48,7 +48,7 @@ prepare_cross_sysroot() {
fi
rm -f $errlog
# Create top level symlinks in sysroot.
XBPS_ARCH=$XBPS_TARGET_ARCH xbps-reconfigure -r $XBPS_CROSS_BASE -f base-directories base-files &>/dev/null
XBPS_ARCH=$XBPS_TARGET_MACHINE xbps-reconfigure -r $XBPS_CROSS_BASE -f base-directories base-files &>/dev/null
# Create a sysroot/include and sysroot/lib symlink just in case.
ln -s usr/include ${XBPS_CROSS_BASE}/include
ln -s usr/lib ${XBPS_CROSS_BASE}/lib