From: Paul F. <pa...@so...> - 2025-04-22 05:29:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=866f58b3b5edd4731f210b4f5f48f459f2c600a5 commit 866f58b3b5edd4731f210b4f5f48f459f2c600a5 Author: Paul Floyd <pj...@wa...> Date: Tue Apr 22 07:22:42 2025 +0200 Regtest: clean up warning and compilation of bug290061.c On some platforms there was a 'defined but not used' warning. When I fixed that I got a link error from clang. Using a _LDFLAGS option causes automake to split building the test into separate compile and link commands and clang was optimizing away the unused static 'meh' symbol. Diff: --- none/tests/Makefile.am | 1 + none/tests/bug290061.c | 1 + 2 files changed, 2 insertions(+) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 8f9018f46a..043454828a 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -378,6 +378,7 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) # Extra stuff for C tests ansi_CFLAGS = $(AM_CFLAGS) -ansi +bug290061_CFLAGS = -fPIC bug290061_LDFLAGS = @FLAG_PIE@ bug491394_LDADD = -lc bug491394_LDFLAGS = -nostdlib -static diff --git a/none/tests/bug290061.c b/none/tests/bug290061.c index 40d847e8e1..8a77037adf 100644 --- a/none/tests/bug290061.c +++ b/none/tests/bug290061.c @@ -1,5 +1,6 @@ static char meh[3000000]; // ~3mb int main(void) { + return meh[0]; } |