MIPS and gcc-4.3.1

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Tue Aug 5 13:11:29 UTC 2008


Hello again!

I've been trying to build uClibc-20080801 for MIPS with gcc-4.3.1.

The build chokes in libc/stdlib/_atexit.c at line 205:
libc/stdlib/_atexit.c:205: error: expected ';' before '__prev'
libc/stdlib/_atexit.c:205: error: '__prev' undeclared (first use in this function)
libc/stdlib/_atexit.c:205: error: (Each undeclared identifier is reported only once
libc/stdlib/_atexit.c:205: error: for each function it appears in.)
libc/stdlib/_atexit.c:205: error: expected ';' before '__prev'
libc/stdlib/_atexit.c:205: error: expected ';' before '__prev'
libc/stdlib/_atexit.c:205: error: expected ';' before '__prev'
libc/stdlib/_atexit.c:205: error: invalid lvalue in asm output 0

After looking at the code and digging into macros, I ended up in
libc/sysdeps/linux/mips/bits/atomic.h

This file makes use of the 'typeof' keyword. I looked around in other archs,
and all but MIPS and Alpha use '__typeof'. MIPS and Alpha do use 'typeof'.

So I made the attached patch, and the build completes.
Is the patch right?

On the other hand, reading the gcc manual, section 5.6 titled "Referring
to a Type with `typeof'" ("info ./gcc/doc/gcc.info" in the gcc source tree)
reads:

|  If you are writing a header file that must work when included in ISO C
| programs, write `__typeof__' instead of `typeof'.  *Note Alternate
| Keywords::.

So going do section 5.41 "Alternate Keywords", it reads:

| `-ansi' and the various `-std' options disable certain keywords.
[--SNIP--]
| The keywords `asm', `typeof' and `inline' are not available in programs
| compiled with `-ansi' or `-std'
[--SNIP--]
|  The way to solve these problems is to put `__' at the beginning and
| end of each problematical keyword.

So I do not know where this '__typeof' comes from, but we'd be better using
'__typeof__' instead, no?

Did I miss something else?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | * _ * | / \ HTML MAIL    |  """  conspiracy.  |
°------------------------------°-------°------------------°--------------------°
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uClibc.mips-typeof.patch
Type: text/x-diff
Size: 4470 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20080805/c336bf1c/attachment.bin 


More information about the uClibc mailing list