gcc-*: fix compiling in strict mode [skip ci] (#1468)
Due to changes in abuild, our `gcc-armhf` etc. packages did not build when using strict mode (i.e. `pmbootstrap build --strict gcc-armhf`) anymore. Changes: * Set `CBUILDDIR=/`, so apk can read a valid package index from there * Directly set `_cross_configure`, so it does not use CBUILDDIR anymore * Set `BOOTSTRAP="nobuildbase"` to prevent apk from installing `build-base-armhf` etc. (these don't exist in pmOS) * Remove legacy code for lazy reproducible builds that wrapped `package()`
This commit is contained in:
parent
959932fa6a
commit
a6d89192ce
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
CTARGET_ARCH=aarch64
|
CTARGET_ARCH=aarch64
|
||||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||||
CBUILDROOT="/usr/$CTARGET"
|
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_JAVA=false
|
LANG_JAVA=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
|
@ -12,40 +11,16 @@ LANG_FORTRAN=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
options="!strip !tracedeps"
|
options="!strip !tracedeps"
|
||||||
|
|
||||||
# Wrap the package function, to make the resulting package
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||||
# lazy-reproducible
|
# when this variable matches "no*"
|
||||||
package() {
|
BOOTSTRAP="nobuildbase"
|
||||||
# Repack the *.a files to be reproducible (see #64)
|
|
||||||
_temp="$_builddir"/_reproducible-patch
|
|
||||||
cd "$_builddir"
|
|
||||||
for f in $(find -name '*.a'); do
|
|
||||||
# Copy to a temporary folder
|
|
||||||
echo "Repack $f to be reproducible"
|
|
||||||
mkdir -p "$_temp"
|
|
||||||
cd "$_temp"
|
|
||||||
cp "$_builddir"/"$f" .
|
|
||||||
|
|
||||||
# Repack with a sorted file order
|
# abuild will only cross compile when this variable is set, but it
|
||||||
ar x *.a
|
# needs to find a valid package database in there for dependency
|
||||||
rm *.a
|
# resolving, so we set it to /.
|
||||||
ar r sorted.a $(find -name '*.o' | sort)
|
CBUILDROOT="/"
|
||||||
|
|
||||||
# Copy back and clean up
|
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||||
cp -v sorted.a "$_builddir"/"$f"
|
|
||||||
cd ..
|
|
||||||
rm -r "$_temp"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Unmodified package function from the gcc APKBUILD
|
|
||||||
_package
|
|
||||||
|
|
||||||
# Workaround for: postmarketOS/binary-package-repo#1
|
|
||||||
echo "Replacing hardlinks with symlinks"
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-g++ "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-gcc "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkgname="gcc-aarch64"
|
pkgname="gcc-aarch64"
|
||||||
pkgver=6.4.0
|
pkgver=6.4.0
|
||||||
|
@ -287,7 +262,6 @@ prepare() {
|
||||||
build() {
|
build() {
|
||||||
local _arch_configure=
|
local _arch_configure=
|
||||||
local _libc_configure=
|
local _libc_configure=
|
||||||
local _cross_configure=
|
|
||||||
local _bootstrap_configure=
|
local _bootstrap_configure=
|
||||||
local _symvers=
|
local _symvers=
|
||||||
|
|
||||||
|
@ -325,8 +299,6 @@ build() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$CBUILD" != "$CHOST" ] && _cross_configure="--disable-bootstrap"
|
|
||||||
[ "$CHOST" != "$CTARGET" ] && _cross_configure="--disable-bootstrap --with-sysroot=$CBUILDROOT"
|
|
||||||
|
|
||||||
case "$BOOTSTRAP" in
|
case "$BOOTSTRAP" in
|
||||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||||
|
@ -382,7 +354,7 @@ build() {
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
package() {
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
make -j1 DESTDIR="${pkgdir}" install
|
make -j1 DESTDIR="${pkgdir}" install
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
CTARGET_ARCH=armhf
|
CTARGET_ARCH=armhf
|
||||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||||
CBUILDROOT="/usr/$CTARGET"
|
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_JAVA=false
|
LANG_JAVA=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
|
@ -12,40 +11,16 @@ LANG_FORTRAN=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
options="!strip !tracedeps"
|
options="!strip !tracedeps"
|
||||||
|
|
||||||
# Wrap the package function, to make the resulting package
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||||
# lazy-reproducible
|
# when this variable matches "no*"
|
||||||
package() {
|
BOOTSTRAP="nobuildbase"
|
||||||
# Repack the *.a files to be reproducible (see #64)
|
|
||||||
_temp="$_builddir"/_reproducible-patch
|
|
||||||
cd "$_builddir"
|
|
||||||
for f in $(find -name '*.a'); do
|
|
||||||
# Copy to a temporary folder
|
|
||||||
echo "Repack $f to be reproducible"
|
|
||||||
mkdir -p "$_temp"
|
|
||||||
cd "$_temp"
|
|
||||||
cp "$_builddir"/"$f" .
|
|
||||||
|
|
||||||
# Repack with a sorted file order
|
# abuild will only cross compile when this variable is set, but it
|
||||||
ar x *.a
|
# needs to find a valid package database in there for dependency
|
||||||
rm *.a
|
# resolving, so we set it to /.
|
||||||
ar r sorted.a $(find -name '*.o' | sort)
|
CBUILDROOT="/"
|
||||||
|
|
||||||
# Copy back and clean up
|
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||||
cp -v sorted.a "$_builddir"/"$f"
|
|
||||||
cd ..
|
|
||||||
rm -r "$_temp"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Unmodified package function from the gcc APKBUILD
|
|
||||||
_package
|
|
||||||
|
|
||||||
# Workaround for: postmarketOS/binary-package-repo#1
|
|
||||||
echo "Replacing hardlinks with symlinks"
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-g++ "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-gcc "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkgname="gcc-armhf"
|
pkgname="gcc-armhf"
|
||||||
pkgver=6.4.0
|
pkgver=6.4.0
|
||||||
|
@ -287,7 +262,6 @@ prepare() {
|
||||||
build() {
|
build() {
|
||||||
local _arch_configure=
|
local _arch_configure=
|
||||||
local _libc_configure=
|
local _libc_configure=
|
||||||
local _cross_configure=
|
|
||||||
local _bootstrap_configure=
|
local _bootstrap_configure=
|
||||||
local _symvers=
|
local _symvers=
|
||||||
|
|
||||||
|
@ -325,8 +299,6 @@ build() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$CBUILD" != "$CHOST" ] && _cross_configure="--disable-bootstrap"
|
|
||||||
[ "$CHOST" != "$CTARGET" ] && _cross_configure="--disable-bootstrap --with-sysroot=$CBUILDROOT"
|
|
||||||
|
|
||||||
case "$BOOTSTRAP" in
|
case "$BOOTSTRAP" in
|
||||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||||
|
@ -382,7 +354,7 @@ build() {
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
package() {
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
make -j1 DESTDIR="${pkgdir}" install
|
make -j1 DESTDIR="${pkgdir}" install
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
CTARGET_ARCH=x86_64
|
CTARGET_ARCH=x86_64
|
||||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||||
CBUILDROOT="/usr/$CTARGET"
|
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_JAVA=false
|
LANG_JAVA=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
|
@ -12,40 +11,16 @@ LANG_FORTRAN=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
options="!strip !tracedeps"
|
options="!strip !tracedeps"
|
||||||
|
|
||||||
# Wrap the package function, to make the resulting package
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||||
# lazy-reproducible
|
# when this variable matches "no*"
|
||||||
package() {
|
BOOTSTRAP="nobuildbase"
|
||||||
# Repack the *.a files to be reproducible (see #64)
|
|
||||||
_temp="$_builddir"/_reproducible-patch
|
|
||||||
cd "$_builddir"
|
|
||||||
for f in $(find -name '*.a'); do
|
|
||||||
# Copy to a temporary folder
|
|
||||||
echo "Repack $f to be reproducible"
|
|
||||||
mkdir -p "$_temp"
|
|
||||||
cd "$_temp"
|
|
||||||
cp "$_builddir"/"$f" .
|
|
||||||
|
|
||||||
# Repack with a sorted file order
|
# abuild will only cross compile when this variable is set, but it
|
||||||
ar x *.a
|
# needs to find a valid package database in there for dependency
|
||||||
rm *.a
|
# resolving, so we set it to /.
|
||||||
ar r sorted.a $(find -name '*.o' | sort)
|
CBUILDROOT="/"
|
||||||
|
|
||||||
# Copy back and clean up
|
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||||
cp -v sorted.a "$_builddir"/"$f"
|
|
||||||
cd ..
|
|
||||||
rm -r "$_temp"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Unmodified package function from the gcc APKBUILD
|
|
||||||
_package
|
|
||||||
|
|
||||||
# Workaround for: postmarketOS/binary-package-repo#1
|
|
||||||
echo "Replacing hardlinks with symlinks"
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-g++ "$pkgdir"/usr/bin/"$CTARGET"-c++
|
|
||||||
rm -v "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
ln -s -v /usr/bin/"$CTARGET"-gcc "$pkgdir"/usr/bin/"$CTARGET"-gcc-"$pkgver"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkgname="gcc-x86_64"
|
pkgname="gcc-x86_64"
|
||||||
pkgver=6.4.0
|
pkgver=6.4.0
|
||||||
|
@ -287,7 +262,6 @@ prepare() {
|
||||||
build() {
|
build() {
|
||||||
local _arch_configure=
|
local _arch_configure=
|
||||||
local _libc_configure=
|
local _libc_configure=
|
||||||
local _cross_configure=
|
|
||||||
local _bootstrap_configure=
|
local _bootstrap_configure=
|
||||||
local _symvers=
|
local _symvers=
|
||||||
|
|
||||||
|
@ -325,8 +299,6 @@ build() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$CBUILD" != "$CHOST" ] && _cross_configure="--disable-bootstrap"
|
|
||||||
[ "$CHOST" != "$CTARGET" ] && _cross_configure="--disable-bootstrap --with-sysroot=$CBUILDROOT"
|
|
||||||
|
|
||||||
case "$BOOTSTRAP" in
|
case "$BOOTSTRAP" in
|
||||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||||
|
@ -382,7 +354,7 @@ build() {
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
package() {
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
make -j1 DESTDIR="${pkgdir}" install
|
make -j1 DESTDIR="${pkgdir}" install
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user