NickThePowerful / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
0 stars 0 forks source link

OSByteOrder.h:51: error: syntax error before ‘_OSSwapInt32’ #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The last step building the toolchain gives me:

{{{
In file included from /usr/local/arm-apple-darwin/include/sys/_endian.h:88,
                 from /usr/local/arm-apple-darwin/include/arm/endian.h:92,
                 from /usr/local/arm-apple-darwin/include/machine/endian.h:34,
                 from /usr/local/arm-apple-darwin/include/sys/types.h:75,
                 from ../../../llvm-gcc-4.0-iphone/gcc/tsystem.h:93,
                 from ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c:38:
/usr/local/arm-apple-darwin/include/stdint.h:1: error: syntax error before
‘/’ token
In file included from
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:56,
                 from /usr/local/arm-apple-darwin/include/sys/_endian.h:89,
                 from /usr/local/arm-apple-darwin/include/arm/endian.h:92,
                 from /usr/local/arm-apple-darwin/include/machine/endian.h:34,
                 from /usr/local/arm-apple-darwin/include/sys/types.h:75,
                 from ../../../llvm-gcc-4.0-iphone/gcc/tsystem.h:93,
                 from ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c:38:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:51:
error: syntax error before ‘_OSSwapInt32’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:52:
error: syntax error before ‘data’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘_OSSwapInt32’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:55:
error: ‘uint32_t’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:55:
error: (Each undeclared identifier is reported only once
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:55:
error: for each function it appears in.)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:55:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:60:
error: syntax error before ‘_OSSwapInt64’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:61:
error: syntax error before ‘data’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘_OSSwapInt64’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:64:
error: ‘uint64_t’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:64:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:71:
error: syntax error before ‘OSReadSwapInt16’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSReadSwapInt16’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:76:
error: ‘uint16_t’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:76:
error: syntax error before ‘data’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:77:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:82:
error: syntax error before ‘OSReadSwapInt32’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSReadSwapInt32’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:87:
error: ‘uint32_t’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:87:
error: syntax error before ‘data’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:88:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:93:
error: syntax error before ‘OSReadSwapInt64’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSReadSwapInt64’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:98:
error: ‘uint64_t’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:98:
error: syntax error before ‘data’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:99:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:109:
error: syntax error before ‘uint16_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSWriteSwapInt16’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:112:
error: syntax error before ‘uint16_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:112:
error: ‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:112:
error: ‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:112:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:120:
error: syntax error before ‘uint32_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSWriteSwapInt32’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:123:
error: syntax error before ‘uint32_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:123:
error: ‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:123:
error: ‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:123:
error: ‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: At top
level:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:131:
error: syntax error before ‘uint64_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h: In
function ‘OSWriteSwapInt64’:
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:134:
error: syntax error before ‘uint64_t’
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:134:
error: ‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:134:
error: ‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/machine/OSByteOrder.h:134:
error: ‘data’ undeclared (first use in this function)
In file included from /usr/local/arm-apple-darwin/include/sys/_endian.h:89,
                 from /usr/local/arm-apple-darwin/include/arm/endian.h:92,
                 from /usr/local/arm-apple-darwin/include/machine/endian.h:34,
                 from /usr/local/arm-apple-darwin/include/sys/types.h:75,
                 from ../../../llvm-gcc-4.0-iphone/gcc/tsystem.h:93,
                 from ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c:38:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:111: error:
syntax error before ‘_OSReadInt16’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSReadInt16’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:116: error:
syntax error before ‘uint16_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:121: error:
syntax error before ‘_OSReadInt32’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSReadInt32’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:126: error:
syntax error before ‘uint32_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:131: error:
syntax error before ‘_OSReadInt64’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSReadInt64’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:136: error:
syntax error before ‘uint64_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:146: error:
syntax error before ‘uint16_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSWriteInt16’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:149: error:
syntax error before ‘uint16_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:149: error:
‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:149: error:
‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:149: error:
‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:157: error:
syntax error before ‘uint32_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSWriteInt32’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:160: error:
syntax error before ‘uint32_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:160: error:
‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:160: error:
‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:160: error:
‘data’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: At top level:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:168: error:
syntax error before ‘uint64_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h: In function
‘_OSWriteInt64’:
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:171: error:
syntax error before ‘uint64_t’
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:171: error:
‘base’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:171: error:
‘byteOffset’ undeclared (first use in this function)
/usr/local/arm-apple-darwin/include/libkern/OSByteOrder.h:171: error:
‘data’ undeclared (first use in this function)
In file included from /usr/local/arm-apple-darwin/include/arm/endian.h:92,
                 from /usr/local/arm-apple-darwin/include/machine/endian.h:34,
                 from /usr/local/arm-apple-darwin/include/sys/types.h:75,
                 from ../../../llvm-gcc-4.0-iphone/gcc/tsystem.h:93,
                 from ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c:38:
/usr/local/arm-apple-darwin/include/sys/_endian.h: At top level:
/usr/local/arm-apple-darwin/include/sys/_endian.h:92: error: syntax error
before ‘ntohs’
/usr/local/arm-apple-darwin/include/sys/_endian.h:93: error: syntax error
before ‘htons’
/usr/local/arm-apple-darwin/include/sys/_endian.h:94: error: syntax error
before ‘ntohl’
/usr/local/arm-apple-darwin/include/sys/_endian.h:95: error: syntax error
before ‘htonl’
make[3]: *** [crt3.o] Error 1
make[3]: Leaving directory
`/usr/local/src/iphone-toolchain-1/iphone-dev/build/llvm-gcc-4.0-iphone/gcc'
make[2]: *** [extra] Error 2
make[2]: Leaving directory
`/usr/local/src/iphone-toolchain-1/iphone-dev/build/llvm-gcc-4.0-iphone/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory
`/usr/local/src/iphone-toolchain-1/iphone-dev/build/llvm-gcc-4.0-iphone/gcc'
make: *** [all-gcc] Error 2
}}}

 * Archlinux 2.6.22
 * gcc 4.2.1
 * Revision 197 http://iphone-dev.googlecode.com/svn/trunk 
 * Revision 42321 http://llvm.org/svn/llvm-project/llvm/trunk
 * OSX headers MacOSX10.4u.sdk
 * any other info you may require, just ask, please

Original issue reported on code.google.com by julian.r...@gmail.com on 27 Sep 2007 at 10:18

GoogleCodeExporter commented 9 years ago
Could you post your /usr/local/arm-apple-darwin/include/stdint.h ?

Original comment by nightwat...@gmail.com on 28 Sep 2007 at 12:59

GoogleCodeExporter commented 9 years ago
/usr/local/arm-apple-darwin/include/stdint.h contains just 1 line:
----
gcc/darwin/default/stdint.h
----

Original comment by julian.r...@gmail.com on 29 Sep 2007 at 7:56

Attachments:

GoogleCodeExporter commented 9 years ago
The attached stdint.h in the previous comment corresponds to:

/usr/local/arm-apple-darwin/include/gcc/darwin/4.0/stdint.h

I have these stdint.h under  /usr/local/arm-apple-darwin

$ find . -name stdint.h
./include/gcc/darwin/3.3/stdint.h
./include/gcc/darwin/4.0/stdint.h
./include/stdint.h

Original comment by julian.r...@gmail.com on 29 Sep 2007 at 7:59

GoogleCodeExporter commented 9 years ago
After svn update the error now is:

../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function ‘void
llvm_initialize_backend()’:
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error:
‘createBFS_DAGScheduler’ was not declared in this scope
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function ‘void
emit_global_to_llvm(tree_node*)’:
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:862: warning: comparison 
between
signed and unsigned integer expressions
make[1]: *** [llvm-backend.o] Error 1
make[1]: Leaving directory
`/usr/local/src/iphone-toolchain-1/iphone-dev/build/llvm-gcc-4.0-iphone/gcc'
make: *** [all-gcc] Error 2

Original comment by julian.r...@gmail.com on 3 Oct 2007 at 7:40

GoogleCodeExporter commented 9 years ago
(answering comment 4)

this is known: http://code.google.com/p/iphone-dev/issues/detail?id=70

Original comment by onit...@gmail.com on 9 Oct 2007 at 4:03

GoogleCodeExporter commented 9 years ago
this os duplicate of issue 31. I have fix.

Original comment by NekoCo...@gmail.com on 26 Oct 2007 at 5:42

GoogleCodeExporter commented 9 years ago
I am doing this on Windows/Cygwin and I got the exact same problem (as the 
original
post).  I think it is related to bad symlinks.  I'm not sure about anything so 
I may
be wrong.  I described my situation on the iPhone dev wiki:
http://iphone.fiveforty.net/wiki/index.php/Talk:Toolchain_installation_-_Windows
.

Original comment by ViaJ...@gmail.com on 29 Oct 2007 at 4:39

GoogleCodeExporter commented 9 years ago
I have this exact same issue on ubuntu gutsy (7.10). I'm using the 32bit 
version on a
Q6600 with gcc 4.1.3.

Original comment by penj...@gmail.com on 10 Nov 2007 at 4:58

GoogleCodeExporter commented 9 years ago
Same problem on Slackware 12 (32 bits).

Original comment by walrick....@gmail.com on 30 Mar 2008 at 4:17

GoogleCodeExporter commented 9 years ago
I have experienced the same problem as original post when trying to build on 
Ubuntu
Gutsy 7.10 also. What is workaround?

Original comment by feilimb on 5 Apr 2008 at 9:55

GoogleCodeExporter commented 9 years ago
The stdint.h file in /usr/local/arm-apple-darwin/include should actually be a 
symlink
to /usr/local/arm-apple-darwin/include/gcc/darwin/default/stdint.h.  This is 
caused
by bad symlinks in the MacOSX10.4u.sdk folder.

I got this issue after copying the MacOSX10.4u.sdk folder off a Mac onto my 
Ubuntu
box.  All of the symlinks in the folder turned into files rather than links.

To fix the issue you need to copy the sdk folder while preserving the links and 
then
do the install-headers step in the install guide again.

Original comment by max.e.st...@gmail.com on 17 May 2008 at 11:45

GoogleCodeExporter commented 9 years ago
I wrote a simple bash script to fix the problem:
software.jenandzu.com/fixlinks

Simply download it,
$ chmod a+x fixlinks
then
$ fixlinks MacOSX10.4u.sdk
(or fixlinks MacOSX10.4u.sdk > /dev/null if you hate to see the long list).

Then, you will have to:
$ rm -rf /usr/local/arm-apple-darwin/include
and re-run install-headers.sh in th include directory to fix previously 
installed 
header files

It worked for me -- at least everything was compiled..

Original comment by zuw...@gmail.com on 12 Jan 2009 at 6:06

GoogleCodeExporter commented 9 years ago
Thanks zuwhan!  That was a /huge/ help.  Now I'm stuck a little further down 
the road.  
The buffer overflow.

Original comment by sudo.adam.carruthers@gmail.com on 24 Dec 2009 at 11:55