Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpkg-dev/cbt: fix for x86_64 #234

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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*- )
;;