Summary: | sys-devel/gcc-12.2.1_p20230121-r1[sanitize] - .../sanitizer_common/sanitizer_linux.cpp: In function 'void __sanitizer::GetPcSpBp(void*, uptr*, uptr*, uptr*)': .../sanitizer_linux.cpp:2074:31: error: 'struct mcontext_t' has no member named 'regs' (on musl) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | ernsteiswuerfel <erhard_f> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | dflogeras2, herrtimson, sam |
Priority: | Normal | Keywords: | PMASKED |
Version: | unspecified | ||
Hardware: | PPC | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=920630 https://bugs.gentoo.org/show_bug.cgi?id=893654 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 430702 | ||
Attachments: |
build.log.xz
emerge --info build.log.xz (ppc64, 12.2.1_p20230121-r1) build.log.xz (ppc64, 13.0.1_pre20230122) |
Created attachment 849239 [details]
emerge --info
Didn't hit on amd64 so I'm guessing ppc specific given the issues we've had with context before? Out of interest, is 13 okay? (In reply to Sam James from comment #2) > Didn't hit on amd64 so I'm guessing ppc specific given the issues we've had > with context before? Didn't happen on my amd64 boxes either. Only on musl ppc so far but I have to check musl ppc64 yet. Also did not try GCC 13 yet, but I could have a look on it the next few days. Will report back here. Created attachment 849289 [details]
build.log.xz (ppc64, 12.2.1_p20230121-r1)
Same on ppc64.
Created attachment 849309 [details] build.log.xz (ppc64, 13.0.1_pre20230122) (In reply to Sam James from comment #3) > Out of interest, is 13 okay? Same issue with GCC 13 (ppc64) as it turns out. [2023-01-28T00:55:20+0000] <@sam_> it should be the same sort of thing as with gnulib before [2023-01-28T00:55:29+0000] <@sam_> something is assuming the layout of mcontext_t, need to ifdef [2023-01-28T01:03:46+0000] <+gyakovlev> that sounds familiar wrt regs, we had that patch somewhere, can't remember where. [2023-01-28T01:04:32+0000] <+gyakovlev> aha grep/diffutils [2023-01-28T01:20:53+0000] <+gyakovlev> some explanations are here btw, helpful [2023-01-28T01:20:53+0000] <+gyakovlev> https://www.openwall.com/lists/musl/2018/02/22/1 [2023-01-28T01:24:53+0000] <+gyakovlev> sorry I would not be able to dig it, enotime. [2023-01-28T01:24:53+0000] <+gyakovlev> but your assessment is spot on. [2023-01-28T01:24:53+0000] <+gyakovlev> https://github.com/gcc-mirror/gcc/blob/master/libsanitizer/sanitizer_common/sanitizer_linux.cpp#L2175 [2023-01-28T01:24:53+0000] <+gyakovlev> something around here has to be ifdefed and replaced with musl/kernel compatible layout behind ifdef. https://cgit.adelielinux.org/packages/tree/system/gcc/401-libsanitizer-linux.patch?id=0dd86764f0e6c25e6f6e6f38c72c35f4d34d6988 is likely relevant but can't try it yet (hitting an unrelated issue) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71fed2eb85ab1c869705fb7ce8ed0bc9248886b8 commit 71fed2eb85ab1c869705fb7ce8ed0bc9248886b8 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-29 21:58:41 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-29 21:58:41 +0000 profiles/default/linux: mask sys-devel/gcc[sanitize] on musl ppc* profiles mcontext parts of libsanitizer need porting. Bug: https://bugs.gentoo.org/892079 Signed-off-by: Sam James <sam@gentoo.org> profiles/default/linux/ppc/17.0/musl/package.use.mask | 7 +++++++ profiles/default/linux/ppc64/17.0/musl/package.use.mask | 7 ++++++- profiles/default/linux/ppc64le/17.0/musl/package.use.mask | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) I think arm will need a second pass as well. Failed with a whole bunch of these /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1442:64: error: static assertion failed 1442 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ 1443 | sizeof(((CLASS *)NULL)->MEMBER)); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") | ^~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:1044:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET' 1044 | CHECK_SIZE_AND_OFFSET(dirent, d_ino); | ^~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1442:64: note: the comparison reduces to '(4 == 8)' 1442 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ 1443 | sizeof(((CLASS *)NULL)->MEMBER)); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") | ^~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:1044:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET' 1044 | CHECK_SIZE_AND_OFFSET(dirent, d_ino); | ^~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1442:64: error: static assertion failed 1442 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ 1443 | sizeof(((CLASS *)NULL)->MEMBER)); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") | ^~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:1050:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET' 1050 | CHECK_SIZE_AND_OFFSET(dirent, d_off); | ^~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1442:64: note: the comparison reduces to '(4 == 8)' 1442 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ 1443 | sizeof(((CLASS *)NULL)->MEMBER)); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") | ^~~~ /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:1050:1: note: in expansion of macro 'CHECK_SIZE_AND_OFFSET' 1050 | CHECK_SIZE_AND_OFFSET(dirent, d_off); | ^~~~~~~~~~~~~~~~~~~~~ (In reply to David Flogeras from comment #10) > I think arm will need a second pass as well. Failed with a whole bunch of > these > > /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/ > libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1442:64: > error: static assertion failed > 1442 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ > 1443 | sizeof(((CLASS *)NULL)->MEMBER)); \ > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This looks different. There's a very specific problem wrt powerpc because of mcontext being wrong. Could you file a new bug for this please with the full build.log & emerge --info? I may need the full GCC log tarball it creates too. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a3ff0fc1159b74ad7be0f6be28d9ab53bbc76aa commit 5a3ff0fc1159b74ad7be0f6be28d9ab53bbc76aa Author: Sam James <sam@gentoo.org> AuthorDate: 2023-02-08 21:40:20 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-02-08 21:40:20 +0000 profiles/default/linux/arm/17.0/musl: mask sys-devel/gcc[sanitize] Bug: https://bugs.gentoo.org/892079 Signed-off-by: Sam James <sam@gentoo.org> profiles/default/linux/arm/17.0/musl/package.use.mask | 9 +++++++++ 1 file changed, 9 insertions(+) (the arm issue is now reported as bug 893654.) |
Created attachment 849237 [details] build.log.xz Building gcc-12.2.1_p20230121-r1 with +sanitize errors out on several occasions: $ grep error: gcc-12.2.1_p20230121-r1\:20230125-201411.log /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2074:31: error: 'struct mcontext_t' has no member named 'regs'; did you mean 'gregs'? /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2075:31: error: 'struct mcontext_t' has no member named 'regs'; did you mean 'gregs'? /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2075:41: error: 'PT_R1' was not declared in this scope /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2078:31: error: 'struct mcontext_t' has no member named 'regs'; did you mean 'gregs'? /var/tmp/portage/sys-devel/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2078:41: error: 'PT_R31' was not declared in this scope Building without USE=sanitize works ok.