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

Targets which use openamp get build errors when configured without any optimization (-O0) #12489

Closed
AndreHeinemans-NXP opened this issue Jun 12, 2024 · 2 comments · Fixed by #12516

Comments

@AndreHeinemans-NXP
Copy link
Contributor

Targets which use openamp need to be configured with an optimization level setting other that -O0 to be compiled correctly.

I tested this with these targets

  • verdin-mx8mp:rpmsg
  • nrf5340-dk:rptun_cpunet
  • nucleo-h745zi:nsh_cm7_rptun

When compiled with -O0 then this linker error appears:

LD: nuttx
arm-none-eabi-ld: /home/andre/projects/nuttx/nuttx/staging/libopenamp.a(remoteproc_virtio.o): in function `metal_io_read':
remoteproc_virtio.c:(.text.metal_io_read+0xe8): undefined reference to `__atomic_load_8'
arm-none-eabi-ld: /home/andre/projects/nuttx/nuttx/staging/libopenamp.a(remoteproc_virtio.o): in function `metal_io_write':
remoteproc_virtio.c:(.text.metal_io_write+0xe0): undefined reference to `__atomic_store_8'
make[1]: *** [Makefile:211: nuttx] Error 1
make: *** [tools/Unix.mk:546: nuttx] Error 2

It's weird that it only fails without any optimization. Maybe it doesn't use HW instructions for atomic operations in that case..? I don't know.

Reproduce:

tools/configure.sh verdin-mx8mp:rpmsg
# or any other target using openamp

make menuconfig
# set 'Optimization Level' to 'Suppress Optimization' =CONFIG_DEBUG_NOOPT

# note: do a make clean if target was already build before since openamp will not be rebuild automatically after running menuconfig

make
@acassis
Copy link
Contributor

acassis commented Jun 13, 2024

@masayuki2009 @xiaoxiang781216 any idea?

@xiaoxiang781216
Copy link
Contributor

@CV-Bowen could you take a look?

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

Successfully merging a pull request may close this issue.

3 participants