Page MenuHome GnuPG

Compile with Apple Clang
Closed, WontfixPublic

Description

Apple Clang really dislikes having symbols defined in two places. The attached patch gets it to compile. I needed this to cross compile for iPhone support.

Details

Version
2.2.9

Event Timeline

Do you say that the linker can't handle the standard common block feature? The only toolchain I am aware of which does not understand this is the Norcraft C compiler for RISC OS. And now also Clang building for iOS?

Apple Clang changes the -fno-common to be default. It can also compile by adding -fcommon to the CFLAGS but I suspect this patch (with the exception of adding __APPLE__ to the (defined (__riscos__) || defined (__APPLE__))) would be needed for things to work properly on __riscos__ also.

-fcommon, -fno-common
       This flag specifies that variables without initializers get common linkage.  It can be disabled with -fno-common.

I don't think that GnuPG >= 2 can still be build with RISCOS. In any case it is such a minor platform that we are removing special RISCOS hacks when touching such code parts.

Do you happen to know why Apple changed the default? Do they want to make building Unix software harder?

werner claimed this task.

We won't fix that. If you want to build for Apple iOS make sure to use

-fcommon

with the compiler/linker.