QBS, how to remove -fPIC option
Solved
Qt Creator and other tools
-
I'm trying to use QBS to build an embedded non-Qt application using (arm-elf-gcc).
So far everything seems ok except that QBS adds-fPIC
when compiling c files to object files which later make the link step return an error. If I manually execute tha same commands than QBS, without the-fPIC
flag it works fine.I've looked the documentation, but I can't find a way to tell QBS not to set this flag.
-
I've found the response.
There is apositionIndependentCode
property in the cpp module.
So on can remove-fPIC
by addingcpp.positionIndependentCode: false
.This property is supposed to be undefined by default, but it seems to resolve to true for my toolchain.