feat(gnu-binutils): dynamic

* dynamic
* shell to toml recipe

Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
Anhad Singh 2024-12-27 03:05:08 +11:00
parent e4f0e28b57
commit a1c6409153
3 changed files with 64 additions and 47 deletions

View File

@ -0,0 +1,24 @@
diff '--color=auto' -ur source/gprofng/libcollector/configure.ac source-new/gprofng/libcollector/configure.ac
--- source/gprofng/libcollector/configure.ac 2024-08-17 09:00:00.000000000 +1000
+++ source-new/gprofng/libcollector/configure.ac 2024-12-04 15:59:58.407412951 +1100
@@ -18,7 +18,7 @@
m4_include([../../bfd/version.m4])
AC_INIT([gprofng], [BFD_VERSION])
-AC_CONFIG_MACRO_DIRS([../../config ../..])
+#AC_CONFIG_MACRO_DIRS([../../config ../..])
AC_CONFIG_AUX_DIR(../..)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
diff '--color=auto' -ur source/libiberty/configure.ac source-new/libiberty/configure.ac
--- source/libiberty/configure.ac 2024-08-17 09:00:00.000000000 +1000
+++ source-new/libiberty/configure.ac 2024-12-04 15:59:31.572203764 +1100
@@ -37,7 +37,7 @@
libiberty_topdir="${srcdir}/.."
fi
AC_SUBST(libiberty_topdir)
-AC_CONFIG_AUX_DIR($libiberty_topdir)
+AC_CONFIG_AUX_DIR([.])
dnl Very limited version of automake's enable-maintainer-mode

View File

@ -1,47 +0,0 @@
GIT=https://gitlab.redox-os.org/redox-os/binutils-gdb.git
BRANCH=redox-2.41
GIT_UPSTREAM=https://sourceware.org/git/binutils-gdb.git
BUILD_DEPENDS=(expat libgmp libmpfr)
function recipe_version {
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
skip=1
}
function recipe_build {
sysroot="$(realpath ../sysroot)"
mkdir -p "$sysroot/usr"
ln -sf "$sysroot/include" "$sysroot/usr/include"
ln -sf "$sysroot/lib" "$sysroot/usr/lib"
export CPPFLAGS="-I$sysroot/include -pie -fPIC -g"
export LDFLAGS="-L$sysroot/lib --static -g"
./configure \
--build=${BUILD} \
--host=${HOST} \
--target=${HOST} \
--prefix=/ \
--with-sysroot=/ \
--with-build-sysroot="$sysroot" \
--enable-gdb \
--with-expat \
--with-multilib \
--with-interwork \
--enable-targets="${TARGET}" \
--disable-lto \
--disable-nls \
--disable-werror
"$REDOX_MAKE" -j"$($NPROC)"
skip=1
}
function recipe_clean {
"$REDOX_MAKE" clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
"$REDOX_MAKE" DESTDIR="$dest" install
find "$dest/bin" -exec $STRIP {} ';' 2> /dev/null
skip=1
}

View File

@ -0,0 +1,40 @@
[source]
tar = "https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.xz"
patches = ["01_build_fix.patch"]
script = """
DYNAMIC_INIT
COOKBOOK_AUTORECONF=autoreconf2.69 autotools_recursive_regenerate -I"$(realpath ./config)"
cp -fpv ${COOKBOOK_HOST_SYSROOT}/share/libtool/build-aux/{config.sub,config.guess,install-sh} libiberty/
"""
[build]
template = "custom"
dependencies = [
"expat",
"libgmp",
"libmpfr",
"zlib",
]
script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE_FLAGS+=(
--target="${GNU_TARGET}"
--disable-werror
--disable-dependency-tracking
--disable-nls
--enable-colored-disassembly
--enable-gdb
--with-system-zlib
--with-multilib
--with-interwork
--with-pic
)
cookbook_configure
"""
[package]
dependencies = ["zlib"]