From 008160036d323b467c439635a189a0dcbeea04cb Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Mon, 2 Dec 2024 22:21:45 +1100 Subject: [PATCH 1/4] feat(prefix): libtool Signed-off-by: Anhad Singh --- mk/prefix.mk | 59 ++++++++++++++++++++++++++++++--- mk/repo.mk | 4 +++ podman/redox-base-containerfile | 5 ++- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/mk/prefix.mk b/mk/prefix.mk index 87ab8be..3bf9b10 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -1,12 +1,13 @@ -# Configuration file for the Rust/GCC cross-compilers and relibc +# Configuration file for the Rust/GCC cross-compilers, relibc and libtool PREFIX=prefix/$(TARGET) -PREFIX_INSTALL=$(PREFIX)/relibc-install +PREFIX_INSTALL=$(PREFIX)/sysroot/ PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin BINUTILS_BRANCH=redox-2.43.1 GCC_BRANCH=redox-13.2.0 +LIBTOOL_VERSION=2.5.4 export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL) @@ -21,7 +22,11 @@ else GCC_ARCH?= endif -prefix: $(PREFIX_INSTALL) +# TODO(andypython): Upstream libtool patches to remove the need to locally build libtool. +# Cannot be CI built, i.e. be a part of relibc-install.tar.gz, as the prefix has to be correctly +# set while building. Otherwise aclocal will not be able to find libtool's files. Furthermore, doing +# so would break non-podman builds (not sure if they are still supported though). +prefix: $(PREFIX)/sysroot PREFIX_STRIP=\ mkdir -p bin libexec "$(GCC_TARGET)/bin" && \ @@ -65,6 +70,51 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install --directory="$<" \ . +$(PREFIX)/libtool: + rm -rf "$@.partial" "$@" + mkdir -p "$@.partial" + + git clone \ + --recurse-submodules \ + "https://gitlab.redox-os.org/andypython/libtool/" \ + --branch "v$(LIBTOOL_VERSION)-redox" \ + --depth 1 \ + "$@.partial" + + touch "$@.partial" + mv "$@.partial" "$@" + +$(PREFIX)/libtool-build: $(PREFIX)/libtool $(CONTAINER_TAG) +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) $(MAKE) $@ +else + mkdir -p "$@.partial" + cd "$(PREFIX)/libtool" && \ + ./bootstrap \ + --skip-po \ + --skip-git \ + --force \ + --gnulib-srcdir=./gnulib + cd "$@.partial" && \ + "$(ROOT)/$ Date: Fri, 6 Dec 2024 22:12:29 +1100 Subject: [PATCH 2/4] fix(ci): install help2man Signed-off-by: Anhad Singh --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4734b0f..3f6e0f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ before_script: pkg-config \ texinfo \ wget \ + help2man \ zstd && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none From d03fce3a5a3ac5d205521b6c39645ae83ff5c08f Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Fri, 6 Dec 2024 23:12:48 +1100 Subject: [PATCH 3/4] fix(ci): autoconf and automake Signed-off-by: Anhad Singh --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f6e0f1..75d4b0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,8 @@ before_script: texinfo \ wget \ help2man \ + autoconf \ + automake \ zstd && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none From 6450defff05ce2993dc67c9718b1ae572ae6c1c0 Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Thu, 12 Dec 2024 00:13:27 +1100 Subject: [PATCH 4/4] fix(repo.mk): set `COOKBOOK_HOST_SYSROOT` Signed-off-by: Anhad Singh --- mk/repo.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/repo.mk b/mk/repo.mk index 07b9c9d..16c0112 100644 --- a/mk/repo.mk +++ b/mk/repo.mk @@ -5,6 +5,7 @@ ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) $(MAKE) $@ else PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) -c $(FILESYSTEM_CONFIG))" && \ + export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \ cd cookbook && \ ./fetch.sh "$${PACKAGES}" mkdir -p $(BUILD) @@ -16,6 +17,7 @@ ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) $(MAKE) $@ else export PATH="$(PREFIX_PATH):$$PATH" && \ + export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \ PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) -c $(FILESYSTEM_CONFIG))" && \ cd cookbook && \ ./repo.sh $(REPO_NONSTOP) "$${PACKAGES}"