Summary: | Patch: Guard against __GLIBC_PREREQ for musl libc | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Randy MacLeod <rwmacleod> |
Component: | memcheck | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | arikalo, mark, mips32r2, pjfloyd, yifan.yu |
Priority: | NOR | ||
Version: | 3.14 SVN | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Guard against __GLIBC_PREREQ for musl libc
This is the correct patch for this bug Fix none/tests/pth_atfork1 musl compilation error refresh the previous patches by randy |
Oops, the summary should be: When building valgrind for Yocto-2.6 and using the musl libc rather than glibc, the build fails due to GLIBC-only features not being guarded against. Created attachment 115831 [details]
This is the correct patch for this bug
(In reply to Randy MacLeod from comment #2) > Created attachment 115831 [details] > This is the correct patch for this bug Hi Randy, There is no <linux/stat.h> on musl, struct statx is in <sys/stat.h> which is already included. So, you need to remove the last #else branch. Created attachment 124625 [details]
Fix none/tests/pth_atfork1 musl compilation error
Tested on nanoMIPS/musl/linux and x86/glibc.
Everyone OK to land this? The last patch "Fix none/tests/pth_atfork1 musl compilation error" looks fine. musl libc apparently doesn't provide error.h nor the error function, so just provide our own always. Committed. https://sourceware.org/git/?p=valgrind.git;a=commit;h=702b1fe56f6dd61d0003457728702248f46c6dcc Created attachment 136948 [details]
refresh the previous patches by randy
the issue wasn't solved by the referenced commit
the patch was also updated.
reopening this bug too. I have no recollection of doing this, but the git log can't lie. Author: Paul Floyd <pjfloyd@wanadoo.fr> 2021-11-22 08:42:53 Committer: Paul Floyd <pjfloyd@wanadoo.fr> 2021-11-22 08:42:53 Parent: 7fe4ff55cce4c62f17262f2cf30b97b23af142b4 (Make sys-statx.c test compile with glibc >= 2.28) Branches: master, remotes/origin/master Follows: VALGRIND_3_18_1 Precedes: VALGRIND_3_19_0 Bug 445300 [PATCH] Fix building tests with Musl Patch contributed by Alyssa Ross <hi@alyssa.is> |
Created attachment 115830 [details] Guard against __GLIBC_PREREQ for musl libc SUMMARY When building valgrind for Yocto-2.6 and using the musl libc rather than glibc, STEPS TO REPRODUCE On any desktop Linux system such as Ubuntu-18.04, 0. sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping libsdl1.2-dev xterm 1. git clone git://git.pokylinux.org/poky.git 2. cd poky.git 3. git checkout bc98a1e89dcd7b3f59f99e4382439d9028ba4db2 4. mkdir ../proj; cd ../proj 5. . ../poky.git/oe-init-build-env vg-bug 6. MACHINE=qemux86-64 TCLIBC=musl bitbake valgrind OBSERVED RESULT | ../../../../valgrind-3.14.0/memcheck/tests/linux/sys-statx.c:10:19: error: missing binary operator before token "(" | #if __GLIBC_PREREQ(2,28) | ^ | Makefile:844: recipe for target 'sys-statx.o' failed EXPECTED RESULT valgrind builds without error. SOFTWARE VERSIONS (available in About System) KDE Plasma Version: N/A KDE Frameworks Version: N/A Qt Version: N/A ADDITIONAL INFORMATION patch attached. I can figure out Phabricator if needed.