summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPellegrino Prevete2023-01-03 17:28:26 +0000
committerPellegrino Prevete2023-01-03 17:28:26 +0000
commit105e348952bf66e3f33d9a316fc32cc125381dc5 (patch)
tree1b1f3bd332d0b1935235c9e637609ba06820cbbf
downloadaur-105e348952bf66e3f33d9a316fc32cc125381dc5.tar.gz
initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD149
2 files changed, 166 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8acca44789f8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = mipsel-ps2-irx-gcc-stage1
+ pkgdesc = The GNU Compiler Collection. Stage 1 for toolchain building (mipsel-ps2-irx).
+ pkgver = v11.3.0
+ pkgrel = 1
+ url = https://github.com/ps2dev/gcc
+ arch = x86_64
+ license = BSD
+ makedepends = mipsel-ps2-irx-binutils
+ makedepends = libgmp-static
+ makedepends = mpfr-static
+ makedepends = libmpc-static
+ makedepends = gmp4-static
+ makedepends = zstd-static
+ source = mipsel-ps2-irx-gcc-stage1::git+https://github.com/ps2dev/gcc#commit=331453616ac96717cfef82d21c03573c8984f17d
+ sha256sums = SKIP
+
+pkgname = mipsel-ps2-irx-gcc-stage1
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..fb3024e357e9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,149 @@
+# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>
+
+# shellcheck disable=SC2034
+_module="iop"
+_platform="ps2"
+_target="mipsel-${_platform}"
+target="${_target}-irx"
+_base="toolchain"
+pkgname=("${target}-gcc-stage1")
+pkgver="v11.3.0"
+pkgrel=1
+_pkgdesc=("The GNU Compiler Collection. Stage 1 for toolchain building (${target}).")
+pkgdesc="${_pkgdesc[*]}"
+arch=('x86_64')
+license=('BSD')
+_github="https://github.com/ps2dev"
+_local="ssh://git@127.0.0.1:/home/git"
+url="${_github}/gcc"
+makedepends=("${target}-binutils"
+ "libgmp-static"
+ "mpfr-static"
+ "libmpc-static"
+ "gmp4-static"
+ "zstd-static")
+optdepends=()
+_branch="${_module}-${pkgver}"
+_commit="331453616ac96717cfef82d21c03573c8984f17d"
+source=("${pkgname}::git+${url}#commit=${_commit}")
+# source=("${pkgname}::git+${_local}/${_platform}-gcc#commit=${_branch}")
+sha256sums=('SKIP')
+
+_n_cpu="$(getconf _NPROCESSORS_ONLN)"
+_make_opts=(-j "${_n_cpu}")
+
+# shellcheck disable=SC2154
+build() {
+ local _target
+
+ CFLAGS=""
+ CXXFLAGS=""
+ CPPFLAGS=""
+ LDFLAGS=""
+ export CFLAGS
+ export CXXFLAGS
+ export CPPFLAGS
+ export LDFLAGS
+ export PATH="${PATH}:${_bu_bin}"
+ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib"
+
+ local _cflags=(-D_FORTIFY_SOURCE=0
+ -O2
+ -Wno-implicit-function-declaration
+ -I/usr/include
+ -L/usr/lib
+ # -ldl
+ -static)
+
+ local _ldflags=(-I/usr/include
+ # -rdynamic
+ -L/usr/lib
+ # -ldl
+ -Bstatic
+ -s)
+
+ local _libs=(-L/usr/lib)
+ # -ldl
+ # /usr/lib/libmpc.so
+ # /usr/lib/libmpfr.so
+ # /usr/lib/libgmp.so)
+
+ local _build_opts=(${_make_opts[@]}
+ CFLAGS="${_cflags[*]}"
+ CXXFLAGS="${_cflags[*]}"
+ CPPFLAGS="${_cflags[*]}"
+ LDFLAGS="${_ldflags[*]}"
+ LIBS="${_libs[*]}")
+
+ cd "${srcdir}/${pkgname}"
+
+ for _target in "mipsel-ps2-irx" "mipsel-ps2-elf"; do
+ _tbu_bin="${srcdir}/${_bu}-root/${_usr}/${_target}/bin"
+ export PATH="${PATH}:${_tbu_bin}"
+ rm -rf "build-${_target}"
+ mkdir -p "build-${_target}"
+ cd "build-${_target}"
+ local _configure_opts=(--prefix="/usr"
+ --target="${_target}"
+ --host=${CHOST}
+ --build=${CHOST}
+ --enable-languages="c"
+ --with-float=soft
+ --with-gmp
+ --with-mpfr
+ --with-mpc
+ --without-headers
+ --with-headers=no
+ --without-newlib
+ --without-cloog
+ --without-ppl
+ --disable-bootstrap
+ --disable-decimal-float
+ --disable-libada
+ --disable-libatomic
+ --disable-libffi
+ --disable-libgomp
+ --disable-libmudflap
+ --disable-libquadmath
+ --disable-libssp
+ --disable-libstdcxx-pch
+ --disable-multilib
+ --disable-shared
+ --disable-threads
+ --disable-target-libiberty
+ --disable-target-zlib
+ --disable-nls
+ --disable-tls)
+
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib" \
+ CC="/usr/bin/gcc" \
+ CXX="/usr/bin/g++" \
+ CFLAGS="${_cflags[*]}" \
+ CXXFLAGS="${_cxxflags[*]}" \
+ LDFLAGS="${_ldflags[*]}" \
+ LIBS="${_libs[*]}" \
+ "../configure" ${_configure_opts[@]}
+
+ LD_LIBRARY_PATH=/usr/lib \
+ CC="/usr/bin/gcc" \
+ CXX="/usr/bin/g++" \
+ CFLAGS="${_cflags[*]}" \
+ CXXFLAGS="${_cxxflags[*]}" \
+ LDFLAGS="${_ldflags[*]}" \
+ LIBS="${_libs[*]}" \
+ make "${_build_opts[@]}" all
+
+ cd ..
+ done
+}
+
+# shellcheck disable=SC2154
+package() {
+ local _target
+ cd "${srcdir}/${pkgname}"
+ for _target in "${target}"; do
+ cd "build-${_target}"
+ make DESTDIR="${pkgdir}" "${_make_opts[@]}" install-strip
+ cd ..
+ done
+}