mirror of
https://github.com/skeeto/w64devkit.git
synced 2026-10-23 06:08:56 +03:00
Merge multilib support into x64 variant
This commit is contained in:
committed by
Christopher Wellons
parent
e293462e2b
commit
f7ba9d67da
67
.github/workflows/build.yml
vendored
67
.github/workflows/build.yml
vendored
@@ -129,52 +129,8 @@ jobs:
|
||||
path: ${{ steps.filename.outputs.archive }}.7z.exe
|
||||
archive: false
|
||||
|
||||
build-multilib:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-x64
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
env:
|
||||
ARCH: multilib
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Generate archive name and version string
|
||||
id: filename
|
||||
run: |
|
||||
GIT_VERSION="$(git describe --tags --always)"
|
||||
VERSION="${GIT_VERSION#v}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "archive=w64devkit-$ARCH-$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
build-args: VARIANT=multilib
|
||||
tags: w64devkit:${{ env.ARCH }}
|
||||
load: true
|
||||
cache-from: type=gha,scope=w64devkit-${{ env.ARCH }}
|
||||
cache-to: type=gha,scope=w64devkit-${{ env.ARCH }},mode=max,ignore-error=true
|
||||
|
||||
- name: Extract artifact
|
||||
run: |
|
||||
docker run --rm w64devkit:${{ env.ARCH }} > w64devkit.exe
|
||||
mv w64devkit.exe ${{ steps.filename.outputs.archive }}.7z.exe
|
||||
ls -lh ${{ steps.filename.outputs.archive }}.7z.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ steps.filename.outputs.archive }}.7z.exe
|
||||
path: ${{ steps.filename.outputs.archive }}.7z.exe
|
||||
archive: false
|
||||
|
||||
release:
|
||||
needs: [build-x64, build-x86, build-multilib]
|
||||
needs: [build-x64, build-x86]
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
environment: release
|
||||
@@ -240,27 +196,6 @@ jobs:
|
||||
> w64devkit-x86-${{ steps.filename.outputs.version }}.7z.exe
|
||||
ls -lh w64devkit-x86-${{ steps.filename.outputs.version }}.7z.exe
|
||||
|
||||
- name: Build signed image (multilib)
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
build-args: VARIANT=multilib
|
||||
target: signed
|
||||
tags: w64devkit:multilib-signed
|
||||
load: true
|
||||
cache-from: type=gha,scope=w64devkit-multilib
|
||||
cache-to: type=gha,scope=w64devkit-multilib,mode=max,ignore-error=true
|
||||
|
||||
- name: Sign and pack (multilib)
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e AZURE_CLIENT_ID -e AZURE_TENANT_ID \
|
||||
-e AAS_SIGN_ENDPOINT -e AAS_SIGN_ACCOUNT -e AAS_SIGN_PROFILE \
|
||||
-e ACTIONS_ID_TOKEN_REQUEST_URL -e ACTIONS_ID_TOKEN_REQUEST_TOKEN \
|
||||
w64devkit:multilib-signed \
|
||||
> w64devkit-multilib-${{ steps.filename.outputs.version }}.7z.exe
|
||||
ls -lh w64devkit-multilib-${{ steps.filename.outputs.version }}.7z.exe
|
||||
|
||||
- name: Download source tarball
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
|
||||
30
Dockerfile
30
Dockerfile
@@ -210,9 +210,9 @@ RUN mkdir nsis \
|
||||
|
||||
FROM dl-cross AS variant-x64
|
||||
ENV ARCH=x86_64-w64-mingw32 \
|
||||
GCC_ARCH_FLAG="" \
|
||||
GCC_MULTILIB=disable \
|
||||
CRT_LIB32=disable \
|
||||
GCC_ARCH_FLAG=--with-arch-32=pentium4 \
|
||||
GCC_MULTILIB=enable \
|
||||
CRT_LIB32=enable \
|
||||
CRT_LIB64=enable \
|
||||
GCC_MANIFEST_FLAG="" \
|
||||
BUSYBOX_CONFIG=mingw64u_defconfig \
|
||||
@@ -234,21 +234,7 @@ ENV ARCH=i686-w64-mingw32 \
|
||||
CMAKE_CXX_FLAGS="-O2 -D_WIN32_WINNT=0x0601" \
|
||||
NSIS_ARCH=x86
|
||||
|
||||
FROM dl-cross AS variant-multilib
|
||||
ENV ARCH=x86_64-w64-mingw32 \
|
||||
GCC_ARCH_FLAG=--with-arch-32=pentium4 \
|
||||
GCC_MULTILIB=enable \
|
||||
CRT_LIB32=enable \
|
||||
CRT_LIB64=enable \
|
||||
GCC_MANIFEST_FLAG="" \
|
||||
BUSYBOX_CONFIG=mingw64u_defconfig \
|
||||
ZSTD_THREAD_FLAG="" \
|
||||
CMAKE_C_FLAGS="" \
|
||||
CMAKE_CXX_FLAGS="" \
|
||||
NSIS_ARCH=amd64
|
||||
|
||||
FROM variant-${VARIANT} AS cross
|
||||
ARG VARIANT
|
||||
|
||||
WORKDIR /dl/binutils
|
||||
COPY src/binutils-*.patch $PREFIX/src/
|
||||
@@ -326,7 +312,7 @@ RUN mkdir -p $PREFIX/lib \
|
||||
&& CC=$ARCH-gcc AR=$ARCH-ar DESTDIR=$PREFIX/lib/ \
|
||||
sh $PREFIX/src/libchkstk.S \
|
||||
&& ln $PREFIX/lib/libchkstk.a /bootstrap/lib/ \
|
||||
&& if [ "$VARIANT" = multilib ]; then \
|
||||
&& if [ "$GCC_MULTILIB" = enable ]; then \
|
||||
mkdir -p $PREFIX/lib32 /bootstrap/lib32 \
|
||||
&& CC="$ARCH-gcc -m32" AR=$ARCH-ar DESTDIR=$PREFIX/lib32/ \
|
||||
sh $PREFIX/src/libmemory.c \
|
||||
@@ -363,7 +349,7 @@ RUN /dl/mingw/mingw-w64-libraries/winpthreads/configure \
|
||||
&& make install
|
||||
|
||||
WORKDIR /x-winpthreads32
|
||||
RUN if [ "$VARIANT" = multilib ]; then \
|
||||
RUN if [ "$GCC_MULTILIB" = enable ]; then \
|
||||
/dl/mingw/mingw-w64-libraries/winpthreads/configure \
|
||||
--prefix=/bootstrap \
|
||||
--libdir=/bootstrap/lib32 \
|
||||
@@ -475,7 +461,7 @@ COPY src/threads.h $PREFIX/include/
|
||||
RUN $ARCH-gcc -c -Oz -I$PREFIX/include/ \
|
||||
-ffunction-sections -Wa,--no-pad-sections $PREFIX/src/threads.c \
|
||||
&& $ARCH-ar r $PREFIX/lib/libmingwex.a threads.o \
|
||||
&& if [ "$VARIANT" = multilib ]; then \
|
||||
&& if [ "$GCC_MULTILIB" = enable ]; then \
|
||||
$ARCH-gcc -m32 -c -Oz -I$PREFIX/include/ \
|
||||
-ffunction-sections -Wa,--no-pad-sections \
|
||||
-o threads32.o $PREFIX/src/threads.c \
|
||||
@@ -495,7 +481,7 @@ RUN /dl/mingw/mingw-w64-libraries/winpthreads/configure \
|
||||
&& make install
|
||||
|
||||
WORKDIR /winpthreads32
|
||||
RUN if [ "$VARIANT" = multilib ]; then \
|
||||
RUN if [ "$GCC_MULTILIB" = enable ]; then \
|
||||
/dl/mingw/mingw-w64-libraries/winpthreads/configure \
|
||||
--prefix=$PREFIX \
|
||||
--libdir=$PREFIX/lib32 \
|
||||
@@ -575,7 +561,7 @@ RUN $ARCH-gcc -DEXE=gcc.exe -DCMD=cc \
|
||||
-o $PREFIX/bin/$ARCH-{}.exe $PREFIX/src/alias.c -lkernel32
|
||||
|
||||
# Create i686 tool aliases
|
||||
RUN if [ "$VARIANT" = multilib ]; then \
|
||||
RUN if [ "$GCC_MULTILIB" = enable ]; then \
|
||||
printf '%s\n' addr2line ar c++filt gcc-ar gcc-nm gcc-ranlib gcov \
|
||||
gcov-dump gcov-tool gendef nm objcopy objdump ranlib size strings \
|
||||
strip uuidgen windmc \
|
||||
|
||||
@@ -31,13 +31,12 @@ Build the image, then run it to produce a self-extracting 7z archive:
|
||||
docker build -t w64devkit .
|
||||
docker run --rm w64devkit >w64devkit-x64.exe
|
||||
|
||||
The default variant is `x64`. Select a standalone x86 or combined multilib
|
||||
toolchain with a build argument:
|
||||
The default `x64` variant is a combined x64/x86 multilib toolchain. Select a
|
||||
standalone x86 toolchain with a build argument:
|
||||
|
||||
docker build --build-arg VARIANT=x86 -t w64devkit .
|
||||
docker build --build-arg VARIANT=multilib -t w64devkit .
|
||||
|
||||
`multibuild.sh -a` builds all three variants.
|
||||
`multibuild.sh -a` builds both variants.
|
||||
|
||||
This takes about 15 minutes on modern systems. You will need an internet
|
||||
connection during the first few minutes of the build. **Note:** Do not use
|
||||
|
||||
@@ -14,23 +14,21 @@ suffix="$(git describe --exact-match 2>/dev/null | tr v - || true)"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
usage: multibuild.sh [-48ahmn] [-s SUFFIX]
|
||||
usage: multibuild.sh [-48ahn] [-s SUFFIX]
|
||||
-4 Enable x86 build
|
||||
-8 Enable x64 build
|
||||
-a All variants
|
||||
-m Enable multilib build
|
||||
-h Print this help message
|
||||
-n Dry run, print commands but do nothing
|
||||
-s SUFFIX Append a version suffix (default: auto from git tag)
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts 48ahmns: opt; do
|
||||
while getopts 48ahns: opt; do
|
||||
case $opt in
|
||||
4) variants="$variants x86";;
|
||||
8) variants="$variants x64";;
|
||||
a) variants="x64 x86 multilib";;
|
||||
m) variants="$variants multilib";;
|
||||
a) variants="x64 x86";;
|
||||
h) usage; exit 0;;
|
||||
n) dryrun=echo;;
|
||||
s) suffix="$OPTARG";;
|
||||
|
||||
Reference in New Issue
Block a user