Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928936 - >=sys-libs/compiler-rt-sanitizers-17.0.6 fails to compile with musl-1.2.4: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:287:19: error: member access into incomplete type 'struct stat64'
Summary: >=sys-libs/compiler-rt-sanitizers-17.0.6 fails to compile with musl-1.2.4: co...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: musl-1.2.4
  Show dependency tree
 
Reported: 2024-04-08 14:58 UTC by tt_1
Modified: 2024-06-20 17:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed build log (build.log.xz,4.68 KB, application/x-xz)
2024-04-08 14:58 UTC, tt_1
Details
output from emerge --info (emerge-info,5.97 KB, text/plain)
2024-04-08 15:01 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2024-04-08 14:58:29 UTC
Created attachment 889812 [details]
compressed build log

the compiler-rt-sanitizers package fails to compile with musl-1.2.4: 

emerge -pv compiler-rt-sanitzers

[ebuild  N     ] sys-libs/compiler-rt-sanitizers-17.0.6:17::gentoo  USE="asan cfi clang libfuzzer lsan orc profile scudo ubsan xray -debug (-dfsan) -gwp-asan (-hwasan) (-memprof) (-msan) (-safestack) (-shadowcallstack) -test (-tsan) -verify-sig" 0 KiB

leads to this error: 

/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:287:19: error: member access into incomplete type 'struct stat64'
  287 |   out->st_dev = in->st_dev;
      |                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:288:19: error: member access into incomplete type 'struct stat64'
  288 |   out->st_ino = in->st_ino;
      |                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:289:20: error: member access into incomplete type 'struct stat64'
  289 |   out->st_mode = in->st_mode;
      |                    ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:290:21: error: member access into incomplete type 'struct stat64'
  290 |   out->st_nlink = in->st_nlink;
      |                     ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:291:19: error: member access into incomplete type 'struct stat64'
  291 |   out->st_uid = in->st_uid;
      |                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:292:19: error: member access into incomplete type 'struct stat64'
  292 |   out->st_gid = in->st_gid;
      |                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:293:20: error: member access into incomplete type 'struct stat64'
  293 |   out->st_rdev = in->st_rdev;
      |                    ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:294:20: error: member access into incomplete type 'struct stat64'
  294 |   out->st_size = in->st_size;
      |                    ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:295:23: error: member access into incomplete type 'struct stat64'
  295 |   out->st_blksize = in->st_blksize;
      |                       ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:296:22: error: member access into incomplete type 'struct stat64'
  296 |   out->st_blocks = in->st_blocks;
      |                      ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:297:21: error: member access into incomplete type 'struct stat64'
  297 |   out->st_atime = in->st_atime;
      |                     ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:298:21: error: member access into incomplete type 'struct stat64'
  298 |   out->st_mtime = in->st_mtime;
      |                     ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:299:21: error: member access into incomplete type 'struct stat64'
  299 |   out->st_ctime = in->st_ctime;
      |                     ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:391:17: error: variable has incomplete type 'struct stat64'
  391 |   struct stat64 buf64;
      |                 ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:423:17: error: variable has incomplete type 'struct stat64'
  423 |   struct stat64 buf64;
      |                 ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:455:17: error: variable has incomplete type 'struct stat64'
  455 |   struct stat64 buf64;
      |                 ^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:285:35: note: forward declaration of '__sanitizer::stat64'
  285 | static void stat64_to_stat(struct stat64 *in, struct stat *out) {
      |                                   ^
Comment 1 tt_1 2024-04-08 15:01:03 UTC
Created attachment 889813 [details]
output from emerge --info
Comment 2 tt_1 2024-04-08 15:02:58 UTC
I found this llvm pullrequest about fstat redefinition: https://github.com/llvm/llvm-project/pull/86625

but it doesn't fix the issue
Comment 3 Erik Hoppe 2024-04-28 07:50:44 UTC
got the same issue on other 32bit arm targets, aarch64 seems to be fine.

Issue happens due to musl deprecating interfaces, that is supposed to be fixed upstream.
https://wiki.gentoo.org/wiki/Musl_porting_notes#error:_LFS64_interfaces_.28.2A64_undeclared_here.2C_ex._pread64.29

a workaround is to add -D_LARGEFILE64_SOURCE to your CFLAGS.
Comment 4 tt_1 2024-05-16 15:29:48 UTC
Dear LLVM team, can we get -D_LARGEFILE64_SOURCE for a stable candidate of compiler-rt-sanitizers-18.1.x? It fixes the compile error on 32bit musl, thanks.
Comment 5 Larry the Git Cow gentoo-dev 2024-06-16 00:43:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26e7288d58e4e16aa595e03ce5d4e6840df67977

commit 26e7288d58e4e16aa595e03ce5d4e6840df67977
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-16 00:41:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-16 00:41:09 +0000

    profiles/features/musl: mask clang-runtime[sanitize]
    
    Avoid pulling in sys-libs/compiler-rt-sanitizers which fails to build
    
    Bug: https://bugs.gentoo.org/928936
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/features/musl/package.use.mask | 5 +++++
 1 file changed, 5 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2024-06-20 17:43:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44d46e2703d097c49ebfeb48ce753936734d5f66

commit 44d46e2703d097c49ebfeb48ce753936734d5f66
Author:     Violet Purcell <vimproved@inventati.org>
AuthorDate: 2024-06-19 04:07:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-20 17:42:16 +0000

    profiles: only mask clang-runtime[sanitize] on 32-bit musl profiles
    
    The issue in the bug is only an issue on 32-bit musl platforms, not on
    64-bit. The original mask was overzealous, narrow the mask to arm, ppc,
    and x86.
    
    Bug: https://bugs.gentoo.org/928936
    Signed-off-by: Violet Purcell <vimproved@inventati.org>
    Closes: https://github.com/gentoo/gentoo/pull/37212
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/default/linux/arm/23.0/musl/package.use.stable.mask | 5 +++++
 profiles/default/linux/ppc/23.0/musl/package.use.mask        | 7 ++++++-
 profiles/default/linux/x86/23.0/i486/musl/package.use.mask   | 6 +++++-
 profiles/default/linux/x86/23.0/i686/musl/package.use.mask   | 5 +++++
 profiles/features/musl/package.use.mask                      | 5 -----
 5 files changed, 21 insertions(+), 7 deletions(-)