[uClibc] [RFC][PATCH] Various patches and fixes for gcc-4.x compilers for uClibc and buildroot.

Steven J. Hill sjhill at realitydiluted.com
Mon May 2 02:54:14 UTC 2005


I am finding a number of bugs using GCC-4.1.0 with uClibc and
buildroot. I wanted to outline some of my fixes as well as get
comments on my patches. I discovered these while trying to create
a buildroot using the default 'development' root filesystem
options. I discovered issues with the following packages:

    e2fsprogs
    netkitbase
    util-linux

The first two patches for netkitbase and util-linux are a
result of the deprecation of cast-as-lvalue which happened
first in GCC-3.4.3. You can read more about it here:

    http://gcc.gnu.org/gcc-3.4/changes.html

Comments are welcome before I commit these to buildroot. The
next patch to uClibc is necessary to build e2fsprogs and is
also because of this deprecation. I believe my pointer casting
and such is correct. Manuel had some more obfuscated solutions
that may work. I would like discussion on the list for this.

Finally, we have a general build error assoociated with the
libraries in e2fsprogs where we get multiple error messages
like the following:

/home/sjhill/buildroot-gcc4/build_mips/staging_dir/bin/mips-linux-uclibc-gcc 
  -DLOCALEDIR=\"/usr/share/locale\"  -DENABLE_HTREE=1 
-DPACKAGE=\"e2fsprogs\" -DVERSION=\"1.35\" 
-DHAVE_INTTYPES_H_WITH_UINTMAX=1 -DHAVE_STDINT_H_WITH_UINTMAX=1 
-DHAVE_UNSIGNED_LONG_LONG=1 -DSTDC_HEADERS=1 -DHAVE_ALLOCA_H=1 
-DHAVE_ALLOCA=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 
-DINTDIV0_RAISES_SIGFPE=0 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 
-DHAVE_LOCALE_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 
-DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 
-DHAVE_SYS_PARAM_H=1 -DHAVE_FEOF_UNLOCKED=1 -DHAVE_FGETS_UNLOCKED=1 
-DHAVE_GETC_UNLOCKED=1 -DHAVE_GETCWD=1 -DHAV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1 
-DHAVE_SRANDOM=1 -DHAVE_FCHOWN=1 -DHAVE_MALLINFO=1 -DHAVE_FDATASYNC=1 
-DHAVE_STRNLEN=1 -DHAVE_STRPTIME=1 -DHAVE_SYSCONF=1 -DHAVE_PATHCONF=1 
-DHAVE_MEMALIGN=1 -DHAVE_VALLOC=1 -DHAVE_DLOPEN=1 -DHAVE_EXT2_IOCTLS=1 
  -Os -pipe    -I../../lib -I../../lib   -c getflags.c -o getflags.o
In file included from fsetversion.c:25:
/home/sjhill/buildroot-gcc4/build_mips/staging_dir/bin-ccache/../lib/gcc/mips-linux-uclibc/4.1.0/../../../../mips-linux-uclibc/sys-include/unistd.h:240: 
error: two or more data types in declaration specifiers

The problem is with the option '-Dintptr_t=long'. If this option
is removed, the error disappears. The quick hack would be to remove
the check for 'intptr_t' all together, but that feels dirty. I was
able to discover the problem when looking at the pre-processed
output and seeing 'typedef int __intptr_t' and 'typedef long __intpr_t'
both being defined which was leading to this error. I would be very
interested in comments for a solution on this as well. Thanks.

-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netkitbase-gcc4.patch
Type: text/x-patch
Size: 484 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050501/d9ce71c9/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: util-linux-gcc4.patch
Type: text/x-patch
Size: 2232 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050501/d9ce71c9/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclibc-xdr.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050501/d9ce71c9/attachment-0002.bin 


More information about the uClibc mailing list