Skip to content

Commit baaab87

Browse files
committed
wipwipwip
1 parent c3c70a4 commit baaab87

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.docker/Dockerfile.alpine

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ RUN qemu_pkgs=""; \
3838
bison \
3939
flex \
4040
ronn \
41+
perf \
42+
py3-pip \
4143
fuse \
4244
fuse3 \
4345
pkgconf \
@@ -103,8 +105,6 @@ RUN if ! [ "$ARCH" == "amd64" ] || [ "$ARCH" == "arm64v8" ]; then \
103105
echo "See https://github.com/upx/upx/discussions/793 for details."; \
104106
fi
105107

106-
# TODO: move up
107-
RUN apk add --no-cache py3-pip
108108
RUN pip3 install --break-system-packages --root-user-action ignore mistletoe
109109

110110
# Set up git & user

.docker/install-toolchain.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ GCC_TARBALL=gcc-${GCC_VERSION}.tar.xz
1616
MUSL_TARBALL=musl-${MUSL_VERSION}.tar.gz
1717
LINUX_TARBALL=linux-${LINUX_VERSION}.tar.xz
1818

19-
export PATH="/usr/lib/ccache/bin:$PATH"
20-
2119
cd "$HOME"
2220
mkdir pkgs
2321
cd pkgs
@@ -78,6 +76,9 @@ fetch.sh https://gcc.gnu.org/pipermail/gcc-patches/attachments/20250220/c6211b02
7876

7977
ORIGPATH="$PATH"
8078

79+
export CC="/usr/bin/ccache /usr/bin/gcc"
80+
export CXX="/usr/bin/ccache /usr/bin/g++"
81+
8182
for target_arch in ${TARGET_ARCH_STR//,/ }; do
8283
for OPT in ${OPTIMIZE_STR//,/ }; do
8384
echo "==========================================================="
@@ -112,13 +113,13 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
112113
;;
113114
esac
114115

115-
CFLAGS="-O${OPT} -ffunction-sections -fdata-sections -fmerge-all-constants -fPIC"
116-
CXXFLAGS="-O${OPT} -ffunction-sections -fdata-sections -fmerge-all-constants -fPIC"
117-
LDFLAGS="-Wl,--gc-sections"
116+
export CFLAGS="-O${OPT} -ffunction-sections -fdata-sections -fmerge-all-constants -fPIC"
117+
export CXXFLAGS="$CFLAGS"
118+
export LDFLAGS="-Wl,--gc-sections"
118119

119120
SYSROOT="/opt/cross/O${OPT}"
120121
PREFIX="$SYSROOT/usr"
121-
PATH="$ORIGPATH:$PREFIX/bin"
122+
PATH="$PREFIX/bin:$ORIGPATH"
122123

123124
GCC_NODOCS="MAKEINFO=/bin/true gcc_cv_prog_makeinfo_modern=no HELP2MAN=/bin/true TEXI2POD=/bin/true POD2MAN=/bin/true"
124125

@@ -163,13 +164,20 @@ for target_arch in ${TARGET_ARCH_STR//,/ }; do
163164
make install
164165
cp libssp_nonshared.a $PREFIX/$TARGET/lib/
165166

167+
if [[ "$TARGETARCH" == "$ARCH" ]]; then
168+
# Fix for aarch64 build: rsync musl headers to native sysroot
169+
rsync -av $PREFIX/$TARGET/include/ $PREFIX/include/
170+
rsync -av $PREFIX/$TARGET/lib/ $PREFIX/lib/
171+
fi
172+
166173
# Stage 2
167174
cd "$HOME"/pkgs
168175
mkdir gcc-${GCC_VERSION}-build-${TARGETARCH}-O${OPT}-final
169176
cd gcc-${GCC_VERSION}-build-${TARGETARCH}-O${OPT}-final
170177

171178
"$HOME"/pkgs/gcc-${GCC_VERSION}/configure \
172179
--target=$TARGET --prefix=$PREFIX --with-sysroot=$SYSROOT ${GCC_CONFIGURE_ARGS} \
180+
--with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr \
173181
--disable-shared --enable-tls --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers \
174182
--enable-threads --enable-__cxa_atexit --enable-languages=c,c++ --enable-link-serialization=2 --enable-linker-build-id \
175183
--enable-libssp --disable-libsanitizer --with-system-zlib --enable-checking=release --disable-cet --disable-fixed-point \

0 commit comments

Comments
 (0)