summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/examples/host-toolchain/README.md10
-rw-r--r--plugins/examples/host-toolchain/gcc-host.mk7
2 files changed, 14 insertions, 3 deletions
diff --git a/plugins/examples/host-toolchain/README.md b/plugins/examples/host-toolchain/README.md
index b571e4b..6b376bf 100644
--- a/plugins/examples/host-toolchain/README.md
+++ b/plugins/examples/host-toolchain/README.md
@@ -15,7 +15,15 @@ second pass to cross-compile the basic toolchain (`binutils` and `gcc`).
Once complete, copy `usr/{target}` to an appropriate Windows machine
and execute the `usr\{target}\bin\test-gcc-host.bat` batch file. This
-builds and runs the `libgomp` test as a sanity check.
+builds and runs the `libgomp` test as a sanity check. The cross and host
+built programs should be identical (after stripping), confirmed with the
+final step:
+
+```
+>fc /b test-gcc-host.exe test-pthreads-libgomp.exe
+Comparing files test-gcc-host.exe and TEST-PTHREADS-LIBGOMP.EXE
+FC: no differences encountered
+```
#### Qt5 tools (`qmake.exe`, `rcc.exe`, etc.)
diff --git a/plugins/examples/host-toolchain/gcc-host.mk b/plugins/examples/host-toolchain/gcc-host.mk
index 2e6b3c8..758f68d 100644
--- a/plugins/examples/host-toolchain/gcc-host.mk
+++ b/plugins/examples/host-toolchain/gcc-host.mk
@@ -9,7 +9,7 @@ $(PKG)_SUBDIR = $(gcc_SUBDIR)
$(PKG)_FILE = $(gcc_FILE)
$(PKG)_URL = $(gcc_URL)
$(PKG)_URL_2 = $(gcc_URL_2)
-$(PKG)_DEPS := gcc binutils-host cloog gmp isl mpfr mpc
+$(PKG)_DEPS := gcc binutils-host cloog gmp isl mpfr mpc pthreads
define $(PKG)_UPDATE
echo $(gcc_VERSION)
@@ -43,10 +43,13 @@ define $(PKG)_BUILD
$(MAKE) -C '$(1).build' -j 1 install
# test compilation on host
+ # strip and compare cross and host-built tests
cp '$(TOP_DIR)/src/pthreads-libgomp-test.c' '$(PREFIX)/$(TARGET)/bin/test-$(PKG).c'
(printf 'set PATH=..\\bin;%%PATH%%\r\n'; \
printf 'gcc test-$(PKG).c -o test-$(PKG).exe -fopenmp -v\r\n'; \
printf 'test-$(PKG).exe\r\n'; \
- printf 'pause\r\n';) \
+ printf 'strip test-$(PKG).exe test-pthreads-libgomp.exe\r\n'; \
+ printf 'fc /b test-$(PKG).exe test-pthreads-libgomp.exe\r\n'; \
+ printf 'cmd\r\n';) \
> '$(PREFIX)/$(TARGET)/bin/test-$(PKG).bat'
endef