[gccsdk] g++

Gavin Wraith gavin at wra1th.plus.com
Sun Nov 22 07:55:09 PST 2015


> 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

#if !defined(LUA_USE_C89)	/* { */

#if !defined(_XOPEN_SOURCE)
#define _XOPEN_SOURCE           600
#elif _XOPEN_SOURCE == 0
#undef _XOPEN_SOURCE  /* use -D_XOPEN_SOURCE=0 to undefine it */
#endif

/*
** Allows manipulation of large files in gcc and some other compilers
*/
#if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS)
#define _LARGEFILE_SOURCE       1
#define _FILE_OFFSET_BITS       64
#endif

#endif				/* } */

Could this be responsible?

> 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++?

--
Gavin Wraith (gavin at wra1th.plus.com)
Home page: http://www.wra1th.plus.com/




More information about the gcc mailing list