uClibc & gcc headers issue

Kevin Day thekevinday at gmail.com
Sat Jun 23 01:28:27 PDT 2007


This is discovered/tested with uClibc-0.9.29 and gcc-4.1.2.

I was having a problem with read-rtl.c producing errors about invalid
l-value in increment..

uClibc uses and installs the header file obstack.h.
obstack.h is a libc header directly included in the gcc project for
its own purposes.

The problem is, gcc will end up including the system obstack.h.  This
is not a problem with glibc as the glibc is normally up-to-date.  The
uClibc obstack.h is significantly older than the version gcc-4.1.2
expects to use.

The uClibc obstack.h has a last copyright almost a decade ago (1999),
and the gcc obstack.h has a copyright over a few years ago (2005).

I replaced the system obstack.h, installed by uClibc with gcc's
version and the obscure bugs vanished.

I looked inside of the gcc-4.1.2/include directory and found it had
only a small number of headers.  I then checked if the system had any
of these headers present, like obstack.h.
Of those system headers found, I ran a diff against gcc's version and
obtained 3 files ancient/outdated files installed by uClibc:
obstack.h, fnmatch.h, and getopt.h

I haven't so much as tested replacing uClibc's versions directly, so I
cannot say anything about uClibc; but as far as gcc, compilation runs
much smoother.

These 3 files may help reduce/remove a lot of the obscure problems
that are breaking uClibc under the hlfs project.

I have only moved obstack.h, but I felt the other two outdated header
files may be an issue as well.
-- 
Kevin Day



More information about the hlfs-dev mailing list