Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 829742

Summary: sys-libs/compiler-rt-sanitizers-13.0.0-r1: error: function-like macro '__GLIBC_PREREQ' is not defined (in musl libc)
Product: Gentoo Linux Reporter: 12101111 <w12101111>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED FIXED    
Severity: normal CC: musl, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/llvm/llvm-project/commit/b4fb42300e39c99ac5bb9d02b304b713fabdec4d
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 829603    
Attachments: emerge --info
build.log

Description 12101111 2021-12-21 06:38:41 UTC
sys-libs/compiler-rt-sanitizers-13.0.0-r1 include patches that use macro __GLIBC_PREREQ, but this macro is only available in glibc.

Reproducible: Always

Steps to Reproduce:
1. emerge "=sys-libs/compiler-rt-sanitizers-13.0.0-r1"

Actual Results:  
/tmp/portage/sys-libs/compiler-rt-sanitizers-13.0.0-r1/work/compiler-rt/lib/msan/msan_interceptors.cpp:660:46: error: function-like macro '__GLIBC_PREREQ' is not defined
#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_STAT_LINUX
                                             ^
/tmp/portage/sys-libs/compiler-rt-sanitizers-13.0.0-r1/work/compiler-rt/lib/msan/msan_interceptors.cpp:659:50: note: expanded from macro 'SANITIZER_STAT_LINUX'
#define SANITIZER_STAT_LINUX (SANITIZER_LINUX && __GLIBC_PREREQ(2, 33))
                                                 ^
/tmp/portage/sys-libs/compiler-rt-sanitizers-13.0.0-r1/work/compiler-rt/lib/msan/msan_interceptors.cpp:699:46: error: function-like macro '__GLIBC_PREREQ' is not defined
#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_STAT_LINUX
                                             ^
/tmp/portage/sys-libs/compiler-rt-sanitizers-13.0.0-r1/work/compiler-rt/lib/msan/msan_interceptors.cpp:659:50: note: expanded from macro 'SANITIZER_STAT_LINUX'
#define SANITIZER_STAT_LINUX (SANITIZER_LINUX && __GLIBC_PREREQ(2, 33))
                                                 ^
2 errors generated.


Expected Results:  
Those patches should only be applied on glibc system.
Comment 1 12101111 2021-12-21 06:39:37 UTC
Created attachment 759938 [details]
emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-21 06:40:11 UTC
Please do include the full build.log and emerge --info. It helps debugging for those who can't reproduce (or for whom it'd be a huge amount of effort). Avoiding conditional patching is preferred and more upstreamable.
Comment 3 12101111 2021-12-21 06:40:19 UTC
Created attachment 759939 [details]
build.log
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-28 02:03:07 UTC
We actually just need https://github.com/llvm/llvm-project/commit/b4fb42300e39c99ac5bb9d02b304b713fabdec4d which should be in 13.0.1.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-03 03:35:46 UTC
Should be fixed in 13.0.1 which is in tree now.