#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:
Blocking:

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
ild\rtemstoolkit\libelf_fsize.c
[  3/142] libelf_msize.c: rtemstoolkit\elftoolchain\libelf\libelf_msize.m4 -> bu
ild\rtemstoolkit\libelf_msize.c
[  4/142] c: rtemstoolkit\elftoolchain\libelf\elf.c -> build\rtemstoolkit\elftoo
lchain\libelf\elf.c.4.o
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 Mar 7, 2015 at 4:55:13 AM by Amar Takhar

Description: modified (diff)

Formatting.

comment:2 Changed on Mar 9, 2015 at 3:55:43 AM by Chris Johns

I have run the rtems-tools from git in MSYS2 with a python.org 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 Mar 9, 2015 at 9:22:58 AM by Sebastian Huber

Ok, nice yet another MSYS variant.

http://sourceforge.net/projects/msys2/

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

comment:4 Changed on Mar 10, 2015 at 1:24:33 AM 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 Mar 10, 2015 at 9:29:33 AM by Sebastian Huber

The one from python.org, downloaded at the ticket creation date.

comment:6 Changed on Mar 11, 2015 at 11:57:20 PM 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:

'c:\\mingw\\bin\\gcc.exe',
 '-pipe', '-g', '-O2',
 '-Ic:\\MinGW\\home\\git-rtems-tools\\build',                                                                                                                                                                                                                                                                             
 '-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\elftoolchain\\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\\common',
 '-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\win32',
 '-Ic:\\MinGW\\home\\git-rtems-tools\\rtemstoolkit\\win32',                                                                                                                                                                                                                                                               
 '..\\rtemstoolkit\\elftoolchain\\libelf\\elf.c',
 '-c', '-o',
 'rtemstoolkit\\elftoolchain\\libelf\\elf.c.4.o'

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

'C:\\msys64\\mingw64\\bin\\gcc.exe',
 '-pipe', '-g', '-O2',                                                                                                                                                                                                                                                                                                    
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\build',                                                                                                                                                                                                                                                                          
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\build\\rtemstoolkit\\elftoolchain\\libelf',                                                                                                                                                                                                                                      
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\rtemstoolkit\\elftoolchain\\libelf',                                                                                                                                                                                                                                             
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\build\\rtemstoolkit\\elftoolchain\\common',                                                                                                                                                                                                                                      
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\rtemstoolkit\\elftoolchain\\common',                                                                                                                                                                                                                                             
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\build\\rtemstoolkit\\win32',                                                                                                                                                                                                                                                     
 '-IC:\\opt\\rtems\\rt\\rtems-tools.git\\rtemstoolkit\\win32',                                                                                                                                                                                                                                                            
 '-DPYTHONDIR="C:\\users\\chris\\appdata\\local\\temp\\Lib\\site-packages"',                                                                                                                                                                                                                                              
 '-DPYTHONARCHDIR="C:\\users\\chris\\appdata\\local\\temp\\Lib\\site-packages"',                                                                                                                                                                                                                                          
 '..\\rtemstoolkit\\elftoolchain\\libelf\\elf.c',
 '-c', '-o',
 'rtemstoolkit\\elftoolchain\\libelf\\elf.c.4.o'

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

'-Ic:\\MinGW\\home\\git-rtems-tools\\build\\rtemstoolkit\\win32'

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 Nov 13, 2015 at 7:14:28 AM 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.