gdb patches on FreeBSD 4.9 stable

Ralf Corsepius corsepiu at faw.uni-ulm.de
Fri Mar 12 17:13:23 UTC 2004


On Fri, 2004-03-12 at 17:21, Peter Dufault wrote:
> Two files added to gdb (hw_shm.c and hw_sem.c)  for the powerpc 
> simulation won't compile on FreeBSD.
> 
> FreeBSD-stable expects and documents that sys/types.h must be included 
> before sys/ipc.h.
>
> That is wrong per the single unix spec, which says that including 
> sys/shm.h defines those items from both sys/ipc.h and sys/types.h.
What leads you to this interpretation?

All my copy of SUSv3 says is:
sys/ipc.h:
The uid_t, gid_t, mode_t, and key_t types shall be defined as described
in <sys/types.h>

sys/shm.h:
The pid_t, time_t, key_t, and size_t types shall be defined as described
in <sys/types.h>.
..
In addition, all of the symbols from <sys/ipc.h> shall be defined when
this header is included.
..

My understanding of this is: 
* sys/shm.h can include sys/ipc.h

* it doesn't say anything on whether sys/ipc.h and/or sys/shm.h shall
include sys/types.h


> The best solution is to just include sys/shm.h and force all operating 
> systems to adhere to the spec, but unfortunately that won't work on 
> FreeBSD-stable either.
What you describe as FreeBSD behavior (requiring to include
<sys/types.h> before include  <sys/*.h> is the traditional BSD behavior,
which can be found with many headers on many BSD-derived systems.

> Since RTEMS is already redundantly including sys/ipc.h above sys/shm.h, 
> can it also redundantly include sys/types.h above both?  That's the 
> local patch I made to get it to compile and run, and it shouldn't break 
> any conformant platforms.
> 
> I don't know if this is fixed in the FreeBSD 5 branch.
Pardon, but I must be missing something, RTEMS doesn't have sys/ipc.h
nor sys/shm.h. 

If I understand you correctly, you seem to describe a problem when
building gdb for *-rtems targts on FreeBSD. In this case, you should try
to discuss this issue with the gdb maintainers.

Ralf





More information about the users mailing list