Fix for PPC uClibc build

Peter S. Mazinger ps.m at gmx.net
Mon Mar 6 06:59:16 UTC 2006


On Sun, 5 Mar 2006, Brent Cook wrote:

> For the past month or so, the powerpc build of uClibc has been broken for me 
> (I have been stuck on 20060113 for a while). Currently, the build dies on 
> brk.S on the libc_hidden_data_def(__curbrk) line, apparently because __curbrk 
> is not statically initialized.
> 
> I'm actually curious about how the automatic test daemon is building PowerPC, 
> because I sure can't get SVN to build properly (tried GCC 3.4.5 to 4.1 and 
> various binutils)
> 
> The attached patch (cribbed from the alpha port) allows uClibc to build 
> without errors, but I haven't actually verified if this is correct (chrooting 
> on my Mac gives an 'Illegal instruction' error.)
> 
> Can I get some feedback and perhaps some help on determining the correct 
> patch?
> 
>  - Brent

__curbrk needs initialization (all .c code has = 0)  libc_hidden_data_def 
does not like uninitialized data. I know for sure that anything in .c 
either is initialized, or it gets __attribute__((nocommon)) (what your 
patch seem to do, changing .comm __curbrk to .globl __curbrk).

I am not quite sure though if I will want to keep libc_hidden_data_def 
(it was an attempt to get rid of some global data relocations). The only 
safe place I am sure it works correctly is if it is used for constants. 

There are already known cases where it fails depending on chosen 
compiler/arch, like for environ, optind/optarg/optopt/opterr, 
error_message_count, error_one_per_line.

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list