Skip to content

Conversation

@galak
Copy link
Contributor

@galak galak commented Sep 17, 2020

TOOLCHAIN_LD_FLAGS gets passed to zephyr_ld_options() that will call
zephyr_check_compiler_flag(). Current zephyr_check_compiler_flag()
fails on RISC-V for -mabi/-march as the compiler expects them to be
set together. To make this work we quote them together so they'll
get treated as a single option rather than two distinct options.

Doing the same for TOOLCHAIN_C_FLAGS isn't required and actually
doesn't work because target_compile_options will end up keeping
the quoting.

Fixes #28456

Signed-off-by: Kumar Gala [email protected]

@galak galak added area: RISCV RISCV Architecture (32-bit & 64-bit) bug The issue is a bug, or the PR is fixing a bug labels Sep 17, 2020
TOOLCHAIN_LD_FLAGS gets passed to zephyr_ld_options() that will call
zephyr_check_compiler_flag().  Current zephyr_check_compiler_flag()
fails on RISC-V for -mabi/-march as the compiler expects them to be
set together.  To make this work we quote them together so they'll
get treated as a single option rather than two distinct options.

Doing the same for TOOLCHAIN_C_FLAGS isn't required and actually
doesn't work because target_compile_options will end up keeping
the quoting.

Fixes zephyrproject-rtos#28456

Signed-off-by: Kumar Gala <[email protected]>
@tejlmand
Copy link
Contributor

@galak Thanks for this.

This was actually discussed here: #26545 (comment)

I actually has a cleaner fix ready, but seems I missed to create a PR with it:
tejlmand@bb2f2b9

This avoids the need to depend on quotes which could lead to other issues at a later time.

@tejlmand
Copy link
Contributor

tejlmand commented Sep 18, 2020

placed alternative solution here: #28500

@galak
Copy link
Contributor Author

galak commented Sep 18, 2020

Closing this in favor of #28500

@galak galak closed this Sep 18, 2020
@galak galak deleted the riscv-ld-fix branch September 18, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System area: RISCV RISCV Architecture (32-bit & 64-bit) bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TOOLCHAIN_LD_FLAGS setting of -mabi/-march aren't propagated to linker invocation on RISC-V

2 participants