[Qbs] qbs ignores the 'manual' cpp.linkerMode behavior

timur.kristof at gmail.com timur.kristof at gmail.com
Mon Oct 9 22:40:48 CEST 2017


Hi Denis,

This issue has been asked several times.
The short answer is this: put the real linker flags without -Wl into
linkerFlags and put the other ones into driverFlags.

linkerName and linkerMode are uneeded (as far as I know).

Here is an example of how I did it:
https://github.com/Venemo/efm32-qbs-example/blob/master/qbs-custom/impo
rts/ArmMcuProduct.qbs



Hope this helps,
Timur

On Mon, 2017-10-09 at 18:32 +0300, Denis Shienkov wrote:
> Hi all,
> 
> I use the AVR-GCC compiler, and I need to use following command line:
> 
> "-nostartfiles -nodefaultlibs -nostdlib -Wl,-
> Map="$(OutputFileName).map" -Wl,--start-group -Wl,-lm  -Wl,--end-
> group -Wl,--gc-sections -mrelax -Wl,-section-start=.text=0x1f400
> -Wl,-section-start=.ExtReset=0x1e000  -Wl,-section-
> start=.noinit=0x801032  -mmcu=at90can128 -B "C:\Program Files
> (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\gcc\dev\at90can
> 128" "
> 
> but, the qbs is too 'intelligent' and generates a wrong command line
> for this options:
> 
> cpp.linkerMode: "manual"
> cpp.linkerName: cpp.compilerName
> 
> cpp.linkerFlags: [
>         "-nostartfiles",
>         "-nodefaultlibs",
>         "-nostdlib",
>         "-Wl,-Map=" + product.targetName + ".map",
>         "-Wl,--start-group",
>         "-Wl,--end-group",
>         "-Wl,--gc-sections",
>         "-Wl,-section-start=.text=0x1f400",
>         "-Wl,-section-start=.ExtReset=0x1e000",
>         "-Wl,-section-start=.noinit=0x801032",
>         "-Wc,-mmcu=" + avrdevice,
>         "-B",
>         "C:/Program Files
> (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.2.132/gcc/dev/" +
> avrdevice,
>         "-mrelax",
>     ]
> 
> resulting line looks like:
> 
> "
> "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-
> toolchain\bin\avr-gcc.exe" -Xlinker -nostartfiles -Xlinker
> -nodefaultlibs -Xlinker -nostdlib -Xlinker "-Wl,-Map=monitorapp.map"
> -Xlinker "-Wl,--start-group" -Xlinker "-Wl,--end-group" -Xlinker "-
> Wl,--gc-sections" -Xlinker "-Wl,-section-start=.text=0x1f400"
> -Xlinker "-Wl,-section-start=.ExtReset=0x1e000" -Xlinker "-Wl,-
> section-start=.noinit=0x801032" -Xlinker "-Wc,-mmcu=at90can128"
> -Xlinker -B -Xlinker "C:/Program Files
> (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.2.132/gcc/dev/at90can
> 128" -Xlinker -mrelax
> "
> it insert еру -XLinker flags everywhere...
> 
> How to disable an 'intelligent' feature ?
> 
> BR,
> Denis
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs



More information about the Qbs mailing list