garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

Fix the build with -fno-common. #105

Closed jamesjer closed 4 years ago

jamesjer commented 4 years ago

GCC has defaulted to -fcommon for many years. GCC 10 is changing the default to -fno-common, which has led to lablgtk failing to build because every compilation unit that includes ml_gdk.h has its own variable named ml_table_extension_events. This commit ensures that there is exactly one definition of that variable.

XVilka commented 4 years ago

Shouldn't be this merged? Fedora 32, OpenSUSE, Gentoo, Arch are working on switching to the GCC 10.

jamesjer commented 4 years ago

In fact, out of necessity, I have applied this patch already to the versions of lablgtk 2 and 3 that will appear in Fedora 32.

ejgallego commented 4 years ago

Thanks @jamesjer , and sorry for the delay. I think we can merge this and maybe do a release (cc: @garrigue )

This needs a changelog tho, would you mind updating the CHANGES file?

jamesjer commented 4 years ago

Sure. Should I put something just above the "## In Lablgtk-3.1.0" line?

ejgallego commented 4 years ago

Sure. Should I put something just above the "## In Lablgtk-3.1.0" line?

Yup, I guess that will be in 3.1.1 .

garrigue commented 4 years ago

Ok, I merged it. Thanks for the report.

Do we need a new release for that? Are we waiting for anything else?

thithib commented 4 years ago

Could you please do a release with the fix? Some distributions like Arch Linux ship the patch to fix their packages but builds with opam will remain broken.

let-def commented 4 years ago

Workaround while waiting for a release: build with OCAMLPARAM='_,ccopt=-fcommon' opam install -y lablgtk3