Hi Shane,

On 25 July 2020 at 10:34, Shane McDonald wrote:
| This FTBFS is caused by a change in the default
| behaviour of GCC from version 9 to version 10.
| In version 10, if a global variable is defined in a
| header file, and that header file is included by
| several files, this results in multiple definitions
| of the same variable, and a linker error will be
| reported. In previous versions, this error is ignored.
| See the "Porting to GCC 10" document
| (https://gcc.gnu.org/gcc-10/porting_to.html) for
| more details.

Yes, I know. I spawned off an R package wrapping DieHarder: RDieHarder.  It
is on CRAN, and the CRAN maintainer did these gcc-10 tests last December
asking us all to update.

So I did that in December for RDieHarder: essentially adding a new globals.c
and adding 'extern' in front a few dozen variable declarations.

And ... I just did the same this morning for DieHarder itself. It is a little
messy because the build process is somewhere between a mess and somewhat
archaic. This really is code from the mid-2000s and it is showing its age.
 
| To go back to the previous behaviour, it is possible
| to use the -fcommon GCC flag. The following patch
| makes this change, and results in dieharder
| successfully building with GCC 10.

I had forgotten about that one too. I may use it for sprng, my other affected
package. Or I may let that one die.  It was for a very specialised use case
for which we now have better tools.

DieHarder is a little closer to my heart as I am kinda/sorta a collaborator
so I may run with the updated code.

Again, really appreciate you looking into it.

Cheers, Dirk
 
 
| diff --git a/debian/rules b/debian/rules
| index da08eba..3080547 100755
| --- a/debian/rules
| +++ b/debian/rules
| @@ -35,7 +35,10 @@ endif
|  # edd 18 Nov 2006:  add -fexceptions, but don't use -O3 as
|  #                   'make check' as gcc hangs in cblas/ after test_ger.c
|  # edd 27 Dec 2015:  add dpkg-buildflags as well
| -CFLAGS    :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS)
| $(shell dpkg-buildflags --get CFLAGS)
| +# shanemcd 24 Jul 2020: add -fcommon for gcc 10's change in default
| +#                       behaviour related to multiple definitions
| +#                       of global variables
| +CFLAGS    :=-Wall -pipe -fexceptions -fcommon -D_REENTRANT
| $(DEBUGFLAGS) $(shell dpkg-buildflags --get CFLAGS)
|  # edd 29 Sep 2005   alpha needs -mieee with gcc 4.0
|  ifeq ($(arch),alpha)
|  CFLAGS += -mieee
| -- 
| 2.20.1

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

Reply via email to