albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
918 stars 159 forks source link

Build fails with GCC 6.1.1 and hardening-wrapper 10 #68

Open maxteufel opened 8 years ago

maxteufel commented 8 years ago

System: Arch Linux

$ cmake ..
-- The C compiler identification is GNU 6.1.1
-- The CXX compiler identification is GNU 6.1.1
-- Check for working C compiler: /usr/lib/hardening-wrapper/bin/cc
-- Check for working C compiler: /usr/lib/hardening-wrapper/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/hardening-wrapper/bin/c++
-- Check for working CXX compiler: /usr/lib/hardening-wrapper/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mteufel/src/squirrel/build
$ make -j1
Scanning dependencies of target squirrel
[  2%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqapi.cpp.o
/home/mteufel/src/squirrel/squirrel/sqapi.cpp: In function ‘SQRESULT sq_setdelegate(HSQUIRRELVM, SQInteger)’:
/home/mteufel/src/squirrel/squirrel/sqapi.cpp:974:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
             if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, _SC("delagate cycle")); v->Pop();}
             ^~
/home/mteufel/src/squirrel/squirrel/sqapi.cpp:974:104: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
             if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, _SC("delagate cycle")); v->Pop();}
                                                                                                        ^
[  4%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqbaselib.cpp.o
[  6%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqclass.cpp.o
In file included from /home/mteufel/src/squirrel/squirrel/sqpcheader.h:16:0,
                 from /home/mteufel/src/squirrel/squirrel/sqclass.cpp:4:
/home/mteufel/src/squirrel/squirrel/sqclass.cpp: In member function ‘virtual bool SQInstance::GetMetaMethod(SQVM*, SQMetaMethod, SQObjectPtr&)’:
/home/mteufel/src/squirrel/squirrel/sqclass.cpp:192:52: warning: unused parameter ‘v’ [-Wunused-parameter]
 bool SQInstance::GetMetaMethod(SQVM* SQ_UNUSED_ARG(v),SQMetaMethod mm,SQObjectPtr &res)
                                                    ^
/home/mteufel/src/squirrel/include/squirrel.h:401:51: note: in definition of macro ‘SQ_UNUSED_ARG’
 # define SQ_UNUSED_ARG(x) __attribute__((unused)) x
                                                   ^
[  8%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqcompiler.cpp.o
[ 10%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqdebug.cpp.o
[ 12%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqfuncstate.cpp.o
[ 14%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqlexer.cpp.o
[ 16%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqmem.cpp.o
[ 18%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqobject.cpp.o
[ 20%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqstate.cpp.o
In file included from /home/mteufel/src/squirrel/squirrel/sqpcheader.h:16:0,
                 from /home/mteufel/src/squirrel/squirrel/sqstate.cpp:4:
/home/mteufel/src/squirrel/squirrel/sqstate.cpp: In member function ‘void SQSharedState::RunMark(SQVM*, SQCollectable**)’:
/home/mteufel/src/squirrel/squirrel/sqstate.cpp:244:49: warning: unused parameter ‘vm’ [-Wunused-parameter]
 void SQSharedState::RunMark(SQVM* SQ_UNUSED_ARG(vm),SQCollectable **tchain)
                                                 ^
/home/mteufel/src/squirrel/include/squirrel.h:401:51: note: in definition of macro ‘SQ_UNUSED_ARG’
 # define SQ_UNUSED_ARG(x) __attribute__((unused)) x
                                                   ^
[ 22%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqtable.cpp.o
[ 25%] Building CXX object squirrel/CMakeFiles/squirrel.dir/sqvm.cpp.o
[ 27%] Linking CXX shared library libsquirrel.so
[ 27%] Built target squirrel
Scanning dependencies of target squirrel_static
[ 29%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqapi.cpp.o
/home/mteufel/src/squirrel/squirrel/sqapi.cpp: In function ‘SQRESULT sq_setdelegate(HSQUIRRELVM, SQInteger)’:
/home/mteufel/src/squirrel/squirrel/sqapi.cpp:974:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
             if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, _SC("delagate cycle")); v->Pop();}
             ^~
/home/mteufel/src/squirrel/squirrel/sqapi.cpp:974:104: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
             if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, _SC("delagate cycle")); v->Pop();}
                                                                                                        ^
[ 31%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqbaselib.cpp.o
[ 33%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqclass.cpp.o
In file included from /home/mteufel/src/squirrel/squirrel/sqpcheader.h:16:0,
                 from /home/mteufel/src/squirrel/squirrel/sqclass.cpp:4:
/home/mteufel/src/squirrel/squirrel/sqclass.cpp: In member function ‘virtual bool SQInstance::GetMetaMethod(SQVM*, SQMetaMethod, SQObjectPtr&)’:
/home/mteufel/src/squirrel/squirrel/sqclass.cpp:192:52: warning: unused parameter ‘v’ [-Wunused-parameter]
 bool SQInstance::GetMetaMethod(SQVM* SQ_UNUSED_ARG(v),SQMetaMethod mm,SQObjectPtr &res)
                                                    ^
/home/mteufel/src/squirrel/include/squirrel.h:401:51: note: in definition of macro ‘SQ_UNUSED_ARG’
 # define SQ_UNUSED_ARG(x) __attribute__((unused)) x
                                                   ^
[ 35%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqcompiler.cpp.o
[ 37%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqdebug.cpp.o
[ 39%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqfuncstate.cpp.o
[ 41%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqlexer.cpp.o
[ 43%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqmem.cpp.o
[ 45%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqobject.cpp.o
[ 47%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqstate.cpp.o
In file included from /home/mteufel/src/squirrel/squirrel/sqpcheader.h:16:0,
                 from /home/mteufel/src/squirrel/squirrel/sqstate.cpp:4:
/home/mteufel/src/squirrel/squirrel/sqstate.cpp: In member function ‘void SQSharedState::RunMark(SQVM*, SQCollectable**)’:
/home/mteufel/src/squirrel/squirrel/sqstate.cpp:244:49: warning: unused parameter ‘vm’ [-Wunused-parameter]
 void SQSharedState::RunMark(SQVM* SQ_UNUSED_ARG(vm),SQCollectable **tchain)
                                                 ^
/home/mteufel/src/squirrel/include/squirrel.h:401:51: note: in definition of macro ‘SQ_UNUSED_ARG’
 # define SQ_UNUSED_ARG(x) __attribute__((unused)) x
                                                   ^
[ 50%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqtable.cpp.o
[ 52%] Building CXX object squirrel/CMakeFiles/squirrel_static.dir/sqvm.cpp.o
[ 54%] Linking CXX static library libsquirrel_static.a
[ 54%] Built target squirrel_static
Scanning dependencies of target sqstdlib
[ 56%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdaux.cpp.o
[ 58%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdblob.cpp.o
[ 60%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdio.cpp.o
[ 62%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdmath.cpp.o
[ 64%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdrex.cpp.o
[ 66%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdstream.cpp.o
[ 68%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdstring.cpp.o
[ 70%] Building CXX object sqstdlib/CMakeFiles/sqstdlib.dir/sqstdsystem.cpp.o
[ 72%] Linking CXX shared library libsqstdlib.so
[ 72%] Built target sqstdlib
Scanning dependencies of target sqstdlib_static
[ 75%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdaux.cpp.o
[ 77%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdblob.cpp.o
[ 79%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdio.cpp.o
[ 81%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdmath.cpp.o
[ 83%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdrex.cpp.o
[ 85%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdstream.cpp.o
[ 87%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdstring.cpp.o
[ 89%] Building CXX object sqstdlib/CMakeFiles/sqstdlib_static.dir/sqstdsystem.cpp.o
[ 91%] Linking CXX static library libsqstdlib_static.a
[ 91%] Built target sqstdlib_static
Scanning dependencies of target sq
[ 93%] Building C object sq/CMakeFiles/sq.dir/sq.c.o
[ 95%] Linking C executable sq
[ 95%] Built target sq
Scanning dependencies of target sq_static
[ 97%] Building C object sq/CMakeFiles/sq_static.dir/sq.c.o
[100%] Linking C executable sq_static
/usr/bin/ld: CMakeFiles/sq_static.dir/sq.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [sq/CMakeFiles/sq_static.dir/build.make:97: sq/sq_static] Error 1
make[1]: *** [CMakeFiles/Makefile2:315: sq/CMakeFiles/sq_static.dir/all] Error 2
make: *** [Makefile:128: all] Error 2
(returned 2)
markus-oberhumer-forks commented 8 years ago

Could you try if my branch "travis" at https://github.com/mfxmfx/squirrel/tree/travis works better?

   git clone https://github.com/mfxmfx/squirrel.git -b travis
   cd squirrel && mkdir build && cd build
   cmake ..
   make

Otherwise please try running

make clean; make VERBOSE=1

so that we can see which compiler flags you are actually using.

maxteufel commented 8 years ago

It still doesn't work with that branch, @mfxmfx.

Build logs for both master and @mfxmfx travis with VERBOSE=1: https://gist.github.com/maxteufel/d88c9f5146f7a165b765318ed88adf54