Waf + gccdeps on Mingw64/MSYS2?

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Dec 3 13:35:43 UTC 2019


On 03/12/2019 14:27, Sebastian Huber wrote:
> On 03/12/2019 14:10, Sebastian Huber wrote:
>> On 03/12/2019 07:03, Sebastian Huber wrote:
>>>
>>>
>>> On 03/12/2019 03:50, Chris Johns wrote:
>>>> On 2/12/19 5:27 pm, Sebastian Huber wrote:
>>>>> On 02/12/2019 01:24, Chris Johns wrote:
>>>>>> On 2/12/19 11:10 am, Chris Johns wrote:
>>>>>>> On 28/11/19 5:55 pm, Sebastian Huber wrote:
>>>>>> I updated MSYS2 to the latest and this error did not appear 
>>>>>> however I am now
>>>>>> seeing ...
>>>>>>
>>>>>> [1867/4038] Processing testsuites/libtests/tar01/init.o:
>>>>>> testsuites/libtests/tar01/init.c
>>>>>> build/sparc/erc32/testsuites/libtests/tar01/tar01-tar.h
>>>>>> build/sparc/erc32/testsuites/libtests/tar01/tar01-tar-gz.h
>>>>>> build/sparc/erc32/testsuites/libtests/tar01/tar01-tar-xz.h ->
>>>>>> build/sparc/erc32/testsuites/libtests/tar01/init.o
>>>>>> In file included from
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:26:0:
>>>>>> testsuites/libtests/tar01/tar01-tar.h:7:12: warning: extra tokens 
>>>>>> at end of
>>>>>> #ifndef directive
>>>>>>    #ifndef
>>>>>> __D:_opt_rtems_rtems_seb_build_sparc_erc32_testsuites_libtests_tar01_tar01_tar_h 
>>>>>>
>>>>>>               ^
>>>>>> testsuites/libtests/tar01/tar01-tar.h:8:12: warning: ISO C99 
>>>>>> requires whitespace
>>>>>> after the macro name
>>>>>>    #define
>>>>>> __D:_opt_rtems_rtems_seb_build_sparc_erc32_testsuites_libtests_tar01_tar01_tar_h 
>>>>>>
>>>>>>               ^
>>>>>> In file included from
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:27:0:
>>>>>> testsuites/libtests/tar01/tar01-tar-gz.h:7:12: warning: extra 
>>>>>> tokens at end of
>>>>>> #ifndef directive
>>>>>>    #ifndef
>>>>>> __D:_opt_rtems_rtems_seb_build_sparc_erc32_testsuites_libtests_tar01_tar01_tar_gz_h 
>>>>>>
>>>>>>
>>>>>>               ^
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c: In function
>>>>>> 'test_untar_unzip_tgz':
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:44:26: error:
>>>>>> 'tar01_tar_gz' undeclared (first use in this function); did you mean
>>>>>> 'tar01_tar_size'?
>>>>>>    #define TARFILE_GZ_START tar01_tar_gz
>>>>>>                             ^
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:198:26: 
>>>>>> note: in
>>>>>> expansion of macro 'TARFILE_GZ_START'
>>>>>>      char *buffer = (char *)TARFILE_GZ_START;
>>>>>>                             ^~~~~~~~~~~~~~~~
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:44:26: 
>>>>>> note: each
>>>>>> undeclared identifier is reported only once for each function it 
>>>>>> appears in
>>>>>>    #define TARFILE_GZ_START tar01_tar_gz
>>>>>>                             ^
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:198:26: 
>>>>>> note: in
>>>>>> expansion of macro 'TARFILE_GZ_START'
>>>>>>      char *buffer = (char *)TARFILE_GZ_START;
>>>>>>                             ^~~~~~~~~~~~~~~~
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:45:26: error:
>>>>>> 'tar01_tar_gz_size' undeclared (first use in this function); did 
>>>>>> you mean
>>>>>> 'tar01_tar_size'?
>>>>>>    #define TARFILE_GZ_SIZE  tar01_tar_gz_size
>>>>>>                             ^
>>>>>> D:/opt/rtems/rtems.seb/testsuites/libtests/tar01/init.c:199:19: 
>>>>>> note: in
>>>>>> expansion of macro 'TARFILE_GZ_SIZE'
>>>>>>      size_t buflen = TARFILE_GZ_SIZE;
>>>>>>                      ^~~~~~~~~~~~~~~
>>>>>
>>>>> I think this revealed two issues.
>>>>>
>>>>> 1. The file name sanitation in bin2c was not really good. I fixed 
>>>>> it like this:
>>>>>
>>>>> https://git.rtems.org/rtems-tools/commit/?id=83b8f1f2a5838a5d56e15c70d44348e3e393e3f7 
>>>>>
>>>>
>>>> I cannot test this at the moment because I cannot build the sparc 
>>>> tools after
>>>> the updates. Something about an unresolved external in string.h in 
>>>> gdb and I
>>>> have not tracked it down.
>>>
>>> I do currently a MinGW64/MSYS2 installation from scratch. For the 
>>> first tests I used an existing installation. I think it makes a 
>>> difference if you build the rtems-tools with the MSYS2 GCC or the 
>>> MinGW64 GCC. For example, I didn't observe the bin2c issue in my tests.
>>
>> I was able to build the tools without GDB:
>>
>> installing: sparc-rtems5-binutils-2.33.1-x86_64-w64-mingw32-1 -> 
>> c:\test-msys64\home\rtems\5
>> installing: 
>> sparc-rtems5-gcc-7.5.0-newlib-d14714c69-x86_64-w64-mingw32-1 -> 
>> c:\test-msys64\home\rtems\5
>> installing: rtems-tools-83b8f1f2a5838a5d56e15c70d44348e3e393e3f7-1 -> 
>> c:\test-msys64\home\rtems\5
>> installing: sis-2.20-x86_64-w64-mingw32-1 -> c:\test-msys64\home\rtems\5
>> cleaning: sparc-rtems5-binutils-2.33.1-x86_64-w64-mingw32-1
>> cleaning: sparc-rtems5-gcc-7.5.0-newlib-d14714c69-x86_64-w64-mingw32-1
>> cleaning: rtems-tools-83b8f1f2a5838a5d56e15c70d44348e3e393e3f7-1
>> cleaning: sis-2.20-x86_64-w64-mingw32-1
>> Build Sizes: usage: 7.813GB total: 1.792GB (sources: 124.484MB, 
>> patches: 19.412KB, installed 1.670GB)
>> installing: 5/rtems-sparc -> c:\test-msys64\home\rtems\5
>> clean staging: 5/rtems-sparc
>> Staging Size: 5.292MB
>> Build Set: Time 2:08:23.014800
>>
>> However:
>>
>> $ ./waf configure --prefix=$HOME/rtems/5
>> Setting top to                           : C:/test-msys64/home/src/rtems
>> Setting out to                           : 
>> C:/test-msys64/home/src/rtems/build
>> Configure board support package (BSP)    : sparc/leon3
>> Checking for program 'sparc-rtems5-gcc'  : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
>> Checking for program 'sparc-rtems5-g++'  : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-g++.exe
>> Checking for program 'sparc-rtems5-ar'   : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
>> Checking for program 'sparc-rtems5-ld'   : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ld.exe
>> Checking for program 'ar'                : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
>> Checking for program 'g++, c++'          : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-g++.exe
>> Checking for program 'ar'                : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
>> Checking for program 'gas, gcc'          : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
>> Checking for program 'ar'                : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
>> Checking for program 'gcc, cc'           : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
>> Checking for program 'ar'                : 
>> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
>> Checking for program 'rtems-bin2c'       : not found
>> Could not find the program ['rtems-bin2c']
>> (complete log in C:/test-msys64/home/src/rtems/build/config.log)
>>
>> And:
>>
>> $ ls -l $HOME/rtems/5/bin/*bin2c*
>> ls: cannot access '/c/test-msys64/home/rtems/5/bin/*bin2c*': No such 
>> file or directory
>>
>> And:
>>
>> $ grep bin2c rsb-log-20191203-111304.txt
>> x -rw-rw-rw-  0 nickc  nickc    1639 Sep  9 15:19 
>> binutils-2.33.1/binutils/bin2c.c
>> x drwxrwxr-x  0 root   root        0 Dec  2 06:44 
>> rtems-tools-83b8f1f2a5838a5d56e15c70d44348e3e393e3f7/misc/bin2c/
>> x -rw-rw-r--  0 root   root     1683 Dec  2 06:44 
>> rtems-tools-83b8f1f2a5838a5d56e15c70d44348e3e393e3f7/misc/bin2c/compat.c
>> x -rw-rw-r--  0 root   root     7463 Dec  2 06:44 
>> rtems-tools-83b8f1f2a5838a5d56e15c70d44348e3e393e3f7/misc/bin2c/rtems-bin2c.c 
>>
>> [238/255] Compiling misc/bin2c/compat.c
>> [239/255] Compiling misc/bin2c/rtems-bin2c.c
>> [244/255] Linking build/misc/rtems-bin2c.exe
>> + install 
>> C:/test-msys64/home/src/rsb/rtems/build/tmp/rt81-197608/test-msys64/home/rtems/5/bin/rtems-bin2c.exe 
>> (from build/misc/rtems-bin2c.exe)
>>
>> It seems rtems-bin2c.exe is only installed in the RSB build tree?
>>
> 
> I cloned and installed the rtems-tools by hand. This seems to work:
> 
> $ ./waf configure --prefix=$HOME/rtems/5
> Setting top to                           : C:/test-msys64/home/src/rtems
> Setting out to                           : 
> C:/test-msys64/home/src/rtems/build
> Configure board support package (BSP)    : sparc/leon3
> Checking for program 'sparc-rtems5-gcc'  : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
> Checking for program 'sparc-rtems5-g++'  : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-g++.exe
> Checking for program 'sparc-rtems5-ar'   : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
> Checking for program 'sparc-rtems5-ld'   : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ld.exe
> Checking for program 'ar'                : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
> Checking for program 'g++, c++'          : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-g++.exe
> Checking for program 'ar'                : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
> Checking for program 'gas, gcc'          : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
> Checking for program 'ar'                : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
> Checking for program 'gcc, cc'           : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-gcc.exe
> Checking for program 'ar'                : 
> C:/test-msys64/home/rtems/5/bin/sparc-rtems5-ar.exe
> Checking for program 'rtems-bin2c'       : 
> C:/test-msys64/home/rtems/5/bin/rtems-bin2c.exe
> Checking for program 'gzip'              : C:\test-msys64\usr\bin/gzip.exe
> Checking for program 'pax'               : C:\test-msys64\usr\bin/pax.exe
> Checking for program 'rtems-ld'          : 
> C:/test-msys64/home/rtems/5/bin/rtems-ld.exe
> Checking for program 'rtems-syms'        : 
> C:/test-msys64/home/rtems/5/bin/rtems-syms.exe
> Checking for program 'xz'                : 
> C:\test-msys64\mingw64\bin/xz.exe
> 'configure' finished successfully (0.223s)
> 
> $ ./waf
> ...
> [4571/4571] Processing link: 
> build/sparc/leon3/testsuites/libtests/dl04/dl04-tar.o 
> build/sparc/leon3/testsuites/libtests/dl04/init.o 
> build/sparc/leon3/testsuites/libtests/dl04/dl-load.o 
> build/sparc/leon3/testsuites/libtests/dl04/dl04-sym.o -> 
> build/sparc/leon3/testsuites/libtests/dl04.exe
> Waf: Leaving directory `C:/test-msys64/home/src/rtems/build/sparc/leon3'
> 'build_sparc/leon3' finished successfully (2m42.745s)
> 
> $ ./waf install
> ...
> + install 
> C:/test-msys64/home/rtems/5/sparc-rtems5/leon3/lib/include/rtems/score/wkspace.h 
> (from cpukit/include/rtems/score/wkspace.h)
> Waf: Leaving directory `C:/test-msys64/home/src/rtems/build/sparc/leon3'
> 'install_sparc/leon3' finished successfully (4.803s)
> 
> It seems the new build system works now on MinGW64.

The RTEMS Tester doesn't work:

$ $HOME/rtems/5/bin/rtems-test --rtems-bsp=leon3-sis 
--rtems-tools=$HOME/rtems/5 .
C:/test-msys64/home/rtems/5/share/rtems\rtemstoolkit\macros.py:263: 
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if key.startswith('%{') and key[-1] is '}':

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list