diff --git a/gpkg-dev/cbt/PKGBUILD b/gpkg-dev/cbt/PKGBUILD index fe3fc2703..c7e574699 100644 --- a/gpkg-dev/cbt/PKGBUILD +++ b/gpkg-dev/cbt/PKGBUILD @@ -1,20 +1,28 @@ pkgname=cbt pkgver=2.42 -pkgrel=0 +pkgrel=1 pkgdesc='Cross Binutils for Termux (only for Linux)' arch=(x86_64) url='https://www.gnu.org/software/binutils/' license=('GPL3' 'GPL' 'FDL1.3' 'custom:FSFAP') source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz - Makefile.in.patch) + Makefile.in.patch + config.sub.patch) sha256sums=('f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800' - '31373ed20554e420b312bcf95f634cac3061e596d152b6582f7e24bcaf195bb1') + '31373ed20554e420b312bcf95f634cac3061e596d152b6582f7e24bcaf195bb1' + 'c8835d73de13a9086da70e7def29c4a9606d089dfd458636ee3abe3a443c92e4') groups=('cgct') prepare() { for i in *.patch; do patch -Np1 -i ${srcdir}/$i done + + cd binutils-${pkgver} + for i in sys_lib_search_path_spec sys_lib_dlsearch_path_spec; do + sed -i "s|${i}=.*|${i}='${GLIBC_PREFIX}/lib'|g" $(find -name configure) $(find -name libtool.m4) + done + sed -i "s|NATIVE_LIB_DIRS=.*|NATIVE_LIB_DIRS='${GLIBC_PREFIX}/lib'|g" ld/configure.tgt } build() { @@ -29,6 +37,8 @@ build() { cd binutils-${arch_build} "$srcdir"/binutils-${pkgver}/configure \ + --host=cgct \ + --build=${CHOST} \ --target=$target \ --prefix=$CGCT_PREFIX \ --disable-multilib \ @@ -37,7 +47,11 @@ build() { --disable-nls \ --enable-ld=default \ --enable-plugins \ - --enable-deterministic-archives + --enable-deterministic-archives \ + CC=x86_64-linux-gnu-gcc \ + CXX=x86_64-linux-gnu-g++ \ + AR=ar \ + LD=ld make cd .. diff --git a/gpkg-dev/cbt/config.sub.patch b/gpkg-dev/cbt/config.sub.patch new file mode 100644 index 000000000..b9cb02abe --- /dev/null +++ b/gpkg-dev/cbt/config.sub.patch @@ -0,0 +1,42 @@ +--- src/binutils-2.42/config.sub 2024-01-29 03:00:00.000000000 +0300 ++++ src/binutils-2.42/config.sub.patch 2024-04-19 23:10:18.910726002 +0300 +@@ -648,6 +648,10 @@ + basic_machine=ymp-cray + basic_os=unicos + ;; ++ cgct) ++ basic_machine=x86_64-pc ++ basic_os=cgct ++ ;; + *) + basic_machine=$1 + basic_os= +@@ -1321,6 +1325,10 @@ + kernel=linux + os=`echo "$basic_os" | sed -e 's|linux|gnu|'` + ;; ++ cgct) ++ kernel=linux ++ os=cgct ++ ;; + managarm*) + kernel=managarm + os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` +@@ -1766,7 +1774,7 @@ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ +- | fiwix* | mlibc* | cos* | mbr* ) ++ | fiwix* | mlibc* | cos* | mbr* | cgct ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) +@@ -1819,7 +1827,7 @@ + # (given a valid OS), if there is a kernel. + case $kernel-$os-$obj in + linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \ +- | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- ) ++ | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- | linux-cgct- ) + ;; + uclinux-uclibc*- ) + ;;