AW: Canadian Cross build for MinGW host

mario.gruber at space.unibe.ch mario.gruber at space.unibe.ch
Mon Feb 1 11:34:14 UTC 2016


> On 1/02/2016 7:52 AM, mario.gruber at space.unibe.ch wrote:
> > I'm trying to do a Cxc build of 4.11/rtems-sparc for MinGW under 
> > Ubuntu
> 15.10:
> >
> > FROM ubuntu:15.10
> >
> > RUN apt-get update \
> >  && apt-get install   -y python python2.7 python2.7-dev \
> >  && apt-get build-dep -y gcc g++ gdb \
> >  && apt-get install   -y wget unzip git \
> >  && apt-get install   -y mingw-w64
> >
> > RUN cd /tmp \
> >  && git clone git://git.rtems.org/rtems-source-builder.git \  && cd 
> > rtems-source-builder \  && git checkout -b 4.11 origin/4.11 \  && 
> > source-builder/sb-check \  && cd rtems \  && 
> > ../source-builder/sb-set-builder \ 
> > --log=rsb-sparc-rtems4.11-mingw.txt \ 
> > --prefix=/opt/sparc-rtems4.11-mingw \
> >  --host=i686-w64-mingw32 \
> >  --bset-tar-files \
> >  4.11/rtems-sparc
> >
> 
> This looks fine.
> 
> > RTEMS Source Builder - Set Builder, 4.11 (aa3fdad01a0d modified) 
> > Command Line: ../source-builder/sb-set-builder 
> > --log=rsb-sparc-rtems4.11-mingw.txt
> > --prefix=/opt/sparc-rtems4.11-mingw --host=i686-w64-mingw32 
> > --bset-tar-files 4.11/rtems-sparc
> >  Python: 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 
> > 20151010] Build Set: 4.11/rtems-sparc
> >
> >
> > It fails building the GDB simulators:
> >
> > make[3]: Entering directory 
> > '/tmp/rtems-source-builder/rtems/build/sparc-
> rtems4.11-gdb-7.9-i686-w64-mingw32-1/build-cxc/sim/erc32'
> > i686-w64-mingw32-gcc -DHAVE_CONFIG_H     -DPROFILE=1 -
> DWITH_PROFILE=-1         -DWITH_HOST_BYTE_ORDER=0 -
> DDEFAULT_INLINE=0           -DFAST_UART -I../../../gdb-7.9/sim/erc32/../.. -
> D__USE_MINGW_FSEEK  -I. -I../../../gdb-7.9/sim/erc32 -I../common - 
> I../../../gdb-7.9/sim/erc32/../common -I../../include -I../../../gdb- 
> 7.9/sim/erc32/../../include -I../../bfd 
> -I../../../gdb-7.9/sim/erc32/../../bfd - I../../opcodes 
> -I../../../gdb-7.9/sim/erc32/../../opcodes  -O2 -pipe  - 
> D__USE_MINGW_ACCESS -c -o sis.o -MT sis.o -MMD -MP -MF .deps/sis.Tpo 
> ../../../gdb-7.9/sim/erc32/sis.c
> > ../../../gdb-7.9/sim/erc32/sis.c: In function 'main':
> > ../../../gdb-7.9/sim/erc32/sis.c:239:25: error: 'F_GETFL' undeclared 
> > (first
> use in this function)
> >      termsave = fcntl(0, F_GETFL, 0);
> >                          ^
> > ../../../gdb-7.9/sim/erc32/sis.c:239:25: note: each undeclared 
> > identifier is reported only once for each function it appears in
> > Makefile:538: recipe for target 'sis.o' failed
> > make[3]: Leaving directory 
> > '/tmp/rtems-source-builder/rtems/build/sparc-
> rtems4.11-gdb-7.9-i686-w64-mingw32-1/build-cxc/sim/erc32'
> 
> This is POSIX code in the simulators not building on Windows.
> 
> >
> >
> > As far as I understand, fcntl() is not supported by MinGW.
> > I guess that RSB should not build the simulators for this reason, as 
> > I
> discovered the following in /rtems/config/4.11/rtems-sparc.bset:
> >
> > #
> > # If Windows (MinGW) do not build the simulator.
> > #
> > %define win32-gdb-disable-sim
> >
> > However, in the RSB logs I see that GDB configure gets invoked with 
> > '--
> enable-sim' instead of disabling it.
> >
> > === configuring in testsuite
> > (/tmp/rtems-source-builder/rtems/build/sparc-rtems4.11-gdb-7.9-i686-
> > w6
> > 4-mingw32-1/build-cxc/gdb/testsuite)
> > configure: running /bin/bash 
> > ../../../gdb-7.9/gdb/testsuite/configure --
> disable-option-checking '--prefix=/opt/sparc-rtems4.11-mingw'  
> '--with- system-zlib' '--verbose' '--disable-nls' 
> '--without-included-gettext' '--disable- win32-registry' '--disable-werror' '--enable-sim' '--without-zlib' '--with-expat'
> '--bindir=/opt/sparc-rtems4.11-mingw/bin' '--exec-prefix=/opt/sparc- 
> rtems4.11-mingw' '--includedir=/opt/sparc-rtems4.11-mingw/include' '-- 
> libdir=/opt/sparc-rtems4.11-mingw/lib' '--mandir=/opt/sparc-rtems4.11- 
> mingw/share/man' '--infodir=/opt/sparc-rtems4.11-mingw/share/info' '-- 
> program-transform-name=s&^&sparc-rtems4.11-&' '--build=x86_64-linux- 
> gnu' '--host=i686-w64-mingw32' '--target=sparc-rtems4.11'
> 'build_alias=x86_64-linux-gnu' 'host_alias=i686-w64-mingw32'
> 'target_alias=sparc-rtems4.11' 'CC=i686-w64-mingw32-gcc' 'CFLAGS=-O2 - 
> pipe  -D__USE_MINGW_ACCESS' 'LDFLAGS=-static-libstdc++ -static-libgcc 
> -
> L/tmp/rtems-source-builder/rtems/build/tmp/sb-root/4.11/rtems-
> sparc/opt/spa!
>  rc-rtems4.
> 1
> >  1-mingw/lib -Wl,--stack,12582912' 'MAKEINFO=makeinfo 
> > --split-size=5000000' 'YACC=bison -y' --cache-file=.././config.cache 
> > --srcdir=../../../gdb-7.9/gdb/testsuite
> > configure: loading cache .././config.cache
> >
> > Any comments are appreciated.
> 
> It seems something has broken. The simulators use to be disabled on 
> Windows and have been enabled. I thought the simulators had been fixed 
> but I must have been wrong. I would like to fix the simulators and 
> have them work on Windows.
> 
> Chris

The GDB simulators are enabled for powerpc as well, but build successfully:

=== configuring in ppc (/tmp/rtems-source-builder/rtems/build/powerpc-rtems4.11-gdb-7.9-i686-w64-mingw32-1/build-cxc/sim/ppc)
configure: running /bin/bash ../../../gdb-7.9/sim/ppc/configure --disable-option-checking '--prefix=/opt/powerpc-rtems4.11-mingw'  '--with-system-zlib' '--verbose' '--disable-nls' '--without-included-gettext' '--disable-win32-registry' '--disable-werror' '--enable-sim' '--enable-sim-hardware' '--enable-timebase' '--enable-sim-trace' '--without-zlib' '--with-expat' '--bindir=/opt/powerpc-rtems4.11-mingw/bin' '--exec-prefix=/opt/powerpc-rtems4.11-mingw' '--includedir=/opt/powerpc-rtems4.11-mingw/include' '--libdir=/opt/powerpc-rtems4.11-mingw/lib' '--mandir=/opt/powerpc-rtems4.11-mingw/share/man' '--infodir=/opt/powerpc-rtems4.11-mingw/share/info' '--program-transform-name=s&^&powerpc-rtems4.11-&' '--build=x86_64-linux-gnu' '--host=i686-w64-mingw32' '--target=powerpc-rtems4.11' 'build_alias=x86_64-linux-gnu' 'host_alias=i686-w64-mingw32' 'target_alias=powerpc-rtems4.11' 'CC=i686-w64-mingw32-gcc' 'CFLAGS=-O2 -pipe  -D__USE_MINGW_ACCESS' 'LDFLAGS=-static-libstdc++ -static-libgcc -L/tmp/rtems-source-builder/rtems/build/tmp/sb-root/4.11/rtems-powerpc/opt/powerpc-rtems4.11-mingw/lib -Wl,--stack,12582912' --cache-file=.././config.cache --srcdir=../../../gdb-7.9/sim/ppc

However, I get another blocker in the next package rtems-tools-4.11-1: 

config: tools/rtems-tools-4.11-1.cfg
package: rtems-tools-4.11-1
...
+ echo ==> %build:
==> %build:
+ pwd
+ build_top=/tmp/rtems-source-builder/rtems/build/rtems-tools-4.11-1
+ test x86_64-linux-gnu != i686-w64-mingw32
+ RT_HOST=-host=i686-w64-mingw32
+ cd rtems-tools-4.11
+ ./waf configure -host=i686-w64-mingw32 
+ --prefix=/opt/powerpc-rtems4.11-mingw
waf [commands] [options]

Main commands (example: ./waf build -j4)
  build    : executes the build
  clean    : cleans the project
...
+ ./waf
The project was not configured: run "waf configure" first!
shell cmd failed: /bin/sh -ex  /tmp/rtems-source-builder/rtems/build/rtems-tools-4.11-1/doit
error: building rtems-tools-4.11-1
  See error report: rsb-report-rtems-tools-4.11-1.txt

This is due to the -host command line argument, which is missing a hyphen.
I already sent a patch to the devel list, but did not file a PR.
https://lists.rtems.org/pipermail/devel/2016-January/013348.html

Mario



More information about the users mailing list