bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils failure on Mac OS X 10.5


From: Peter O'Gorman
Subject: Re: coreutils failure on Mac OS X 10.5
Date: Mon, 29 Oct 2007 15:46:37 -0500
User-agent: Thunderbird 2.0.0.5 (X11/20070727)

Jim Meyering wrote:
> Peter O'Gorman <address@hidden> wrote:
>> I am pretty sure that this is still the case with latest gnulib, but
>> have not checked.
>>
>> Coreutils fails to build on Mac OS X 10.5. Apple has worked hard to make
>> this version of Mac OS X UNIX(tm). To do so they had to change the
>> behavior of a number of functions. In order to maintain binary
>> compatibility with older releases they kept the old symbol names in libc
>> and named any functions that had to be modified to conform to the
>> standard symbol$UNIX2003. So libc has a putenv symbol and a
>> putenv$UNIX2003 symbol, the former behaves like BSD putenv, the latter
>> is unix03 conforming. When you #include <stdlib.h>, unless you #define
>> _NONSTD_SOURCE, the symbol putenv is renamed, using asm, to putenv$UNIX2003.
>>
>> What, you ask, does this have to do with gnulib? Well, when attempting
>> to compile GNU coreutils, we noticed that it was failing with undefined
>> symbols, specifically '_rpl_putenv$UNIX2003' (all C symbols on Mac OS X
> 
> Thanks for the report.
> Have you tried with a recent coreutils snapshot?
> 
> Can you provide more details?
> Like is this a link error?
> What is trying to use that symbol?

Yes, a link error, sorry for the crap bug report, too much background,
not enough detail:
With coreutils-6.9
gcc -std=gnu99  -g -O2   -o date date.o ../lib/libcoreutils.a
../lib/libcoreutils.a
Undefined symbols:
  "_rpl_putenv$UNIX2003", referenced from:
      _main in date.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [date] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
mb:coreutils-6.9 peter$ uname -a
Darwin mb.pogma.org 9.0.0 Darwin Kernel Version 9.0.0: Tue Oct  9
21:35:55 PDT 2007; root:xnu-1228~1/RELEASE_I386 i386

/usr/include/stdlib.h has
int    putenv(char *) __DARWIN_ALIAS(putenv);

__DARWIN_ALIAS is defined as:
#define __DARWIN_ALIAS(sym)      __asm("_" __STRING(sym)
__DARWIN_SUF_UNIX03)

__DARWIN_SUF_UNIX03 is defined as "$UNIX2003" for 32 bit builds.

$ grep putenv lib/config.h
/* Define to rpl_putenv if the replacement function should be used. */
#define putenv rpl_putenv


Hope this helps.

Peter








reply via email to

[Prev in Thread] Current Thread [Next in Thread]