Skip to content

Instantly share code, notes, and snippets.

@soimort
Created March 23, 2015 03:33
Show Gist options
  • Save soimort/6f5e75050ee7fbb7c117 to your computer and use it in GitHub Desktop.
Save soimort/6f5e75050ee7fbb7c117 to your computer and use it in GitHub Desktop.
Compiling CppSharp on Linux
➜ build git:(master) make -C gmake config=release_x64
make: Entering directory `/home/soimort/Source/CppSharp/build/gmake'
==== Building CppSharp.AST (release_x64) ====
Creating ../lib/Release_x64
Creating ../obj/x64/Release/CppSharp.AST
==== Building CppSharp.Runtime (release_x64) ====
Creating ../obj/x64/Release/CppSharp.Runtime
==== Building CppSharp.CppParser (release_x64) ====
Creating ../obj/x64/Release/CppSharp.CppParser
AST.cpp
In file included from ../../../src/CppParser/AST.cpp:8:0:
../../../src/CppParser/AST.h:797:19: warning: declaration of ‘CppSharp::CppParser::AST::MacroLocation CppSharp::CppParser::AST::PreprocessedEntity::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:783:12: warning: changes meaning of ‘MacroLocation’ from ‘enum class CppSharp::CppParser::AST::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:836:14: warning: declaration of ‘CppSharp::CppParser::AST::ArchType CppSharp::CppParser::AST::NativeLibrary::ArchType’ [-fpermissive]
../../../src/CppParser/AST.h:824:12: warning: changes meaning of ‘ArchType’ from ‘enum class CppSharp::CppParser::AST::ArchType’ [-fpermissive]
Comments.cpp
In file included from ../../../src/CppParser/CppParser.h:10:0,
from ../../../src/CppParser/Parser.h:20,
from ../../../src/CppParser/Comments.cpp:8:
../../../src/CppParser/AST.h:797:19: warning: declaration of ‘CppSharp::CppParser::AST::MacroLocation CppSharp::CppParser::AST::PreprocessedEntity::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:783:12: warning: changes meaning of ‘MacroLocation’ from ‘enum class CppSharp::CppParser::AST::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:836:14: warning: declaration of ‘CppSharp::CppParser::AST::ArchType CppSharp::CppParser::AST::NativeLibrary::ArchType’ [-fpermissive]
../../../src/CppParser/AST.h:824:12: warning: changes meaning of ‘ArchType’ from ‘enum class CppSharp::CppParser::AST::ArchType’ [-fpermissive]
In file included from ../../../src/CppParser/Parser.h:20:0,
from ../../../src/CppParser/Comments.cpp:8:
../../../src/CppParser/CppParser.h:60:21: warning: declaration of ‘CppSharp::CppParser::LanguageVersion CppSharp::CppParser::ParserOptions::LanguageVersion’ [-fpermissive]
../../../src/CppParser/CppParser.h:18:12: warning: changes meaning of ‘LanguageVersion’ from ‘enum class CppSharp::CppParser::LanguageVersion’ [-fpermissive]
CppParser.cpp
In file included from ../../../src/CppParser/CppParser.h:10:0,
from ../../../src/CppParser/CppParser.cpp:8:
../../../src/CppParser/AST.h:797:19: warning: declaration of ‘CppSharp::CppParser::AST::MacroLocation CppSharp::CppParser::AST::PreprocessedEntity::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:783:12: warning: changes meaning of ‘MacroLocation’ from ‘enum class CppSharp::CppParser::AST::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:836:14: warning: declaration of ‘CppSharp::CppParser::AST::ArchType CppSharp::CppParser::AST::NativeLibrary::ArchType’ [-fpermissive]
../../../src/CppParser/AST.h:824:12: warning: changes meaning of ‘ArchType’ from ‘enum class CppSharp::CppParser::AST::ArchType’ [-fpermissive]
In file included from ../../../src/CppParser/CppParser.cpp:8:0:
../../../src/CppParser/CppParser.h:60:21: warning: declaration of ‘CppSharp::CppParser::LanguageVersion CppSharp::CppParser::ParserOptions::LanguageVersion’ [-fpermissive]
../../../src/CppParser/CppParser.h:18:12: warning: changes meaning of ‘LanguageVersion’ from ‘enum class CppSharp::CppParser::LanguageVersion’ [-fpermissive]
Parser.cpp
In file included from ../../../src/CppParser/CppParser.h:10:0,
from ../../../src/CppParser/Parser.h:20,
from ../../../src/CppParser/Parser.cpp:12:
../../../src/CppParser/AST.h:797:19: warning: declaration of ‘CppSharp::CppParser::AST::MacroLocation CppSharp::CppParser::AST::PreprocessedEntity::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:783:12: warning: changes meaning of ‘MacroLocation’ from ‘enum class CppSharp::CppParser::AST::MacroLocation’ [-fpermissive]
../../../src/CppParser/AST.h:836:14: warning: declaration of ‘CppSharp::CppParser::AST::ArchType CppSharp::CppParser::AST::NativeLibrary::ArchType’ [-fpermissive]
../../../src/CppParser/AST.h:824:12: warning: changes meaning of ‘ArchType’ from ‘enum class CppSharp::CppParser::AST::ArchType’ [-fpermissive]
In file included from ../../../src/CppParser/Parser.h:20:0,
from ../../../src/CppParser/Parser.cpp:12:
../../../src/CppParser/CppParser.h:60:21: warning: declaration of ‘CppSharp::CppParser::LanguageVersion CppSharp::CppParser::ParserOptions::LanguageVersion’ [-fpermissive]
../../../src/CppParser/CppParser.h:18:12: warning: changes meaning of ‘LanguageVersion’ from ‘enum class CppSharp::CppParser::LanguageVersion’ [-fpermissive]
Sources.cpp
VSLookup.cpp
Linking CppSharp.CppParser
==== Building CppSharp.Parser.CSharp (release_x64) ====
Creating ../obj/x64/Release/CppSharp.Parser.CSharp
../../../src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs(1716,41): warning CS0661: `CppSharp.Parser.AST.TemplateParameter' defines operator == or operator != but does not override Object.GetHashCode()
../../../src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs(1716,41): warning CS0659: `CppSharp.Parser.AST.TemplateParameter' overrides Object.Equals(object) but does not override Object.GetHashCode()
Compilation succeeded - 2 warning(s)
==== Building CppSharp (release_x64) ====
Creating ../obj/x64/Release/CppSharp
==== Building CppSharp.Generator (release_x64) ====
Creating ../obj/x64/Release/CppSharp.Generator
==== Building CppSharp.Generator.Tests (release_x64) ====
Creating ../obj/x64/Release/CppSharp.Generator.Tests
==== Building NamespacesBase.Native (release_x64) ====
Creating ../obj/x64/Release/NamespacesBase.Native
NamespacesBase.cpp
Linking NamespacesBase.Native
==== Building NamespacesBase.Gen (release_x64) ====
Creating ../obj/x64/Release/NamespacesBase.Gen
==== Building NamespacesBase.CSharp (release_x64) ====
Creating ../obj/x64/Release/NamespacesBase.CSharp
Running prebuild commands
mono --debug "../lib/Release_x64/NamespacesBase.Gen.exe"
Generating bindings for NamespacesBase (CSharp)
Looking for tests in: /home/soimort/Source/CppSharp/tests/NamespacesBase
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) CppSharp.Parser.ClangParser/Internal.ParseHeader_0 (intptr) <IL 0x00011, 0xffffffff>
at CppSharp.Parser.ClangParser.ParseHeader (CppSharp.Parser.ParserOptions) [0x0001f] in /home/soimort/Source/CppSharp/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs:1027
at CppSharp.ClangParser.ParseSourceFile (CppSharp.SourceFile) [0x00021] in /home/soimort/Source/CppSharp/src/Core/Parser/Parser.cs:57
at CppSharp.ClangParser.ParseProject (CppSharp.Project) [0x0001c] in /home/soimort/Source/CppSharp/src/Core/Parser/Parser.cs:72
at CppSharp.Driver.ParseCode () [0x00035] in /home/soimort/Source/CppSharp/src/Generator/Driver.cs:202
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary) [0x000af] in /home/soimort/Source/CppSharp/src/Generator/Driver.cs:431
at CppSharp.Tests.NamespacesBase.Main (string[]) [0x00007] in /home/soimort/Source/CppSharp/tests/NamespacesBase/NamespacesBase.cs:33
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>
Native stacktrace:
mono(mono_handle_native_sigsegv+0xcc) [0x4c7a8c]
mono(mono_arch_handle_altstack_exception+0xde) [0x51cf0e]
mono(mono_sigsegv_signal_handler+0x10d) [0x44f3bd]
/lib/libpthread.so.0(+0xf140) [0x7fb527ed2140]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(+0x5465f8) [0x7fb51d87d5f8]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZNK5clang13SourceManager25isBeforeInTranslationUnitENS_14SourceLocationES1_+0xab) [0x7fb51ec6ceab]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang19PreprocessingRecord21addPreprocessedEntityEPNS_18PreprocessedEntityE+0xec) [0x7fb51ec1cf8c]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang19PreprocessingRecord12MacroDefinedERKNS_5TokenEPKNS_14MacroDirectiveE+0xc9) [0x7fb51ec1e169]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang12Preprocessor21HandleDefineDirectiveERNS_5TokenEb+0xd52) [0x7fb51ebf56c2]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang12Preprocessor15HandleDirectiveERNS_5TokenE+0x50c) [0x7fb51ebf114c]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang5Lexer16LexTokenInternalERNS_5TokenEb+0x265e) [0x7fb51ebc599e]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang5Lexer3LexERNS_5TokenE+0xd8) [0x7fb51ebc1f38]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang12Preprocessor3LexERNS_5TokenE+0x6b) [0x7fb51ec2525b]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(+0xcadffb) [0x7fb51dfe4ffb]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang6Parser10InitializeEv+0x819) [0x7fb51dfe6ec9]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN5clang8ParseASTERNS_4SemaEbb+0xf3) [0x7fb51dfe2653]
/home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN8CppSharp9CppParser6Parser11ParseHeaderERKSsPNS0_12ParserResultE+0x3cd) [0x7fb51d87c57d]
[0x4048a570]
Debug info from gdb:
Mono support loaded.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7fb527302700 (LWP 3121)]
0x00007fb527ed1d17 in waitpid () from /lib/libpthread.so.0
Id Target Id Frame
2 Thread 0x7fb527302700 (LWP 3121) "Finalizer" 0x00007fb527ed0860 in sem_wait () from /lib/libpthread.so.0
* 1 Thread 0x7fb5289c7780 (LWP 3120) "mono" 0x00007fb527ed1d17 in waitpid () from /lib/libpthread.so.0
Thread 2 (Thread 0x7fb527302700 (LWP 3121)):
#0 0x00007fb527ed0860 in sem_wait () from /lib/libpthread.so.0
#1 0x0000000000647a98 in mono_sem_wait (sem=sem@entry=0x970b40, alertable=alertable@entry=1) at mono-semaphore.c:101
#2 0x00000000005cbbbe in finalizer_thread (unused=<optimized out>) at gc.c:1093
#3 0x00000000005ad288 in start_wrapper_internal (data=<optimized out>) at threads.c:664
#4 start_wrapper (data=<optimized out>) at threads.c:711
#5 0x000000000064d616 in inner_start_thread (arg=0x7fff9e04fcb0) at mono-threads-posix.c:93
#6 0x00007fb527ecae0e in start_thread () from /lib/libpthread.so.0
#7 0x00007fb527c061ed in clone () from /lib/libc.so.6
Thread 1 (Thread 0x7fb5289c7780 (LWP 3120)):
#0 0x00007fb527ed1d17 in waitpid () from /lib/libpthread.so.0
#1 0x00000000004c7b14 in mono_handle_native_sigsegv (signal=signal@entry=11, ctx=ctx@entry=0x7fb5289f3ac0, info=info@entry=0x7fb5289f3bf0) at mini-exceptions.c:2346
#2 0x000000000051cf0e in mono_arch_handle_altstack_exception (sigctx=sigctx@entry=0x7fb5289f3ac0, siginfo=siginfo@entry=0x7fb5289f3bf0, fault_addr=<optimized out>, stack_ovf=stack_ovf@entry=0) at exceptions-amd64.c:851
#3 0x000000000044f3bd in mono_sigsegv_signal_handler (_dummy=11, _info=0x7fb5289f3bf0, context=0x7fb5289f3ac0) at mini-runtime.c:2448
#4 <signal handler called>
#5 0x00007fb51d87d5f8 in clang::SourceManager::getDecomposedLoc (this=0x4d, Loc=...) at ../../../deps/llvm/tools/clang/include/clang/Basic/SourceManager.h:1095
#6 0x00007fb51ec6ceab in clang::SourceManager::isBeforeInTranslationUnit(clang::SourceLocation, clang::SourceLocation) const () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#7 0x00007fb51ec1cf8c in clang::PreprocessingRecord::addPreprocessedEntity(clang::PreprocessedEntity*) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#8 0x00007fb51ec1e169 in clang::PreprocessingRecord::MacroDefined(clang::Token const&, clang::MacroDirective const*) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#9 0x00007fb51ebf56c2 in clang::Preprocessor::HandleDefineDirective(clang::Token&, bool) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#10 0x00007fb51ebf114c in clang::Preprocessor::HandleDirective(clang::Token&) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#11 0x00007fb51ebc599e in clang::Lexer::LexTokenInternal(clang::Token&, bool) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#12 0x00007fb51ebc1f38 in clang::Lexer::Lex(clang::Token&) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#13 0x00007fb51ec2525b in clang::Preprocessor::Lex(clang::Token&) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#14 0x00007fb51dfe4ffb in clang::Parser::ConsumeToken() () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#15 0x00007fb51dfe6ec9 in clang::Parser::Initialize() () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#16 0x00007fb51dfe2653 in clang::ParseAST(clang::Sema&, bool, bool) () from /home/soimort/Source/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
#17 0x00007fb51d87c57d in CppSharp::CppParser::Parser::ParseHeader (this=0x1dec960, File=..., res=0x1de27e0) at ../../../src/CppParser/Parser.cpp:3146
#18 0x000000004048a570 in ?? ()
#19 0x0000000001821e70 in ?? ()
#20 0x00007fff9e04fe80 in ?? ()
#21 0x00007fb526c16f28 in ?? ()
#22 0x00007fb526c17100 in ?? ()
#23 0x0000000001de1840 in ?? ()
#24 0x00000000017f9b40 in ?? ()
#25 0x000000004048a4fa in ?? ()
#26 0x00007fff9e04f9b0 in ?? ()
#27 0x00007fff9e04f8b0 in ?? ()
#28 0x000000004048a494 in ?? ()
#29 0x00007fff9e04fe80 in ?? ()
#30 0x00007fb526c16f28 in ?? ()
#31 0x00007fb526c16f28 in ?? ()
#32 0x0000000001de1840 in ?? ()
#33 0x00007fff9e04f9b0 in ?? ()
#34 0x000000004048a3a4 in ?? ()
#35 0x00007fb526c17100 in ?? ()
#36 0x00007fb526c01310 in ?? ()
#37 0x000000004048a340 in ?? ()
#38 0x0000000001de6f70 in ?? ()
#39 0x00007fb526c16f90 in ?? ()
#40 0x00007fb526c16f90 in ?? ()
#41 0x00007fff9e04f9b0 in ?? ()
#42 0x000000004048a18c in ?? ()
#43 0x0000000000000000 in ?? ()
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
make[1]: *** [prebuild] Aborted
make: *** [NamespacesBase.CSharp] Error 2
make: Leaving directory `/home/soimort/Source/CppSharp/build/gmake'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment