[Qbs] Passing unescaped flags to the linker

Timur Kristóf timur.kristof at gmail.com
Thu Nov 2 11:19:11 CET 2017


>> Yes, that is a bit of a problem. We really need cpp.linkerDriverFlags with
>> the semantics "flags to pass only when linking using the compiler binary".
>> The need for that has been debated in the past, but I think the case is
>> pretty clear now. Could you please create a task for that at
>> bugreports.qt.io, citing your use case?

This exact same issue comes up twice every month on this mailing list,
so I think the documentation could be improved, maybe the cpp module
docs could explain better what linkerFlags and driverFlags do.
Would also be nice to see a new linkerDriverFlags property which could
indeed ease this problem.


> For instance I need to pass "--specs=nano.specs" to g++. If I put it
> in cpp.linkerFlags it does
> not work as qbs will escape it with "-Wl". I can put it in
> cpp.driverFlags, but then it get passed
> to every call to g++ which is useless

Those flags may not be necessary for the compiler, but they won't hurt either.

> and generates warning when using
> Clang Static Analyzer

How do you use the Clang Static Analyzer? I tried too, and for me it
does not complain about those flags. Maybe we use it differently or
use a different version?

Best regards,

More information about the Qbs mailing list