Skip to content

Compiling assembly instruction on GNU gcc/g++ 4.2.1 (Apple Inc. build 5531)

2 messages · Bill Northcott, Patrick Aboyoun

#
On 16/01/2008, at 8:49 PM, Patrick Aboyoun wrote:

            
I don't know, but I would suspect that your problem is in using '-arch  
x86_64' and '-march=nocona'.

As I understand the first means "build this for the full range of  
present and future Apple 64 bit Intel hardware and, if specified, lipo  
it up into a fat binary'  While the second means 'optimise this for  
nocona architecture.'

I would have thought you could combine -march nocona with -m64, but  
combining it with -arch x86_64 might just confuse the compiler.

Bill
#
Thanks Bill for the suggestion, but conflicting -arch and -march 
compiler flags don't appear to be the issue. Here are some other 
compilation attempts:


Leopard$ g++-4.2 -arch x86_64 -g -O2 -march=nocona -fasm-blocks hello.cpp
In file included from hello.cpp:2:
hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
hello.hpp:15: error: expected `)' before ':' token

Leopard$ g++-4.2 -arch x86_64 -g -O2 -fasm-blocks hello.cpp
In file included from hello.cpp:2:
hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
hello.hpp:15: error: expected `)' before ':' token

Leopard$ g++-4.2 -g -O2 -fasm-blocks hello.cpp
In file included from hello.cpp:2:
hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
hello.hpp:15: error: expected `)' before ':' token

Leopard$ g++-4.2 -fasm-blocks hello.cpp
In file included from hello.cpp:2:
hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
hello.hpp:15: error: expected `)' before ':' token

Leopard$ g++-4.2 hello.cpp
In file included from hello.cpp:2:
hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
hello.hpp:11: error: asm blocks not enabled, use `-fasm-blocks'
hello.hpp:15: error: expected `)' before ':' token


Cheers,
Patrick
Bill Northcott wrote: