Skip to content

Conversation

@keith-packard
Copy link
Contributor

@keith-packard keith-packard commented Feb 2, 2023

Clang does not have printf return value optimizations like GCC, so there's no flag to turn them off when building against a non-standard printf implementation (e.g., picolibc without float support).

Signed-off-by: Keith Packard keithp@keithp.com

Fixes #54336

Clang does not have printf return value optimizations like GCC, so there's
no flag to turn them off when building against a non-standard printf
implementation (e.g., picolibc without float support).

Signed-off-by: Keith Packard <keithp@keithp.com>
@stephanosio
Copy link
Member

@tejlmand Could you take a quick look?

@laurenmurphyx64
Copy link
Contributor

Hi @keith-packard, thanks for the fix! After cherrypicking this onto your picolibc module update PR #54391, I saw the issue was resolved for our XCC-clang target (intel_adsp_ace15_mtpm)!

Unfortunately our CAVS platforms use XCC. Is there a way to also fix this for XCC?

Commit of picolibc: 2097f26ce | cmake: Disable TLS_MODEL and _HAVE_PICOLIBC_TLS without TLS

$ west build -p -b intel_adsp_cavs15 -T tests/kernel/common/kernel.common.picolibc
Building C object modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-malloc_usable_size.c.obj
FAILED: modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-malloc_usable_size.c.obj 
...
xt-xcc ERROR parsing -fno-printf-return-value:  unknown flag

Errored out with these files:

  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-malloc_usable_size.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-mallopt.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-memalign.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-posix_memalign.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-pvalloc.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libc/stdlib/nano-malloc-realloc.c.obj
  • modules/picolibc/CMakeFiles/c.dir/newlib/libm/complex/csinh.c.obj

@keith-packard
Copy link
Contributor Author

keith-packard commented Feb 3, 2023

xt-xcc ERROR parsing -fno-printf-return-value: unknown flag

Ah, yet another compiler that pretends to be 'just like gcc, but slightly different'. PR #54392 should help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

picolibc is incompatible with xcc / xcc-clang toolchains

7 participants