[PATCH] ARC: Add GNU glob to ARC defconfigs

Anton Kolesov Anton.Kolesov at synopsys.com
Fri Feb 13 11:26:07 UTC 2015


> On Mon, Feb 09, 2015 at 02:37:11PM +0000, Anton Kolesov wrote:
> > > > Anton, are you going to spin a patch to that effect ?
> > >
> > > Yes.
> > > Anton
> >
> > It didn't worked quite well - glob implementation shipped with make
> > sources makes some assumptions WRT of presence of __mempcpy,
> > __alloca and __stat, which are not true for uClibc. I was able to
> > avoid the problem by changing make/glob/glob.c: by adding there
> > several #ifdef __UCLIBC__ (similar to the one found in
> > libpthread/nptl_db/thread_dbP.h at line 32). But that means that
> > patching of uclibc/include/gnu-versions.h is not sufficient on its
> > own.
> 
> This does not sound plausible. GNU make works on dozens if not
> hundreds of platforms which do not have the above glibc nonsense
> exported. Or is it using this stuff based on uclibc's defining of the
> __GLIBC__ macro?
> 

1. Error for mempcpy depends on (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1) (http://git.savannah.gnu.org/cgit/make.git/tree/glob/glob.c#n179). Those conditions are met for uClibc (http://git.uclibc.org/uClibc/tree/include/features.h#n395), as a result make's glob  undefines mempcpy and sets it to __mempcpy. Unfortunately __mempcpy doesn't get resolved by linker to anything.

2. For alloca (http://git.savannah.gnu.org/cgit/make.git/tree/glob/glob.c#n211) we need "#define __alloca alloca" to be done, but that doesn't happen because condition (!defined __GNU_LIBRARY__) is false.

3. For stat it is the same: condition is "#ifndef __GNU_LIBRARY__" (http://git.savannah.gnu.org/cgit/make.git/tree/glob/glob.c#n234) which is false for uClibc, and __stat is left undefined, but is used by glob.c.

I'm not really a libc developer so I would refrain from deciding what is right and what is wrong with those defines, I just need "make" to run uClibc testsuite and Vineet greenlighted for me enabling gnu glob in default config for ARC.

> Rich


More information about the uClibc mailing list