Notice: We have migrated to GitLab launching 2024-05-01 see here:

#2205 closed defect (fixed)

RTEMS tools don't build on MinGW due to missing <sys/queue.h>

Reported by: Sebastian Huber Owned by: Chris Johns
Priority: normal Milestone: 4.11
Component: tool Version: 4.11
Severity: blocker Keywords:
Cc: Blocked By:

Description (last modified by Amar Takhar)

Sebastian Huber@PC ~
$ cd git-rtems-tools/

Sebastian Huber@PC ~/git-rtems-tools
$ python waf configure --prefix=/opt/rtems-4.11
Setting top to                           : c:\MinGW\home\git-rtems-tools
Setting out to                           : c:\MinGW\home\git-rtems-tools\build
Checking for program g++,c++             : c:\mingw\bin\g++.exe
Checking for program ar                  : c:\mingw\bin\ar.exe
Checking for program gcc,cc              : c:\mingw\bin\gcc.exe
Checking for header alloca.h             : not found
Checking for header fcntl.h              : yes
Checking for header process.h            : yes
Checking for header stdlib.h             : yes
Checking for header string.h             : yes
Checking for header strings.h            : yes
Checking for header sys/file.h           : yes
Checking for header sys/stat.h           : yes
Checking for header sys/time.h           : yes
Checking for header sys/types.h          : yes
Checking for header sys/wait.h           : not found
Checking for header unistd.h             : yes
Checking for header vfork.h              : not found
Checking for function getrusage          : not found
Checking for header sys/wait.h           : not found
Checking for function kill               : not found
Checking for 'msvc' (c++ compiler)       : not found
Checking for 'g++' (c++ compiler)        : c:\mingw\bin\g++.exe
Checking for function open64             : not found
Checking for function stat64             : not found
Checking for program python              : c:\Python34\python.exe
'configure' finished successfully (13.156s)

Sebastian Huber@PC ~/git-rtems-tools
$ python waf build install
Waf: Entering directory `c:\MinGW\home\git-rtems-tools\build'
[  1/142] libelf_convert.c: rtemstoolkit\elftoolchain\libelf\libelf_convert.m4 -
> build\rtemstoolkit\libelf_convert.c
[  2/142] libelf_fsize.c: rtemstoolkit\elftoolchain\libelf\libelf_fsize.m4 -> bu
[  3/142] libelf_msize.c: rtemstoolkit\elftoolchain\libelf\libelf_msize.m4 -> bu
[  4/142] c: rtemstoolkit\elftoolchain\libelf\elf.c -> build\rtemstoolkit\elftoo
In file included from ..\rtemstoolkit\elftoolchain\libelf\elf.c:27:0:
c:\MinGW\home\git-rtems-tools\rtemstoolkit\elftoolchain\libelf/libelf.h:33:23: f
atal error: sys/queue.h: No such file or directory
 #include <sys/queue.h>
compilation terminated.
Waf: Leaving directory `c:\MinGW\home\git-rtems-tools\build'
Build failed
 -> task in 'elf' failed (exit status 1):
        {task 51155184: c elf.c -> elf.c.4.o}
['c:\\mingw\\bin\\gcc.exe', '-pipe', '-g', '-O2', '-Ic:\\MinGW\\home\\git-rtems-
tools\\build', '-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\elftool
chain\\libelf', '-Ic:\\MinGW\\home\\git-rtems-tools\\rtemstoolkit\\elftoolchain\
\libelf', '-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\elftoolchain
\\common', '-Ic:\\MinGW\\home\\git-rtems-tools\\rtemstoolkit\\elftoolchain\\comm
on', '-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\win32', '-Ic:\\Mi
nGW\\home\\git-rtems-tools\\rtemstoolkit\\win32', '..\\rtemstoolkit\\elftoolchai
n\\libelf\\elf.c', '-c', '-o', 'rtemstoolkit\\elftoolchain\\libelf\\elf.c.4.o']

Sebastian Huber@PC ~/git-rtems-tools

Change History (7)

comment:1 Changed on 03/07/15 at 04:55:13 by Amar Takhar

Description: modified (diff)


comment:2 Changed on 03/09/15 at 03:55:43 by Chris Johns

I have run the rtems-tools from git in MSYS2 with a python and it all built. I also ran a built executable from the cmd.exe prompt and it ran and returned the valid help messages.

comment:3 Changed on 03/09/15 at 09:22:58 by Sebastian Huber

Ok, nice yet another MSYS variant.

I will update the getting started guide if I have time.

comment:4 Changed on 03/10/15 at 01:24:33 by Chris Johns

I am moving to MSYS2 because the package management is more in line with what I expect. I have never really got to terms with the Cygwin or MinGW setup/installers. I am also able to build tools from source.

I have received a report from someone testing MSYS2 builds with the same problem. I will need to take a closer look to see what is happening here.

Which python are you using ?

comment:5 Changed on 03/10/15 at 09:29:33 by Sebastian Huber

The one from, downloaded at the ticket creation date.

comment:6 Changed on 03/11/15 at 23:57:20 by Chris Johns

I have taken a look and there must be something specific to your Windows setup we need to isolate. I do not know what this is.

This is the exec options used by waf taken from the error trace you posted:

 '-pipe', '-g', '-O2',
 '-c', '-o',

and this is the trace from my working build with './waf -v':

 '-pipe', '-g', '-O2',                                                                                                                                                                                                                                                                                                    
 '-c', '-o',

If you remove the PYTHON* defines from my command line they are the same. The important path is:


because that directory contains 'sys/queue.h'. This means you and I are detecting 'win32' correctly and the paths are being updated to include the Windows version of queue.h. Why the compiler is not seeing the header in your case is something I do not know.

Please note, one advantage MSYS2 has is it comes with a stable version of git. There are versions of Git for Windows that contain cygwin/msys forked DLLs and they interact with MinGW's MSYS and MSYS2's MSYS.

comment:7 Changed on 11/13/15 at 07:14:28 by Sebastian Huber

Resolution: fixed
Status: newclosed

Fixed by using msys2 (2015-11-12) and [04a52040aef69910e9ac2218fea48077e34d4017/rtems-tools].

Note: See TracTickets for help on using tickets.