Using the attached patch, I was able to cross-build an SDCC in-tree for Windows on GNU/Linux.
But I don't see yet, how to do regression testing:
philipp@notebook6:/tmp/sdcc/support/regression$ LANG=C make V=1 test-stm8
i686-w64-mingw32-gcc -pipe -ggdb -g -O2 fwk/lib/timeout.c -o gen/timeout
make -C cases
make[1]: Entering directory '/tmp/sdcc/support/regression/cases'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/tmp/sdcc/support/regression/cases'
make test-port PORT=stm8
make[1]: Entering directory '/tmp/sdcc/support/regression'
i686-w64-mingw32-gcc -pipe -ggdb -g -O2 fwk/lib/timeout.c -o gen/timeout
make -C cases
make[2]: Entering directory '/tmp/sdcc/support/regression/cases'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/tmp/sdcc/support/regression/cases'
mkdir -p gen/stm8 results/stm8
make --no-print-directory port-fwklib PORT=stm8 V=1
mkdir -p gen/stm8 results/stm8
../../bin/sdcc.exe --fverbose-asm -DNO_VARARGS --nostdinc -I../.. -mstm8 --less-pedantic --out-fmt-ihx -I./fwk/include -I./tests -I../../device/include -c fwk/lib/testfwk.c -o gen/stm8/testfwk.rel
make[2]: ../../bin/sdcc.exe: No such file or directory
make[2]: *** [Makefile:431: gen/stm8/testfwk.rel] Error 127
make[1]: *** [Makefile:364: test-port] Error 2
make[1]: Leaving directory '/tmp/sdcc/support/regression'
make: *** [Makefile:203: test-stm8] Error 2
Diff:
It looks to me like there are at least two problems here:
1) The filename for sdcc(.exe)
2) The missing invokation of wine
Also, for me the problem looks the same, no matter if I build sdcc in-tree or out-of-tree.
shouldn't an invoction like
$ make -C support/regression SDCC="wine /path/to/sdcc.exe"
deal with both these problems?
Next, I expect the usual issues with sdcpp and cc1, exe or not. I'd hope they could be addressed in a similar way...
I tried that. By also doing
I was able to get past error messages about missing DLLs.
But apparently there is still some problem about finding sdcpp:
If sdcc already runs inside wine, the syscall to sdcpp.exe should just work, given sdcpp is in $PATH.
So maybe, all you need is
$ export PATH=$PATH:$top_build_dir/support/cpp/gcc
before running the above?
Hmm, there is no sdcpp.exe anywhere, only a cpp.exe in /tmp/sdcc-build-cross/support/cpp/gcc, and a sdcpp script in /tmp/sdcc-build-cross/bin.
Hah, what a mess. I will figure out something...
In the meantime you could try the above with cpp.exe renamed to sdcpp.exe.
I got a little bit further by making an
sdcpp.exesymlink tocpp.exe, andexport WINEPATH="/usr/i686-w64-mingw32/lib;/usr/lib/gcc/i686-w64-mingw32/12-win32;/tmp/sdcc-build-cross/support/cpp/gcc"Now I get to:
On Tue, May 23, 2023 at 05:48:24AM -0000, Philipp Klaus Krause wrote:
This sounds like it has picked up a cc1 from gcc. Normally, this
shouldn't be possible, because cc1 is not exposed. maybe on wine it is?!