Build binutils for Windows too so that we can get addr2line.exe.
authorCarl Hetherington <cth@carlh.net>
Mon, 1 Dec 2014 15:49:47 +0000 (15:49 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 1 Dec 2014 15:49:47 +0000 (15:49 +0000)
build_all
build_binutils.sh [deleted file]
build_binutils_linux.sh [new file with mode: 0644]
build_binutils_windows.sh [new file with mode: 0644]
clean

index 384e75d..708d868 100755 (executable)
--- a/build_all
+++ b/build_all
@@ -7,20 +7,22 @@ export MINGW_GCC_VERSION=4.7.3
 export MINGW_PREFIX=/opt/mingw/32
 export MINGW_TARGET=i686-w64-mingw32
 
-bash build_binutils.sh
+bash build_binutils_linux.sh
 bash build_mingw_headers.sh
 bash build_gcc_core.sh
 bash build_mingw_runtime.sh
 bash build_gcc_rest.sh
 bash build_gdb.sh
+bash build_binutils_windows.sh
 
 export MINGW_PREFIX=/opt/mingw/64
 export MINGW_TARGET=x86_64-w64-mingw32
 
-bash build_binutils.sh
+bash build_binutils_linux.sh
 bash build_mingw_headers.sh
 bash build_gcc_core.sh
 bash build_mingw_runtime.sh
 bash build_gcc_rest.sh
 bash build_gdb.sh
+bash build_binutils_windows.sh
 
diff --git a/build_binutils.sh b/build_binutils.sh
deleted file mode 100644 (file)
index ab3a862..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash -e
-
-tar xjf Archives/binutils-2.23.2.tar.bz2
-cd binutils-2.23.2
-sed -i -e 's/@colophon/@@colophon/' \
-       -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo
-cd ..
-mkdir -p binutils-build-$MINGW_TARGET
-cd binutils-build-$MINGW_TARGET
-../binutils-2.23.2/configure --with-sysroot=$MINGW_PREFIX --prefix=$MINGW_PREFIX --disable-multilib -target=$MINGW_TARGET --enable-targets=$MINGW_TARGET 
-make $MINGW_PARALLEL
-sudo make install
-
diff --git a/build_binutils_linux.sh b/build_binutils_linux.sh
new file mode 100644 (file)
index 0000000..f97bb71
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash -e
+#
+# Build binutils running on Linux and targeting Windows.
+
+tar xjf Archives/binutils-2.23.2.tar.bz2
+cd binutils-2.23.2
+sed -i -e 's/@colophon/@@colophon/' \
+       -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo
+cd ..
+mkdir -p binutils-build-$MINGW_TARGET
+cd binutils-build-$MINGW_TARGET
+../binutils-2.23.2/configure --with-sysroot=$MINGW_PREFIX --prefix=$MINGW_PREFIX --disable-multilib -target=$MINGW_TARGET --enable-targets=$MINGW_TARGET 
+make $MINGW_PARALLEL
+sudo make install
+
diff --git a/build_binutils_windows.sh b/build_binutils_windows.sh
new file mode 100644 (file)
index 0000000..a0b9a30
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash -e
+#
+# Build binutils running on Windows and targeting Windows.
+# At the moment this is just for addr2line.exe
+
+tar xzf Archives/binutils-2.24.tar.gz
+mkdir -p binutils-windows-build-$MINGW_TARGET
+cd binutils-windows-build-$MINGW_TARGET
+PATH=$MINGW_PREFIX/bin:$PATH ../binutils-2.24/configure --with-sysroot=$MINGW_PREFIX --prefix=/tmp/frobozz --disable-multilib \
+  --host=$MINGW_TARGET --target=$MINGW_TARGET --enable-targets=$MINGW_TARGET 
+PATH=$MINGW_PREFIX/bin:$PATH make $MINGW_PARALLEL
+sudo cp binutils/.libs/addr2line.exe $MINGW_PREFIX/bin
+
diff --git a/clean b/clean
index 6817115..daa0515 100755 (executable)
--- a/clean
+++ b/clean
@@ -2,8 +2,10 @@
 
 rm -rf binutils-2.23
 rm -rf binutils-2.23.2
-rm -rf binutils-build-i686-w64-mingw32
-rm -rf binutils-build-x86_64-w64-mingw32
+rm -rf binutils-windows-build-i686-w64-mingw32
+rm -rf binutils-windows-build-x86_64-w64-mingw32
+rm -rf binutils-linux-build-i686-w64-mingw32
+rm -rf binutils-linux-build-x86_64-w64-mingw32
 rm -rf gcc-4.7.3
 rm -rf gcc-build-i686-w64-mingw32
 rm -rf gcc-build-x86_64-w64-mingw32