RTEMS 4.11.0 build fails on Windows

Linda Huxley lhuxley at shaw.ca
Wed Apr 12 22:53:52 UTC 2017

Hi Chris,

The fix recommended by Gedare worked, and my RTEMS tools build completed 
without incident.

Section "5.2.1. RTEMS Tools and Kernel" of the RTEMS User Manual 4.11.99 
ends with the following statement:

"You can now build a 3rd party library or an application as defailted in 

But there are no instructions to build the RTEMS kernel within that 
section.  Is that what is intended?

I went back to section "3. Quick Start" for instructions on how to build 
the kernel.  The first command for building the kernel is:

$ export PATH=$HOME/development/rtems/4.12/bin:$PATH

My directory tree is different, so the corresponding command would be:

$ export PATH=/c/opt/rtems/4.11.0/bin:$PATH

But the preceding tools build did not create that directory.  Is that right?

I found the following directory instead:


So I created the "/c/opt/rtems/4.11.0/bin" directory and I copied the 
contents of the other bin directory into it.  Then I ran the following 

$ export PATH=/c/opt/rtems/4.11.0/bin:$PATH
$ cd /c/opt/rtems
$ mkdir kernel
$ cd kernel
$ git clone git://git.rtems.org/rtems.git rtems
$ cd rtems
$ ./bootstrap -c && ./bootstrap -p && \
$ cd ..
$ mkdir erc32
$ cd erc32
$ /c/opt/rtems/kernel/rtems/configure --prefix=/c/opt/rtems/4.11.0 \
   --target=sparc-rtems4.11.0 --enable-rtemsbsp=erc32 --enable-posix
$ make -j 8

However, the final command failed.  The following errors occurred:

In file included from C:/opt/rtems/kernel/rtems/tools/build/cklength.c:27:0:
C:/opt/rtems/kernel/rtems/tools/build/cklength.c: In function 'error':
C:/opt/rtems/kernel/rtems/tools/build/cklength.c:251:16: warning: 
'_errno' redeclared without dllimport attribute: previous dllimport 
ignored [-Wattributes]
      extern int errno;
In file included from C:/opt/rtems/kernel/rtems/tools/build/eolstrip.c:22:0:
C:/opt/rtems/kernel/rtems/tools/build/eolstrip.c: In function 'error':
C:/opt/rtems/kernel/rtems/tools/build/eolstrip.c:245:16: warning: 
'_errno' redeclared without dllimport attribute: previous dllimport 
ignored [-Wattributes]
      extern int errno;
In file included from C:/opt/rtems/kernel/rtems/tools/build/unhex.c:36:0:
C:/opt/rtems/kernel/rtems/tools/build/unhex.c: In function 'error':
C:/opt/rtems/kernel/rtems/tools/build/unhex.c:687:16: warning: '_errno' 
redeclared without dllimport attribute: previous dllimport ignored 
      extern int errno;

Those errors look suspiciously like the problem that I ran into with 
cfns.h.  Is there perhaps a patch or a fix?

Those errors don't terminate the build, but the build fails later with 
the following error:

checking for sparc-rtems4.11.0-gcc... no
configure: error: no acceptable cc found in $PATH



On 2017-04-11 18:35, Chris Johns wrote:
> On 12/04/2017 09:24, Linda Huxley wrote:
>>> That is fine. Please ask any questions, I am more than happy to help.
>> Thanks Chris,
>> Well, I could use some help getting Worth's patch to work.  I have tried
>> making the obvious changes to his patch and I'm still getting a
>> "can't find a file to patch" error.  For example, after inserting
>> "/../gcc-4.9.3" into the difference commands in the patch file, I'm
>> seeing the following message from the first difference in the patch:
>> + cd newlib-
>> + chmod -R a+rX,g-w,o-w .
>> + cat /C/opt/rtems/4.11.0/rtems/patches/gcc-4.9.3-20170404-1.patch
>> + patch -p1
>> can't find file to patch at input line 4
>> Perhaps you used the wrong -p or --strip option?
>> The text leading up to this was:
>> --------------------------
>> |diff -Naur gcc-4.9.3-orig/../gcc-4.9.3/gcc/cp/cfns.gperf
>> gcc-4.9.3-fixed/../gcc-4.9.3/gcc/cp/cfns.gperf
>> |--- gcc-4.9.3-orig/../gcc-4.9.3/gcc/cp/cfns.gperf    2014-01-02
>> 17:23:26.000000000 -0500
>> |+++ gcc-4.9.3-fixed/../gcc-4.9.3/gcc/cp/cfns.gperf    2017-04-04
>> 14:35:14.729966600 -0400
>> --------------------------
>> File to patch:
>> Skip this patch? [y]
>> Skipping patch.
>> 2 out of 2 hunks ignored
>> I'd like to know if I'm interpreting the log correctly.
> Is this a log fragment from the RSB?
>> I am building from this directory:
>> /c/opt/rtems/4.11.0/rtems/
>> Can I assume that the script is in the following directory after the
>> first command that was logged above?:
>> /c/opt/rtems/4.11.0/rtems/build/srg4n2xwm1/newlib-
> The patches are in `patches` below `rtems` in the RSB. The script knows
> this and should handle it.
>> I can see the target file for the first difference here:
>> /c/opt/rtems/4.11.0/rtems/build/srg4n2xwm1/gcc-4.9.3/gcc/cp/cfns.gperf
>> Do you have any idea about what I might be doing wrong?
> Not yet. I ma creating a box to test on. My Windows VM is busy doing
> other things and I have not wanted to update MSYS2 so I have been
> building a Windows box to test builds on. Once it is running I will take
> a look.
> Chris

More information about the users mailing list