Skip to content

Commit

Permalink
gpkg-dev/cbt: fix for x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Apr 19, 2024
1 parent 52db6a6 commit 94c3693
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
22 changes: 18 additions & 4 deletions gpkg-dev/cbt/PKGBUILD
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -29,6 +37,8 @@ build() {
cd binutils-${arch_build}

"$srcdir"/binutils-${pkgver}/configure \
--host=cgct \
--build=${CHOST} \
--target=$target \
--prefix=$CGCT_PREFIX \
--disable-multilib \
Expand All @@ -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 ..
Expand Down
42 changes: 42 additions & 0 deletions gpkg-dev/cbt/config.sub.patch
Original file line number Diff line number Diff line change
@@ -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*- )
;;

0 comments on commit 94c3693

Please sign in to comment.