From: Paul Floyd Date: Tue, 22 Apr 2025 05:22:42 +0000 (+0200) Subject: Regtest: clean up warning and compilation of bug290061.c X-Git-Tag: VALGRIND_3_25_0~13 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=866f58b3b5edd4731f210b4f5f48f459f2c600a5;p=thirdparty%2Fvalgrind.git 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 --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 8f9018f46..043454828 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 40d847e8e..8a77037ad 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]; }