Skip to content

Commit

Permalink
gpkg-dev/cgt: compiler fix for x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Apr 20, 2024
1 parent 2fd85dd commit d271e18
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 3 deletions.
18 changes: 15 additions & 3 deletions gpkg-dev/cgt/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname=cgt
pkgver=13.2.0
pkgrel=4
pkgrel=5
pkgdesc='Cross GCCs for Termux (only for Linux)'
arch=(x86_64)
url='https://gcc.gnu.org/'
Expand All @@ -10,15 +10,20 @@ source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
gcc.cc.patch
gcc-Makefile.in.patch
gcc-configure.patch
config.sub.patch
configure.patch
set_glibc_dynamic_linker.patch)
sha256sums=('e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da'
'8d9f0c6cd1c57e623ba9b054f69185e4fb4717cc3af61c19d191948270042d6c'
'e61dc2469a70392923aeac3f9e80c0b0c7ebd372488bc99e6dd0e18c1e3e3360'
'1115c633d6fd0d4f6d6eeca50e4d52fd15f0bf52b4158ecb0ea6bedcb85ceb35'
'346843fbce4bddca236ca4331ae43c5356ed177689c7760d841d2db2d2643d13'
'74020f17b5543f75353254f206c7567deef8453e71802ebc9d4bdbb09740a02a'
'0eb6079c420a46b54ce9ef7c601a9766e5c85244757b837000979c41d541a315'
'cd383a4a1916f4b3102f21c640d6116f697e0ef7cde5f705d83035849c200ec6')
groups=('cgct')


prepare() {
for i in *.patch; do
patch -Np1 -i ${srcdir}/$i
Expand All @@ -28,6 +33,9 @@ prepare() {
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
sed -i '/lp64=/s/lib64/lib/' gcc/config/aarch64/t-aarch64-linux
for i in sys_lib_search_path_spec sys_lib_dlsearch_path_spec; do
sed -i "s|${i}=.*|${i}='${GLIBC_PREFIX}/lib'|g" */configure $(find -name libtool.m4)
done
}

build() {
Expand Down Expand Up @@ -59,7 +67,7 @@ build() {
esac

"$srcdir"/gcc-${pkgver}/configure \
--host=${CHOST} \
--host=cgct \
--build=${CHOST} \
--target=${target} \
--prefix=${CGCT_PREFIX} \
Expand Down Expand Up @@ -97,7 +105,11 @@ build() {
AS_FOR_TARGET=${CGCT_PREFIX}/bin/as \
AR_FOR_TARGET=${CGCT_PREFIX}/bin/ar \
RANLIB_FOR_TARGET=${CGCT_PREFIX}/bin/ranlib \
NM_FOR_TARGET=${CGCT_PREFIX}/bin/nm
NM_FOR_TARGET=${CGCT_PREFIX}/bin/nm \
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/cgt/config.sub.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- src/gcc-13.2.0/config.sub 2024-04-17 12:59:33.770464867 +0300
+++ src/gcc-13.2.0/config.sub.patch 2024-04-17 13:10:53.190464608 +0300
@@ -647,6 +647,10 @@
basic_machine=ymp-cray
basic_os=unicos
;;
+ cgct)
+ basic_machine=x86_64-pc
+ basic_os=cgct
+ ;;
*)
basic_machine=$1
basic_os=
@@ -1336,6 +1340,10 @@
kernel=linux
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
;;
+ cgct)
+ kernel=linux
+ os=cgct
+ ;;
*)
kernel=
os=$basic_os
@@ -1749,7 +1757,7 @@
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
- | fiwix* )
+ | fiwix* | cgct)
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1767,7 +1775,7 @@
# (given a valid OS), if there is a kernel.
case $kernel-$os in
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
- | linux-musl* | linux-relibc* | linux-uclibc* )
+ | linux-musl* | linux-relibc* | linux-uclibc* | linux-cgct)
;;
uclinux-uclibc* )
;;
209 changes: 209 additions & 0 deletions gpkg-dev/cgt/configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
--- src/gcc-13.2.0/configure 2023-07-27 11:13:03.000000000 +0300
+++ src/gcc-13.2.0/configure.patch 2024-04-17 19:47:43.249004152 +0300
@@ -17498,7 +17498,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5
$as_echo_n "checking where to find the target ar... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $AR_FOR_TARGET`
@@ -17540,7 +17540,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target as" >&5
$as_echo_n "checking where to find the target as... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $AS_FOR_TARGET`
@@ -17582,7 +17582,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target cc" >&5
$as_echo_n "checking where to find the target cc... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $CC_FOR_TARGET`
@@ -17624,7 +17624,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target c++" >&5
$as_echo_n "checking where to find the target c++... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $CXX_FOR_TARGET`
@@ -17669,7 +17669,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target c++ for libstdc++" >&5
$as_echo_n "checking where to find the target c++ for libstdc++... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $RAW_CXX_FOR_TARGET`
@@ -17714,7 +17714,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target dlltool" >&5
$as_echo_n "checking where to find the target dlltool... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $DLLTOOL_FOR_TARGET`
@@ -17756,7 +17756,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target dsymutil" >&5
$as_echo_n "checking where to find the target dsymutil... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$DSYMUTIL_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $DSYMUTIL_FOR_TARGET`
@@ -17787,7 +17787,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gcc" >&5
$as_echo_n "checking where to find the target gcc... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GCC_FOR_TARGET`
@@ -17829,7 +17829,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gfortran" >&5
$as_echo_n "checking where to find the target gfortran... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GFORTRAN_FOR_TARGET`
@@ -17874,7 +17874,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gccgo" >&5
$as_echo_n "checking where to find the target gccgo... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$GOC_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GOC_FOR_TARGET`
@@ -17919,7 +17919,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gdc" >&5
$as_echo_n "checking where to find the target gdc... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$GDC_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GDC_FOR_TARGET`
@@ -17964,7 +17964,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gm2" >&5
$as_echo_n "checking where to find the target gm2... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$GM2_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GM2_FOR_TARGET`
@@ -18009,7 +18009,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ld" >&5
$as_echo_n "checking where to find the target ld... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $LD_FOR_TARGET`
@@ -18051,7 +18051,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target lipo" >&5
$as_echo_n "checking where to find the target lipo... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $LIPO_FOR_TARGET`
@@ -18082,7 +18082,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target nm" >&5
$as_echo_n "checking where to find the target nm... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $NM_FOR_TARGET`
@@ -18124,7 +18124,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target objcopy" >&5
$as_echo_n "checking where to find the target objcopy... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$OBJCOPY_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $OBJCOPY_FOR_TARGET`
@@ -18166,7 +18166,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target objdump" >&5
$as_echo_n "checking where to find the target objdump... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $OBJDUMP_FOR_TARGET`
@@ -18208,7 +18208,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target otool" >&5
$as_echo_n "checking where to find the target otool... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$OTOOL_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $OTOOL_FOR_TARGET`
@@ -18239,7 +18239,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ranlib" >&5
$as_echo_n "checking where to find the target ranlib... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $RANLIB_FOR_TARGET`
@@ -18281,7 +18281,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target readelf" >&5
$as_echo_n "checking where to find the target readelf... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$READELF_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $READELF_FOR_TARGET`
@@ -18323,7 +18323,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target strip" >&5
$as_echo_n "checking where to find the target strip... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $STRIP_FOR_TARGET`
@@ -18365,7 +18365,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target windres" >&5
$as_echo_n "checking where to find the target windres... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $WINDRES_FOR_TARGET`
@@ -18407,7 +18407,7 @@

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target windmc" >&5
$as_echo_n "checking where to find the target windmc... " >&6; }
-if test "x${build}" != "x${host}" ; then
+if false ; then
if expr "x$WINDMC_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $WINDMC_FOR_TARGET`

0 comments on commit d271e18

Please sign in to comment.