diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3235c94..6cddf41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + build-args: VARIANT=x64 tags: w64devkit:${{ env.ARCH }} load: true cache-from: type=gha,scope=w64devkit-${{ env.ARCH }} @@ -97,9 +98,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Apply x86 patch - run: patch -p1 -i src/variant-x86.patch - - name: Generate archive name and version string id: filename run: | @@ -112,6 +110,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + build-args: VARIANT=x86 tags: w64devkit:${{ env.ARCH }} load: true cache-from: type=gha,scope=w64devkit-${{ env.ARCH }} @@ -159,6 +158,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + build-args: VARIANT=x64 target: signed tags: w64devkit:x64-signed load: true @@ -175,13 +175,11 @@ jobs: > w64devkit-x64-${{ steps.filename.outputs.version }}.7z.exe ls -lh w64devkit-x64-${{ steps.filename.outputs.version }}.7z.exe - - name: Apply x86 patch - run: patch -p1 -i src/variant-x86.patch - - name: Build signed image (x86) uses: docker/build-push-action@v7 with: context: . + build-args: VARIANT=x86 target: signed tags: w64devkit:x86-signed load: true diff --git a/Dockerfile b/Dockerfile index caaf9fd..6006568 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG VERSION=2.9.1 \ PREFIX=/w64devkit +ARG VARIANT=x64 FROM debian:trixie-slim AS base ARG PREFIX @@ -207,9 +208,33 @@ RUN mkdir nsis \ # Build cross-compiler -FROM dl-cross AS cross -ARG ARCH=x86_64-w64-mingw32 -ENV ARCH=$ARCH +FROM dl-cross AS variant-x64 +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 dl-cross AS variant-x86 +ENV ARCH=i686-w64-mingw32 \ + GCC_ARCH_FLAG=--with-arch=pentium4 \ + GCC_MULTILIB=disable \ + CRT_LIB32=enable \ + CRT_LIB64=disable \ + GCC_MANIFEST_FLAG=--disable-win32-utf8-manifest \ + BUSYBOX_CONFIG=mingw32w_defconfig \ + ZSTD_THREAD_FLAG=HAVE_THREAD=0 \ + CMAKE_C_FLAGS="-O2 -D_WIN32_WINNT=0x0601" \ + CMAKE_CXX_FLAGS="-O2 -D_WIN32_WINNT=0x0601" \ + NSIS_ARCH=x86 + +FROM variant-${VARIANT} AS cross WORKDIR /dl/binutils COPY src/binutils-*.patch $PREFIX/src/ @@ -253,6 +278,8 @@ RUN cat $PREFIX/src/gcc-*.patch | patch -d/dl/gcc -p1 \ && /dl/gcc/configure \ --prefix=/bootstrap \ --with-sysroot=/bootstrap \ + $GCC_ARCH_FLAG \ + --${GCC_MULTILIB}-multilib \ --target=$ARCH \ --enable-static \ --disable-shared \ @@ -266,7 +293,6 @@ RUN cat $PREFIX/src/gcc-*.patch | patch -d/dl/gcc -p1 \ --disable-dependency-tracking \ --disable-nls \ --disable-lto \ - --disable-multilib \ CFLAGS_FOR_TARGET="-O2" \ CXXFLAGS_FOR_TARGET="-O2" \ LDFLAGS_FOR_TARGET="-s" \ @@ -285,7 +311,16 @@ RUN mkdir -p $PREFIX/lib \ && ln $PREFIX/lib/libmemory.a /bootstrap/lib/ \ && CC=$ARCH-gcc AR=$ARCH-ar DESTDIR=$PREFIX/lib/ \ sh $PREFIX/src/libchkstk.S \ - && ln $PREFIX/lib/libchkstk.a /bootstrap/lib/ + && ln $PREFIX/lib/libchkstk.a /bootstrap/lib/ \ + && 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 \ + && ln $PREFIX/lib32/libmemory.a /bootstrap/lib32/ \ + && CC="$ARCH-gcc -m32" AR=$ARCH-ar DESTDIR=$PREFIX/lib32/ \ + sh $PREFIX/src/libchkstk.S \ + && ln $PREFIX/lib32/libchkstk.a /bootstrap/lib32/ ; \ + fi WORKDIR /x-mingw-crt RUN /dl/mingw/mingw-w64-crt/configure \ @@ -294,8 +329,8 @@ RUN /dl/mingw/mingw-w64-crt/configure \ --host=$ARCH \ --with-default-msvcrt=msvcrt-os \ --disable-dependency-tracking \ - --disable-lib32 \ - --enable-lib64 \ + --${CRT_LIB32}-lib32 \ + --${CRT_LIB64}-lib64 \ CFLAGS="-O2" \ LDFLAGS="-s" \ && make -j$(nproc) \ @@ -313,6 +348,22 @@ RUN /dl/mingw/mingw-w64-libraries/winpthreads/configure \ && make -j$(nproc) \ && make install +WORKDIR /x-winpthreads32 +RUN if [ "$GCC_MULTILIB" = enable ]; then \ + /dl/mingw/mingw-w64-libraries/winpthreads/configure \ + --prefix=/bootstrap \ + --libdir=/bootstrap/lib32 \ + --with-sysroot=/bootstrap \ + --host=$ARCH \ + --enable-static \ + --disable-shared \ + CC="$ARCH-gcc -m32" \ + CFLAGS="-O2" \ + LDFLAGS="-s" \ + && make -j$(nproc) \ + && make install ; \ + fi + WORKDIR /x-gcc RUN make -j$(nproc) \ && make install @@ -331,7 +382,7 @@ RUN /dl/binutils/configure \ LDFLAGS="-s" \ && make MAKEINFO=true tooldir=$PREFIX -j$(nproc) \ && make MAKEINFO=true tooldir=$PREFIX install \ - && rm $PREFIX/bin/elfedit.exe $PREFIX/bin/readelf.exe + && rm $PREFIX/bin/dllwrap.exe $PREFIX/bin/elfedit.exe $PREFIX/bin/readelf.exe WORKDIR /gmp RUN /dl/gmp/configure \ @@ -398,8 +449,8 @@ RUN /dl/mingw/mingw-w64-crt/configure \ --host=$ARCH \ --with-default-msvcrt=msvcrt-os \ --disable-dependency-tracking \ - --disable-lib32 \ - --enable-lib64 \ + --${CRT_LIB32}-lib32 \ + --${CRT_LIB64}-lib64 \ CFLAGS="-O2" \ LDFLAGS="-s" \ && make -j$(nproc) \ @@ -409,7 +460,13 @@ COPY src/threads.c $PREFIX/src/ 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 + && $ARCH-ar r $PREFIX/lib/libmingwex.a threads.o \ + && 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 \ + && $ARCH-ar r $PREFIX/lib32/libmingwex.a threads32.o ; \ + fi WORKDIR /winpthreads RUN /dl/mingw/mingw-w64-libraries/winpthreads/configure \ @@ -423,6 +480,22 @@ RUN /dl/mingw/mingw-w64-libraries/winpthreads/configure \ && make -j$(nproc) \ && make install +WORKDIR /winpthreads32 +RUN if [ "$GCC_MULTILIB" = enable ]; then \ + /dl/mingw/mingw-w64-libraries/winpthreads/configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib32 \ + --with-sysroot=$PREFIX \ + --host=$ARCH \ + --enable-static \ + --disable-shared \ + CC="$ARCH-gcc -m32" \ + CFLAGS="-O2" \ + LDFLAGS="-s" \ + && make -j$(nproc) \ + && make install ; \ + fi + WORKDIR /gcc COPY src/crossgcc-*.patch $PREFIX/src/ RUN cat $PREFIX/src/crossgcc-*.patch | patch -d/dl/gcc -p1 \ @@ -430,6 +503,8 @@ RUN cat $PREFIX/src/crossgcc-*.patch | patch -d/dl/gcc -p1 \ --prefix=$PREFIX \ --with-sysroot=$PREFIX \ --with-native-system-header-dir=/include \ + $GCC_ARCH_FLAG \ + --${GCC_MULTILIB}-multilib \ --target=$ARCH \ --host=$ARCH \ --enable-static \ @@ -446,9 +521,9 @@ RUN cat $PREFIX/src/crossgcc-*.patch | patch -d/dl/gcc -p1 \ --disable-libstdcxx-verbose \ --disable-dependency-tracking \ --disable-lto \ - --disable-multilib \ --disable-nls \ --disable-win32-registry \ + $GCC_MANIFEST_FLAG \ --enable-mingw-wildcard \ CFLAGS_FOR_TARGET="-O2" \ CXXFLAGS_FOR_TARGET="-O2" \ @@ -475,7 +550,7 @@ RUN $ARCH-gcc -DEXE=gcc.exe -DCMD=cc \ && $ARCH-gcc -DEXE=gcc.exe -DCMD="cc -ansi" \ -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ -o $PREFIX/bin/c89.exe $PREFIX/src/alias.c -lkernel32 \ - && printf '%s\n' addr2line ar as c++filt cpp dlltool dllwrap g++ \ + && printf '%s\n' addr2line ar as c++filt cpp dlltool g++ \ gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool gendef gfortran \ ld nm objcopy objdump ranlib size strings strip uuidgen widl \ windmc windres \ @@ -485,6 +560,49 @@ RUN $ARCH-gcc -DEXE=gcc.exe -DCMD=cc \ -Wl,--gc-sections -s -nostdlib \ -o $PREFIX/bin/$ARCH-{}.exe $PREFIX/src/alias.c -lkernel32 +# Create i686 tool aliases +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 \ + | xargs -I{} -P$(nproc) \ + $ARCH-gcc -DEXE={}.exe -DCMD=i686-w64-mingw32-{} \ + -Oz -fno-asynchronous-unwind-tables \ + -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-{}.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && printf '%s\n' cpp gcc g++ gfortran \ + | xargs -I{} -P$(nproc) \ + $ARCH-gcc -DEXE={}.exe -DCMD="i686-w64-mingw32-{} -m32" \ + -Oz -fno-asynchronous-unwind-tables \ + -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-{}.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && $ARCH-gcc -DEXE=as.exe -DCMD="i686-w64-mingw32-as --32" \ + -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-as.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && $ARCH-gcc -DEXE=ld.exe -DCMD="i686-w64-mingw32-ld -m i386pe" \ + -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-ld.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && $ARCH-gcc -DEXE=dlltool.exe \ + -DCMD="i686-w64-mingw32-dlltool -m i386 --as-flags=--32" \ + -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-dlltool.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && $ARCH-gcc -DEXE=widl.exe \ + -DCMD="i686-w64-mingw32-widl --win32" \ + -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-widl.exe \ + $PREFIX/src/alias.c -lkernel32 \ + && $ARCH-gcc -DEXE=windres.exe \ + -DCMD="i686-w64-mingw32-windres --target=pe-i386" \ + -Oz -fno-asynchronous-unwind-tables -Wl,--gc-sections -s -nostdlib \ + -o $PREFIX/bin/i686-w64-mingw32-windres.exe \ + $PREFIX/src/alias.c -lkernel32 ; \ + fi + # Build some extra development tools FROM cross AS build-gendef @@ -598,7 +716,7 @@ COPY --from=dl-busybox /dl/ /dl/ WORKDIR /dl/busybox COPY src/busybox-* $PREFIX/src/ RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \ - && make mingw64u_defconfig \ + && make $BUSYBOX_CONFIG \ && sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \ && sed -ri 's/^(CONFIG_ASCII)=y/\1=n/' .config \ && sed -ri -e 's/^(CONFIG_BASH_IS_ASH)=y/\1=n/' \ @@ -693,7 +811,7 @@ RUN make -j$(nproc) CC=$ARCH-gcc AR=$ARCH-ar CFLAGS="-O2" libzstd.a \ WORKDIR /dl/zstd RUN make -j$(nproc) -C programs zstd \ - CC=$ARCH-gcc CFLAGS="-O2" LDFLAGS="-s" EXT=.exe \ + CC=$ARCH-gcc CFLAGS="-O2" LDFLAGS="-s" EXT=.exe $ZSTD_THREAD_FLAG \ && mkdir -p /out/bin \ && cp programs/zstd.exe /out/bin/ \ && $ARCH-gcc -DEXE=zstd.exe -DCMD=unzstd \ @@ -788,7 +906,9 @@ COPY --from=build-pdcurses /deps/include/curses.h /deps/include/ WORKDIR /cmake COPY src/cmake-*.patch $PREFIX/src/ RUN cat $PREFIX/src/cmake-*.patch | patch -d/dl/cmake -p1 \ - && cmake -DCMAKE_BUILD_TYPE=Release \ + && cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" \ + -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_C_COMPILER=$ARCH-gcc \ -DCMAKE_CXX_COMPILER=$ARCH-g++ \ @@ -853,7 +973,7 @@ RUN sed -i 's/\r$//' Source/build.cpp \ && cat $PREFIX/src/nsis-*.patch | patch -p1 \ && scons -j$(nproc) \ XGCC_W32_PREFIX=$ARCH- \ - TARGET_ARCH=amd64 \ + TARGET_ARCH=$NSIS_ARCH \ PREFIX=$PREFIX \ PREFIX_BIN=$PREFIX/share/nsis/bin \ PREFIX_DATA=$PREFIX/share/nsis \ diff --git a/README.md b/README.md index 00b2f22..6a02597 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,13 @@ 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 `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 . + +`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 PowerShell because it lacks file redirection. diff --git a/multibuild.sh b/multibuild.sh index 92ab732..b6c2de8 100755 --- a/multibuild.sh +++ b/multibuild.sh @@ -8,7 +8,7 @@ # $ ./multibuild.sh -as "$(git describe | tr v -)" set -e -arch= +variants= dryrun= suffix="$(git describe --exact-match 2>/dev/null | tr v - || true)" @@ -17,7 +17,7 @@ usage() { usage: multibuild.sh [-48ahn] [-s SUFFIX] -4 Enable x86 build -8 Enable x64 build - -a All architectures + -a All variants -h Print this help message -n Dry run, print commands but do nothing -s SUFFIX Append a version suffix (default: auto from git tag) @@ -26,9 +26,9 @@ EOF while getopts 48ahns: opt; do case $opt in - 4) arch="$arch x86";; - 8) arch="$arch x64";; - a) arch="x64 x86";; + 4) variants="$variants x86";; + 8) variants="$variants x64";; + a) variants="x64 x86";; h) usage; exit 0;; n) dryrun=echo;; s) suffix="$OPTARG";; @@ -43,25 +43,15 @@ if [ $# -gt 0 ]; then exit 1 fi -: ${arch:=x64} -tmp= +: ${variants:=x64} target="tmp-w64-$$" cleanup() { - rm -rf -- "$tmp" $dryrun docker rmi --no-prune $target 2>/dev/null || true } trap cleanup EXIT -for variant in $arch; do - if [ -e "src/variant-$variant.patch" ]; then - tmp=$(mktemp -d) - $dryrun cp Dockerfile "$tmp/" - $dryrun patch "$tmp/Dockerfile" "src/variant-$variant.patch" - $dryrun docker build -f "$tmp/Dockerfile" -t $target . - rm -rf -- "$tmp" - else - $dryrun docker build -t $target . - fi +for variant in $variants; do + $dryrun docker build --build-arg VARIANT=$variant -t $target . out="w64devkit-$variant$suffix.7z.exe" if [ -n "$dryrun" ]; then $dryrun docker run --rm $target ">$out" diff --git a/src/crossgcc-i686-dumpmachine.patch b/src/crossgcc-i686-dumpmachine.patch new file mode 100644 index 0000000..3669a7e --- /dev/null +++ b/src/crossgcc-i686-dumpmachine.patch @@ -0,0 +1,23 @@ +Report the emulated i686 target from i686 driver aliases + +The multilib compiler is configured for x86_64, so -m32 does not change +-dumpmachine. The i686 aliases present themselves as target-prefixed +compilers, and target-detecting build systems expect that prefix and +-dumpmachine to agree. Preserve normal multilib behavior for every other +invocation name. +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -4249,6 +4249,13 @@ driver_handle_option (struct gcc_options *opts, + exit (0); + + case OPT_dumpmachine: ++#ifdef __MINGW32__ ++ if (startswith (progname, "i686-w64-mingw32-")) ++ { ++ printf ("i686-w64-mingw32\n"); ++ exit (0); ++ } ++#endif + printf ("%s\n", spec_machine); + exit (0); + diff --git a/src/mingw-default-win32-winnt.patch b/src/mingw-default-win32-winnt.patch new file mode 100644 index 0000000..eb75943 --- /dev/null +++ b/src/mingw-default-win32-winnt.patch @@ -0,0 +1,19 @@ +headers: default 32-bit x86 to Windows XP + +The x86_64 multilib toolchain shares one header tree between its 64-bit +and 32-bit targets. Keep the configured mingw-w64 default for x86_64 and +other architectures, but preserve w64devkit's Windows XP default when +the compiler targets i686. An explicit user definition still takes +precedence through the existing outer guard. + +--- a/mingw-w64-headers/crt/_mingw.h.in ++++ b/mingw-w64-headers/crt/_mingw.h.in +@@ -255,3 +255,7 @@ + #ifndef _WIN32_WINNT +-#define _WIN32_WINNT @DEFAULT_WIN32_WINNT@ ++# if defined(__i386__) ++# define _WIN32_WINNT 0x0501 ++# else ++# define _WIN32_WINNT @DEFAULT_WIN32_WINNT@ ++# endif + #endif diff --git a/src/variant-x86.patch b/src/variant-x86.patch deleted file mode 100644 index 1621c7f..0000000 --- a/src/variant-x86.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- a/Dockerfile -+++ b/Dockerfile -@@ -229,3 +229,3 @@ - FROM dl-cross AS cross --ARG ARCH=x86_64-w64-mingw32 -+ARG ARCH=i686-w64-mingw32 - ENV ARCH=$ARCH -@@ -260,2 +260,3 @@ - --with-default-msvcrt=msvcrt-os \ -+ --with-default-win32-winnt=0x0501 \ - && make -j$(nproc) \ -@@ -272,2 +273,3 @@ - --with-sysroot=/bootstrap \ -+ --with-arch=pentium4 \ - --target=$ARCH \ -@@ -313,4 +315,4 @@ - --disable-dependency-tracking \ -- --disable-lib32 \ -- --enable-lib64 \ -+ --enable-lib32 \ -+ --disable-lib64 \ - CFLAGS="-O2" \ -@@ -399,2 +401,3 @@ - --with-default-msvcrt=msvcrt-os \ -+ --with-default-win32-winnt=0x0501 \ - && make -j$(nproc) \ -@@ -409,4 +412,4 @@ - --disable-dependency-tracking \ -- --disable-lib32 \ -- --enable-lib64 \ -+ --enable-lib32 \ -+ --disable-lib64 \ - CFLAGS="-O2" \ -@@ -437,2 +440,3 @@ - --with-native-system-header-dir=/include \ -+ --with-arch=pentium4 \ - --target=$ARCH \ -@@ -456,2 +460,3 @@ - --disable-win32-registry \ -+ --disable-win32-utf8-manifest \ - --enable-mingw-wildcard \ -@@ -605,3 +610,3 @@ - RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \ -- && make mingw64u_defconfig \ -+ && make mingw32w_defconfig \ - && sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \ -@@ -699,3 +704,3 @@ - RUN make -j$(nproc) -C programs zstd \ -- CC=$ARCH-gcc CFLAGS="-O2" LDFLAGS="-s" EXT=.exe \ -+ CC=$ARCH-gcc CFLAGS="-O2" LDFLAGS="-s" EXT=.exe HAVE_THREAD=0 \ - && mkdir -p /out/bin \ -@@ -798,2 +803,4 @@ - -DCMAKE_EXE_LINKER_FLAGS="-s" \ -+ -DCMAKE_C_FLAGS="-O2 -D_WIN32_WINNT=0x0601" \ -+ -DCMAKE_CXX_FLAGS="-O2 -D_WIN32_WINNT=0x0601" \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ -@@ -840,3 +847,3 @@ - XGCC_W32_PREFIX=$ARCH- \ -- TARGET_ARCH=amd64 \ -+ TARGET_ARCH=x86 \ - PREFIX=$PREFIX \