Page MenuHome GnuPG

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.

Details

Version
2.2.19

Related Objects

Event Timeline

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

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.

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

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 claimed this task.