* [gentoo-dev] CFLAGS=-fno-common related breakage is incoming
@ 2020-01-19 22:36 Sergei Trofimovich
2020-05-02 11:14 ` Sergei Trofimovich
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich @ 2020-01-19 22:36 UTC (permalink / raw
To: gentoo-dev
> What is happening?
gcc-10 is coming soon. It will be more disruptive than gcc-9.
One of the major changes is the switch from C{,XX}FLAGS=-fcommon
to C{,XX}FLAGS=-fno-common by default: https://gcc.gnu.org/PR85678
It's a planned change and not a gcc regression. It will expose some
warts on old code and unblock minor optimisations accessing globals.
The change has already happened in gcc trunk.
> Is my package affected? Should I do anything?
You can check proactively if your packages are affected.
Add -fno-common to your make.conf's C{,XX}FLAGS and
see if things still build.
The typical symptom is a linker failure on multiple definitions
for some global variable:
ld: a.o:(.bss+0x0): multiple definition of `a'; main.o:(.data+0x0): first defined here
> How to fix it?
https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common contains
some examples. Ideally code will need a few 'extern' additions and maybe
moving variable definitions.
Example of proposed openrc fix:
https://github.com/OpenRC/openrc/pull/348
Adding 'append-flags -fcommon' might work as a temporary workaround.
> Can I help?
Glad you asked! We will need to gather failed packages and fix them
upstream and downstream. Here is what you can do:
1. Add -fno-common to your make.conf's C{,XX}FLAGS
2. Build packages you maintain
3. Fix a bug upstream (or report a failure).
4. Pull a fix downstream (or file a bug and add it to the tracker).
> What is already known to be broken? Can I look at example fixes?
See https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
for an artificial example.
Gentoo tracker bug of known issues:
https://bugs.gentoo.org/705764
15 bugs so far.
SUSE tracker bug of known issues:
https://bugzilla.suse.com/show_bug.cgi?id=1160244
95 bugs so far. A good source of packages to check against the
ones you care about.
> What does -fcommon do?
Look up -fcommon in https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
> I have no idea why my package broke. The error does not make sense.
Feel free to CC toolchain@ on a bug you observe and we'll try to sort it out.
--
Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] CFLAGS=-fno-common related breakage is incoming
2020-01-19 22:36 [gentoo-dev] CFLAGS=-fno-common related breakage is incoming Sergei Trofimovich
@ 2020-05-02 11:14 ` Sergei Trofimovich
2020-05-04 6:41 ` Joonas Niilola
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich @ 2020-05-02 11:14 UTC (permalink / raw
To: gentoo-dev
On Sun, 19 Jan 2020 22:36:51 +0000
Sergei Trofimovich <slyfox@gentoo.org> wrote:
> > What is happening?
>
> gcc-10 is coming soon. It will be more disruptive than gcc-9.
>
> One of the major changes is the switch from C{,XX}FLAGS=-fcommon
> to C{,XX}FLAGS=-fno-common by default: https://gcc.gnu.org/PR85678
>
> It's a planned change and not a gcc regression. It will expose some
> warts on old code and unblock minor optimisations accessing globals.
>
> The change has already happened in gcc trunk.
>
> > Is my package affected? Should I do anything?
>
> You can check proactively if your packages are affected.
>
> Add -fno-common to your make.conf's C{,XX}FLAGS and
> see if things still build.
>
> The typical symptom is a linker failure on multiple definitions
> for some global variable:
>
> ld: a.o:(.bss+0x0): multiple definition of `a'; main.o:(.data+0x0): first defined here
>
> > How to fix it?
>
> https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common contains
> some examples. Ideally code will need a few 'extern' additions and maybe
> moving variable definitions.
>
> Example of proposed openrc fix:
> https://github.com/OpenRC/openrc/pull/348
>
> Adding 'append-flags -fcommon' might work as a temporary workaround.
>
> > Can I help?
>
> Glad you asked! We will need to gather failed packages and fix them
> upstream and downstream. Here is what you can do:
>
> 1. Add -fno-common to your make.conf's C{,XX}FLAGS
> 2. Build packages you maintain
> 3. Fix a bug upstream (or report a failure).
> 4. Pull a fix downstream (or file a bug and add it to the tracker).
>
> > What is already known to be broken? Can I look at example fixes?
>
> See https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
> for an artificial example.
>
> Gentoo tracker bug of known issues:
> https://bugs.gentoo.org/705764
> 15 bugs so far.
>
> SUSE tracker bug of known issues:
> https://bugzilla.suse.com/show_bug.cgi?id=1160244
> 95 bugs so far. A good source of packages to check against the
> ones you care about.
>
> > What does -fcommon do?
>
> Look up -fcommon in https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
>
> > I have no idea why my package broke. The error does not make sense.
>
> Feel free to CC toolchain@ on a bug you observe and we'll try to sort it out.
With Toralf's help we now have rough estimate of broken packages. It's about
450 yet unfixed ones:
https://bugs.gentoo.org/showdependencytree.cgi?id=705764&hide_resolved=1
gcc-10 will be released soon. Maybe in a week.
Please look at the broken list and fix your packages.
Thanks!
--
Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] CFLAGS=-fno-common related breakage is incoming
2020-05-02 11:14 ` Sergei Trofimovich
@ 2020-05-04 6:41 ` Joonas Niilola
0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2020-05-04 6:41 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 407 bytes --]
On 5/2/20 2:14 PM, Sergei Trofimovich wrote:
> With Toralf's help we now have rough estimate of broken packages. It's about
> 450 yet unfixed ones:
> https://bugs.gentoo.org/showdependencytree.cgi?id=705764&hide_resolved=1
>
> gcc-10 will be released soon. Maybe in a week.
>
> Please look at the broken list and fix your packages.
>
> Thanks!
>
Thanks for the heads-up!
-- juippis
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 642 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-04 6:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-19 22:36 [gentoo-dev] CFLAGS=-fno-common related breakage is incoming Sergei Trofimovich
2020-05-02 11:14 ` Sergei Trofimovich
2020-05-04 6:41 ` Joonas Niilola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox