MFH: r526608

devel/valgrind(-devel): Fix compiler version detection hopefully forever

Every time a compiler major version is bumped, we run into this exact
same error:

===>  Configuring for valgrind-3.10.1.20160113_7,1
...
checking for a supported version of gcc... no (10.0.0)
configure: error: please use gcc >= 3.0 or clang >= 2.9

Attempt to fix this for all versions in the future.

Other fix included: don't use undefined behavior to implement offsetof,
just use the official builtin function instead.

Approved by:	portmgr (joneum)
PR:		244234
This commit is contained in:
Dimitry Andric 2020-02-21 21:29:58 +00:00
parent 5f0d89e975
commit 381f709927
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q1/; revision=526719
6 changed files with 50 additions and 32 deletions

View File

@ -4,7 +4,7 @@
PORTNAME= valgrind
PORTVERSION= 3.10.1.20160113
DISTVERSIONPREFIX= freebsd-
PORTREVISION= 6
PORTREVISION= 7
PORTEPOCH= 1
CATEGORIES= devel
MASTER_SITES= https://bitbucket.org/${BB_ACCOUNT}/${BB_PROJECT}/get/${BB_COMMIT}.tar.gz?dummy=/ \

View File

@ -0,0 +1,11 @@
--- VEX/auxprogs/genoffsets.c 2016-01-13 19:20:20 UTC
+++ VEX/auxprogs/genoffsets.c
@@ -59,7 +59,7 @@
#define VG_STRINGIFZ(__str) #__str
#define VG_STRINGIFY(__str) VG_STRINGIFZ(__str)
-#define my_offsetof(__type,__field) (&((__type*)0)->__field)
+#define my_offsetof(__type,__field) offsetof(__type,__field)
/* This forces gcc to evaluate the my_offsetof call at compile time,
and then emits it in the assembly, along with the nonsense string

View File

@ -1,23 +1,21 @@
--- configure.ac.orig 2016-01-13 19:20:20 UTC
+++ configure.ac
@@ -145,7 +145,19 @@
notclang-5.*)
@@ -136,16 +136,10 @@
AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang)
case "${is_clang}-${gcc_version}" in
- notclang-3.*)
+ notclang-[[3-9]].*|notclang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (${gcc_version})])
;;
- notclang-4.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- notclang-5.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- clang-2.9|clang-3.*|clang-4.*)
+ notclang-6.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-7.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-8.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-9.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ clang-2.9|clang-[[3-9]].*)
+ clang-2.9|clang-[[3-9]].*|clang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (clang-${gcc_version})])
;;
*)

View File

@ -4,7 +4,7 @@
PORTNAME= valgrind
PORTVERSION= 3.10.1.20160113
DISTVERSIONPREFIX= freebsd-
PORTREVISION= 7
PORTREVISION= 8
PORTEPOCH= 1
CATEGORIES= devel
MASTER_SITES= https://bitbucket.org/${BB_ACCOUNT}/${BB_PROJECT}/get/${BB_COMMIT}.tar.gz?dummy=/ \

View File

@ -0,0 +1,11 @@
--- VEX/auxprogs/genoffsets.c 2016-01-13 19:20:20 UTC
+++ VEX/auxprogs/genoffsets.c
@@ -59,7 +59,7 @@
#define VG_STRINGIFZ(__str) #__str
#define VG_STRINGIFY(__str) VG_STRINGIFZ(__str)
-#define my_offsetof(__type,__field) (&((__type*)0)->__field)
+#define my_offsetof(__type,__field) offsetof(__type,__field)
/* This forces gcc to evaluate the my_offsetof call at compile time,
and then emits it in the assembly, along with the nonsense string

View File

@ -1,23 +1,21 @@
--- configure.ac.orig 2016-01-13 19:20:20 UTC
+++ configure.ac
@@ -145,7 +145,19 @@
notclang-5.*)
@@ -136,16 +136,10 @@
AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang)
case "${is_clang}-${gcc_version}" in
- notclang-3.*)
+ notclang-[[3-9]].*|notclang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (${gcc_version})])
;;
- notclang-4.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- notclang-5.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- clang-2.9|clang-3.*|clang-4.*)
+ notclang-6.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-7.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-8.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ notclang-9.*)
+ AC_MSG_RESULT([ok (${gcc_version})])
+ ;;
+ clang-2.9|clang-[[3-9]].*)
+ clang-2.9|clang-[[3-9]].*|clang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (clang-${gcc_version})])
;;
*)