From: Paul Floyd Date: Wed, 1 Nov 2023 09:59:08 +0000 (+0100) Subject: Bug 476320 - Build failure with GCC X-Git-Tag: VALGRIND_3_23_0~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4db057f59e3e9e79a5b66e464f51780defb602b4;p=thirdparty%2Fvalgrind.git Bug 476320 - Build failure with GCC A few fixes for building regression tests with GCC on FreeBSD. --- diff --git a/NEWS b/NEWS index 14be314581..e8c28439b4 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +476320 Build failure with GCC + To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed above. diff --git a/configure.ac b/configure.ac index 451ec48c07..cee73dab6d 100755 --- a/configure.ac +++ b/configure.ac @@ -806,6 +806,8 @@ case "$ARCH_MAX-$VGCONF_OS" in else GCC_MAJOR_VERSION=`${CC} -dumpversion | $SED 's/\..*//' 2>/dev/null` FLAG_32ON64="-B/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -Wl,-rpath,/usr/local/lib32/gcc${GCC_MAJOR_VERSION}/" + FLAG_32ON64_GXX="-L/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -lgcc_s" + AC_SUBST(FLAG_32ON64_GXX) fi valt_load_address_pri_norml="0x38000000" valt_load_address_pri_inner="0x28000000" diff --git a/memcheck/tests/freebsd/bug470713.cpp b/memcheck/tests/freebsd/bug470713.cpp index 1d34ac6604..e07dba76b5 100644 --- a/memcheck/tests/freebsd/bug470713.cpp +++ b/memcheck/tests/freebsd/bug470713.cpp @@ -7,6 +7,7 @@ #include #include #include +#include using std::cerr; using std::cout; @@ -18,7 +19,7 @@ int main(int argc, char **argv) size_t len; if (sysctl(mib, 4, NULL, &len, NULL, 0) != 0) { - cout << "sysctl failed to get path length: " << strerror(errno) << '\n'; + cout << "sysctl failed to get path length: " << std::strerror(errno) << '\n'; return -1; } @@ -32,7 +33,7 @@ int main(int argc, char **argv) if (string(aResult.get()) == argv[1]) { cout << "OK\n"; } else { - cout << "Not OK aResult " << aResult << " argv[1] " << argv[1] << '\n'; + cout << "Not OK aResult " << aResult.get() << " argv[1] " << argv[1] << '\n'; } if (sysctl(mib, 4, NULL, NULL, NULL, 0) != -1) { diff --git a/memcheck/tests/freebsd/delete_sized_mismatch.cpp b/memcheck/tests/freebsd/delete_sized_mismatch.cpp index d929280e00..fe8a7fd050 100644 --- a/memcheck/tests/freebsd/delete_sized_mismatch.cpp +++ b/memcheck/tests/freebsd/delete_sized_mismatch.cpp @@ -8,8 +8,8 @@ int main() { - size_t size(32); - size_t badsize(33); + std::size_t size(32); + std::size_t badsize(33); void *mem = nullptr; diff --git a/memcheck/tests/x86/Makefile.am b/memcheck/tests/x86/Makefile.am index 37512ceec1..80121f93cf 100644 --- a/memcheck/tests/x86/Makefile.am +++ b/memcheck/tests/x86/Makefile.am @@ -65,3 +65,6 @@ tronical_SOURCES = tronical.S more_x86_fp_LDADD = -lm pcmpgt_SOURCES = pcmpgt.cpp +if VGCONF_OS_IS_FREEBSD +pcmpgt_CXXFLAGS = $(AM_CXXFLAGS) $(FLAG_32ON64_GXX) +endif diff --git a/none/tests/freebsd/proc_pid_file.cpp b/none/tests/freebsd/proc_pid_file.cpp index cf9d185381..89c8428d13 100644 --- a/none/tests/freebsd/proc_pid_file.cpp +++ b/none/tests/freebsd/proc_pid_file.cpp @@ -1,7 +1,7 @@ #include //#include #include -//#include +#include #include #include #include