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

error: inlining failed in call to 'always_inline' in some builds #369

Closed
shr-project opened this issue Apr 30, 2024 · 1 comment · Fixed by #370
Closed

error: inlining failed in call to 'always_inline' in some builds #369

shr-project opened this issue Apr 30, 2024 · 1 comment · Fixed by #370
Labels

Comments

@shr-project
Copy link

Not sure if this is a bug in gcc or in libdeflate, but I came across interesting side effect - build failure after -march was dropped and only -mcpu was kept with:

https://git.openembedded.org/openembedded-core/commit/?h=scarthgap&id=e64f0c1b6ac5d598a79a21de5f3060f83cb9523e

The minimal reproducer for libdeflate for me was:

gcc -mcpu=cortex-a76+crypto \
--sysroot=../recipe-sysroot -I. -o lib/crc32.c.o -c lib/crc32.c

Which fails with:

In file included from lib/lib_common.h:40,
                 from lib/crc32.c:171:
lib/../common_defs.h: In function 'crc32_arm_pmullx12_crc_eor3':
lib/../common_defs.h:513:1: error: inlining failed in call to 'always_inline' 'get_unaligned_le64': target specific option mismatch
  513 | get_unaligned_le64(const u8 *p)
      | ^~~~~~~~~~~~~~~~~~
In file included from lib/arm/crc32_impl.h:564,
                 from lib/crc32.c:226:
lib/arm/crc32_pmull_wide.h:199:23: note: called from here
  199 |                 crc = __crc32d(crc, get_unaligned_le64(p + 24));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/../common_defs.h:513:1: error: inlining failed in call to 'always_inline' 'get_unaligned_le64': target specific option mismatch
  513 | get_unaligned_le64(const u8 *p)
      | ^~~~~~~~~~~~~~~~~~
lib/arm/crc32_pmull_wide.h:198:23: note: called from here
  198 |                 crc = __crc32d(crc, get_unaligned_le64(p + 16));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/../common_defs.h:513:1: error: inlining failed in call to 'always_inline' 'get_unaligned_le64': target specific option mismatch
  513 | get_unaligned_le64(const u8 *p)
      | ^~~~~~~~~~~~~~~~~~
...

While restoring -march builds fine with:

gcc -mcpu=cortex-a76+crypto -march=armv8.2-a+crypto \
--sysroot=../recipe-sysroot -I. -o lib/crc32.c.o -c lib/crc32.c

Interestingly if I use -E and compare preprocess output, then it's identical in both cases (__ARM_FEATURE_CRYPTO, HAVE_PMULL, forceinline are the same). This was with gcc-13.2.0.

@ebiggers
Copy link
Owner

It looks like there's a gcc bug/limitation that got fixed in gcc 13.2, and libdeflate's workaround for that bug/limitation is causing problems on gcc 13.2 and later. #370 should fix this.

@ebiggers ebiggers added the bug label Apr 30, 2024
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue May 5, 2024
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue May 5, 2024
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
…pto without -march=armv8.2-a+crypto

* fixes:
  ebiggers/libdeflate#369

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
halstead pushed a commit to openembedded/meta-openembedded that referenced this issue Jun 2, 2024
…v8.2-a+crypto

* fixes:
  ebiggers/libdeflate#369

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
mmitchel pushed a commit to distro-core-curated-mirrors/meta-openembedded-contrib that referenced this issue Jun 3, 2024
mmitchel pushed a commit to distro-core-curated-mirrors/meta-openembedded-contrib that referenced this issue Jun 3, 2024
…v8.2-a+crypto

* fixes:
  ebiggers/libdeflate#369

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants