gnupg-2.2.19 fails to build on latest Fedora Rawhide
Closed, ResolvedPublic

Description

The gnupg-2.2.19 fails to build on latest Fedora Rawhide with the distro-wide C/ld optimization flags which include LTO.
The problem is in duplicated (same) global data across multiple object files.

Related Objects

t8m created this task.Jan 30 2020, 5:13 PM

this file contains a patch to avoid this global data duplication.

werner added a subscriber: werner.Jan 31 2020, 11:38 AM

You mean that common blocks can't be used anymore? The RISC-OS had this problem but it was the only architecture I was aware of that required "extern" trickery.

t8m added a comment.Feb 2 2020, 9:27 AM

Yes. With LTO turned on the object files must not contain the same data blocks.

werner triaged this task as High priority.Feb 3 2020, 10:21 AM
werner added a project: toolchain.

In a private mail someone else reported a similar problems and explained that gcc-10 will change the default from -fcommon to -fno-common. I think this is again a bad move in compiler development. Replacing the de-facto standard C compiler behaviour with something _allowed_ by ISO-C. No industrial grade toolchain would ever do such a silly default change - too many customers would rightfully be angry with them.

Quite some time ago I realized that supporting RISC-OS is nt anymore something we should do with GnUPG becuase we can't test it anyway. Thus I started to remove or didn't implemented RISC-OS specific hacks anymore. The common blocks thing is one of them.

We need to see what we can do; it is not just GnuPG but likely lot of libraries and other code we maintain.

In the concrete case an accessor function might be a better way than to add macros all over the place.

I took your patch but modified it to define EXTERN_UNLESS_MAIN_MODULE only at one place.

werner changed the task status from Open to Testing.Feb 10 2020, 4:52 PM
werner added a project: gnupg (gpg22).

Building with -fno-common now works for me on 2.2 and master. Thanks for the patch.

werner closed this task as Resolved.Mar 20 2020, 5:59 PM
werner claimed this task.