host-toolchain plugin: binary compare gcc cross and host output

This commit is contained in:
Tony Theodore 2016-07-15 13:52:42 +10:00
parent fd90cc7b6d
commit bc77cb384e
2 changed files with 14 additions and 3 deletions

View File

@ -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.)

View File

@ -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