Make windres output in res format instead of in coff

This makes the output architecture independent, allowing
the x86_64 GNU binutils binary to be used for other
architectures as well, including arm/arm64 which aren't supported
by binutils.
This commit is contained in:
Martin Storsjö committed 2018-01-10 10:53:02 +02:00
1 parent 41985ce12e
commit 583baaa612
4 files changed
+14 -3

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ RUN ./install-wrappers.sh $TOOLCHAIN_PREFIX
# llvm-rc isn't fully usable as a replacement for windres yet. # llvm-rc isn't fully usable as a replacement for windres yet.
RUN apt-get update -qq && \ RUN apt-get update -qq && \
apt-get install -qqy binutils-mingw-w64-x86-64 && \ apt-get install -qqy binutils-mingw-w64-x86-64 && \
cp /usr/bin/x86_64-w64-mingw32-windres $TOOLCHAIN_PREFIX/bin && \ cp /usr/bin/x86_64-w64-mingw32-windres $TOOLCHAIN_PREFIX/bin/x86_64-w64-mingw32-windresreal && \
apt-get remove -qqy binutils-mingw-w64-x86-64 && \ apt-get remove -qqy binutils-mingw-w64-x86-64 && \
cd $TOOLCHAIN_PREFIX/bin cd $TOOLCHAIN_PREFIX/bin
+8
View File
@@ -48,6 +48,14 @@ a different version) - and likewise, if configure flags in the build-*.sh
scripts have changed, you might need to wipe the build directory under scripts have changed, you might need to wipe the build directory under
each project for the new configure options to be taken into use. each project for the new configure options to be taken into use.
If building without the dockerfile, manually install a copy of normal
GNU binutils windres with the name `x86_64-w64-mingw32-windresreal`.
Wrappers named `<triplet>-windres` are installed that call this binary
with the necessary options to make it output in the arch independent
res format, allowing using it for all architectures, even those that
GNU binutils don't support. (LLVM does provide a similar tool, llvm-rc,
but it's not yet ready to actually replace windres in all cases.)
Status Status
+2 -2
View File
@@ -11,7 +11,7 @@ PREFIX="$1"
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}} : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
mkdir -p $PREFIX/bin mkdir -p $PREFIX/bin
cp wrappers/clang-target-wrapper.sh wrappers/objdump-wrapper.sh wrappers/ld-wrapper.sh $PREFIX/bin cp wrappers/clang-target-wrapper.sh wrappers/objdump-wrapper.sh wrappers/ld-wrapper.sh wrappers/windres-wrapper.sh $PREFIX/bin
cd $PREFIX/bin cd $PREFIX/bin
for arch in $ARCHS; do for arch in $ARCHS; do
for exec in clang clang++ gcc g++; do for exec in clang clang++ gcc g++; do
@@ -23,7 +23,7 @@ for arch in $ARCHS; do
for exec in strip; do for exec in strip; do
ln -sf /bin/true $arch-w64-mingw32-$exec ln -sf /bin/true $arch-w64-mingw32-$exec
done done
for exec in ld objdump; do for exec in ld objdump windres; do
ln -sf $exec-wrapper.sh $arch-w64-mingw32-$exec ln -sf $exec-wrapper.sh $arch-w64-mingw32-$exec
done done
done done
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
set -e
x86_64-w64-mingw32-windresreal "$@" --output-format res