[gccsdk] g++

Lee Noar leenoar at sky.com
Sun Nov 22 11:54:10 PST 2015


On 22/11/15 15:55, Gavin Wraith wrote:
>> Note that CXX is the g++ compiler, which is why changing CC had no
>> effect.
>
> Why is it using g++ and not cc? There is a change from Lua 5.3.1
> to 5.3.2; namely a new header file lprefix.h containing

[snip]

> Could this be responsible?

No, a new header wouldn't alter the compiler used. Usually, it's the
source file extension that determines the compiler, but here all files
are .c and the makefile contains no C++ bits. So your question
"Why is it using g++ and not cc?" is a good one.

>> So you'd want something like:
>>
>>   CXXFLAGS= -O2 -Wall -Wextra $(SYSCXXFLAGS) $(MYCXXFLAGS)
>>   SYSCXXFLAGS= -mfpu=vfp -DRISCOS
>
> OK, I inserted this in the makefile, and the object files now
> have flag 0x600. However, compilation stopped with this error:
>
> liblua(ldo.o): In function `luaD_throw(lua_State*, int)':
> ldo.c:(.text+0x104): undefined reference to `__cxa_allocate_exception'
> ldo.c:(.text+0x118): undefined reference to `__cxa_throw'
> liblua(ldo.o): In function `luaD_rawrunprotected(lua_State*, void (*)(lua_State*, void*), void*)':
> ldo.c:(.text+0x388): undefined reference to `__cxa_begin_catch'
> ldo.c:(.text+0x39c): undefined reference to `__cxa_end_catch'
> liblua(ldo.o):(.ARM.extab+0x30): undefined reference to `__gxx_personality_v0'
> liblua(ldo.o):(.rodata._ZTIP11lua_longjmp[typeinfo for lua_longjmp*]+0x0): undefined reference to `vtable for __cxxabiv1::__pointer_type_info'
> liblua(ldo.o):(.rodata._ZTI11lua_longjmp[typeinfo for lua_longjmp]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
> collect2: error: ld returned 1 exit status
> makefile:67: recipe for target 'lua6' failed
> make: *** [lua6] Error 1
>
> This is evidently to do with longjump behaviour. I wonder if I can get the
> previous behaviour by setting LUA_USE_C89 or something like that? Is
> there a way of getting cc as the compiler instead of g++?

Probably better to forget what I said about adding CXXFLAGS, etc. It's
linking with gcc rather than g++, hence the missing symbols (no
libstdc++) and that's probably the way is supposed to be.

What you have to figure out is why it's using g++ for that file instead
of gcc. TBH, I can't see anything in the makefile that would explain it.

Lee.





More information about the gcc mailing list