Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with Qt Creator 4.x #4

Open
n6hpa opened this issue May 26, 2017 · 1 comment
Open

Does not work with Qt Creator 4.x #4

n6hpa opened this issue May 26, 2017 · 1 comment

Comments

@n6hpa
Copy link

n6hpa commented May 26, 2017

Hi There,

I am trying to get this running with Qt Creator 4.3. I was able to get this working with older versions of Qt Creator, but with 4.3 I get the following linker error:

helloworld-stm32f4-Debug/qtc_stm32f4_b337530f-debug/Hello-World-.qtc-stm32f4-b337530f.b023bda8/.obj/e64ca3ddddfee403/stm32f4xx_tim.c.o /Users/n6hpa/dev/build-helloworld-stm32f4-Debug/qtc_stm32f4_b337530f-debug/Hello-World-.qtc-stm32f4-b337530f.b023bda8/.obj/e64ca3ddddfee403/stm32f4xx_usart.c.o /Users/n6hpa/dev/build-helloworld-stm32f4-Debug/qtc_stm32f4_b337530f-debug/Hello-World-.qtc-stm32f4-b337530f.b023bda8/.obj/e64ca3ddddfee403/stm32f4xx_wwdg.c.o
/Users/n6hpa/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: unrecognised emulation mode: thumb
Supported emulations: armelf
collect2: error: ld returned 1 exit status

Any idea what is causing this? Google has failed me so far...

@nlhans
Copy link
Owner

nlhans commented Sep 9, 2017

I could not reproduce this at first because I was using older versions on Ubuntu LTS. Recently I've upgraded and I was able to reproduce.

It turns out later versions of QBS is escaping linker commands al the time. This meant that information about chip architectures was not given correctly.
The fix is to use driverFlags instead.
cpp.driverFlags: [ "-mcpu=cortex-m4", "-mfloat-abi=hard", "-mfpu=fpv4-sp-d16", "-mthumb" ]

You can place this in the Qbs file nearby the linkerFlags definition. Then remove these definitions from the linkerFlags as they are redundant. I'm still investigating if I can streamline more of the QBS by this, because I believe driverFlags is given to any compiler command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants