diff --git a/build-binutils.sh b/build-binutils.sh index 1fb4090..95b2dec 100755 --- a/build-binutils.sh +++ b/build-binutils.sh @@ -60,13 +60,11 @@ cd build mkdir -p "$dist_dir" -# NOTE: We don't want to require `libexpat` to be dynamically linked. -# It turns out to be quite hard to statically link *only* `libexpat`. ../configure \ - --target "$target" \ + --target="$target" \ --program-prefix="$target-" \ - --prefix "$dist_dir" \ - --with-expat=no + --prefix="$dist_dir" \ + --with-libexpat-type=static make -j "$(nproc)" make install diff --git a/local-run-in-container.sh b/local-run-in-container.sh index be9f92d..c126a4a 100755 --- a/local-run-in-container.sh +++ b/local-run-in-container.sh @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -IMAGE=lowrisc/lowrisc-base-centos6:latest +IMAGE=quay.io/pypa/manylinux_2_28_x86_64 exec docker run -t -i \ -v $(pwd):/home/dev/src \ diff --git a/patches/binutils/001-bfd-elf.patch b/patches/binutils/001-bfd-elf.patch new file mode 100644 index 0000000..752f906 --- /dev/null +++ b/patches/binutils/001-bfd-elf.patch @@ -0,0 +1,19 @@ +diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h +index 15767245..d7662e0f 100644 +--- a/bfd/elf-bfd.h ++++ b/bfd/elf-bfd.h +@@ -3066,7 +3066,13 @@ static inline bfd_boolean + bfd_section_is_ctf (const asection *sec) + { + const char *name = bfd_section_name (sec); +- return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.'); ++ ++ return ( ++ name[0] == '.' ++ && name[1] == 'c' ++ && name[2] == 't' ++ && name[3] == 'f' ++ && (name[4] == 0 || name[4] == '.')); + } + + #ifdef __cplusplus diff --git a/prepare-host.sh b/prepare-host.sh index 04af077..048f365 100755 --- a/prepare-host.sh +++ b/prepare-host.sh @@ -9,6 +9,9 @@ set -x # Repository for the `gh` GitHub CLI tool used for creating releases. dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo +# Repository for expat-static +dnf install -y almalinux-release-devel + dnf install -y \ sudo \ gh \ @@ -27,4 +30,5 @@ dnf install -y \ python36 \ zlib-devel \ zlib-static \ - libffi-devel + libffi-devel \ + expat-static