eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.08k stars 444 forks source link

CxxParser compile fixes for linux etc #3370

Closed UffeJakobsen closed 1 month ago

Jarod42 commented 1 month ago

What is missing from CI to spot the issue? (I don't have nix/apple to test locally :-/ so sorry for the break).

UffeJakobsen commented 1 month ago

What is missing from CI to spot the issue? (I don't have nix/apple to test locally :-/ so sorry for the break).

I'm using Archlinux - so I guess that I have newer GCC and Clang - it can be reproduced with both - see below

-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.1
....
/usr/bin/ld: lib/liblibCxxParser.a(cpp_func_parser.cpp.o): warning: relocation against `vtable for clFunction' in read-only section `.text._ZN10clFunctionC2ERKS_[clFunction::clFunction(clFunction const&)]'
/usr/bin/ld: lib/liblibCxxParser.a(cpp.cpp.o): relocation R_X86_64_PC32 against symbol `cl_scope_in' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
....
/usr/bin/ld: lib/liblibCxxParser.a(cpp.cpp.o): warning: relocation against `cl_scope_lineno' in read-only section `.text'
/usr/bin/ld: lib/liblibCxxParser.a(cpp.cpp.o): relocation R_X86_64_PC32 against symbol `cl_scope_in' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Both compilers use GNU ld (GNU Binutils) 2.42.0

Jarod42 commented 1 month ago

Add the equivalent fix for GdbParser part in #3372