View previous topic :: View next topic |
Author |
Message |
guyuming Apprentice
Joined: 19 Nov 2020 Posts: 247
|
Posted: Wed Dec 18, 2024 7:58 am Post subject: how to add -fPIC into cmake ebuild |
|
|
i am trying to create an ebuild for https://github.com/arangodb/linenoise-ng and reference that library in my code.
when compile my code, i get what follows:
Code: |
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/liblinenoise.a(linenoise.cpp.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC |
I think i need to add -fPIC into my ebuild for linenoise-ng which inherit cmake.eclass
I tried what follows, but it does not seem to work.
Code: |
src_configure() {
local mycmakeargs=(
-DCMAKE_CXX_FLAGS_RELEASE="-fPIC"
)
cmake_src_configure
}
|
or
Code: |
-DCMAKE_CXX_FLAGS_RELEASE+="-fPIC" |
|
|
Back to top |
|
|
nicop Tux's lil' helper
Joined: 10 Apr 2014 Posts: 103
|
Posted: Wed Dec 18, 2024 10:15 am Post subject: |
|
|
you can use before cmake_src_configure :
append-cflags -fPIC
it needs inherit flag-o-matic
or something like
-DCMAKE_C_FLAGS_RELEASE="${CFLAGS} -fPIC" ? |
|
Back to top |
|
|
|