Menu

#3589 Regression testing cross-compiled win32 sdcc on GNU/Linux

open
nobody
None
other
5
2023-05-23
2023-05-17
No

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
1 Attachments

Discussion

  • Philipp Klaus Krause

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Using the attached patch, I was able to cross-build an SDCC for Windows on GNU/Linux.
    +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 Klaus Krause

    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.

     
  • Felix

    Felix - 2023-05-19

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

     
    • Philipp Klaus Krause

      I tried that. By also doing

      export WINEPATH="/usr/i686-w64-mingw32/lib;/usr/lib/gcc/i686-w64-mingw32/12-win32"
      

      I was able to get past error messages about missing DLLs.

      But apparently there is still some problem about finding sdcpp:

      philipp@notebook6:/tmp/sdcc-build-cross/support/regression$ echo $PATH
      /tmp/sdcc-build-cross/src:/tmp/sdcc-build-cross/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
      philipp@notebook6:/tmp/sdcc-build-cross/support/regression$ LANG=2 make test-stm8 SDCC="wine /tmp/sdcc-build-cross/src/sdcc.exe" V=1
      i686-w64-mingw32-gcc -pipe -ggdb -g -O2 ../../../sdcc/support/regression/fwk/lib/timeout.c -o gen/timeout
      make -C cases
      make[1]: Entering directory '/tmp/sdcc-build-cross/support/regression/cases'
      make[1]: Nothing to be done for 'all'.
      make[1]: Leaving directory '/tmp/sdcc-build-cross/support/regression/cases'
      make test-port PORT=stm8
      make[1]: Entering directory '/tmp/sdcc-build-cross/support/regression'
      i686-w64-mingw32-gcc -pipe -ggdb -g -O2 ../../../sdcc/support/regression/fwk/lib/timeout.c -o gen/timeout
      make -C cases
      make[2]: Entering directory '/tmp/sdcc-build-cross/support/regression/cases'
      make[2]: Nothing to be done for 'all'.
      make[2]: Leaving directory '/tmp/sdcc-build-cross/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
      wine /tmp/sdcc-build-cross/src/sdcc.exe --fverbose-asm -DNO_VARARGS --nostdinc -I../../../sdcc -mstm8 --less-pedantic --out-fmt-ihx -I../../../sdcc/support/regression/fwk/include -I../../../sdcc/support/regression/tests -I../../../sdcc/device/include -c ../../../sdcc/support/regression/fwk/lib/testfwk.c -o gen/stm8/testfwk.rel
      Fontconfig warning: ignoring 2: not a valid language tag
      Fontconfig warning: ignoring 2: not a valid language tag
      Can't recognize 'sdcpp.exe -nostdinc -Wall -std=c11 -D"NO_VARARGS" -I"../../../sdcc" -I"../../../sdcc/support/regression/fwk/include" -I"../../../sdcc/support/re
      gression/tests" -I"../../../sdcc/device/include" --obj-ext=.rel -D__SDCC_STACK_AUTO -D__SDCC_CHAR_UNSIGNED -D__SDCC_MODEL_MEDIUM -D__SDCC_INT_LONG_REENT -D__SDCC
      _FLOAT_REENT -D__SDCCCALL=1 -D__SDCC=4_2_14 -D__SDCC_VERSION_MAJOR=4 -D__SDCC_VERSION_MINOR=2 -D__SDCC_VERSION_PATCH=14 -D__SDCC_REVISION=14065 -D__SDCC_stm8 -D_
      _STDC_NO_COMPLEX__=1 -D__STDC_NO_THREADS__=1 -D__STDC_NO_ATOMICS__=1 -D__STDC_NO_VLA__=1 -D__STDC_ISO_10646__=201409L -D__SIZEOF_FLOAT__=4 -D__SIZEOF_DOUBLE__=4 
      -D__SDCC_BITINT_MAXWIDTH=64  -xc "../../../sdcc/support/regression/fwk/lib/testfwk.c" ' as an internal or external command, or batch script.
      subprocess error 9009
      make[2]: *** [Makefile:431: gen/stm8/testfwk.rel] Error 1
      make[1]: *** [Makefile:364: test-port] Error 2
      make[1]: Leaving directory '/tmp/sdcc-build-cross/support/regression'
      make: *** [Makefile:203: test-stm8] Error 2
      
       
  • Felix

    Felix - 2023-05-19

    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?

     
    • Philipp Klaus Krause

      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.

       
  • Felix

    Felix - 2023-05-21

    Hah, what a mess. I will figure out something...

    In the meantime you could try the above with cpp.exe renamed to sdcpp.exe.

     
    • Philipp Klaus Krause

      I got a little bit further by making an sdcpp.exe symlink to cpp.exe, and export 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:

      wine /tmp/sdcc-build-cross/src/sdcc.exe --fverbose-asm -DNO_VARARGS --nostdinc -I../../../sdcc -mstm8 --less-pedantic --out-fmt-ihx -I../../../sdcc/support/regression/fwk/include -I../../../sdcc/support/regression/tests -I../../../sdcc/device/include -c ../../../sdcc/support/regression/fwk/lib/testfwk.c -o gen/stm8/testfwk.rel
      sdcpp.exe: fatal error: cc1: error: unrecognized command-line option '--obj-ext=.rel'
                              failed to get exit status: No such file or directory
      compilation terminated.
      subprocess error 1
      
       
      • Felix

        Felix - 2023-05-23

        On Tue, May 23, 2023 at 05:48:24AM -0000, Philipp Klaus Krause wrote:

        I got a little bit further by making an sdcpp.exe symlink to cpp.exe, and export 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:

        ~~~~
        wine /tmp/sdcc-build-cross/src/sdcc.exe --fverbose-asm -DNO_VARARGS --nostdinc -I../../../sdcc -mstm8 --less-pedantic --out-fmt-ihx -I../../../sdcc/support/regression/fwk/include -I../../../sdcc/support/regression/tests -I../../../sdcc/device/include -c ../../../sdcc/support/regression/fwk/lib/testfwk.c -o gen/stm8/testfwk.rel
        sdcpp.exe: fatal error: cc1: error: unrecognized command-line option '--obj-ext=.rel'
        failed to get exit status: No such file or directory
        compilation terminated.
        subprocess error 1
        ~~~~

        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?!

         

Log in to post a comment.

MongoDB Logo MongoDB