public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ?
@ 2023-04-24  0:09 romain.geissler at amadeus dot com
  2023-04-24  0:12 ` [Bug libstdc++/109602] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: romain.geissler at amadeus dot com @ 2023-04-24  0:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

            Bug ID: 109602
           Summary: Import Gentoo msgfmt patch ?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: romain.geissler at amadeus dot com
  Target Milestone: ---

Hi,

I am wondering, would it make sense to import Gentoo's msgfmt patch ? In some
occasion, it seems that the build system of gcc/libstdc++ wrongly sets
LD_LIBRARY_PATH when building (in case it helps, in my case it seems to happens
only when doing a gcc bootstrap). I am speaking about this patch:
https://gitweb.gentoo.org/proj/gcc-patches.git/tree/10.3.0/gentoo/36_all_msgfmt-libstdc++-link.patch?id=6fb906ef2da01327d64cea263887ef34c97c1bbf
and more globally about this set of Gentoo bugs https://bugs.gentoo.org/372377
or https://bugs.gentoo.org/843119

It seems at least Alpine Linux also carries this patch:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/gcc/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch

I understand the underlying issue is more that LD_LIBRARY_PATH shouldn't be
set, but it seems past investigations didn't really lead to finding this root
cause (see bug #105688), so in the meantime, maybe this workaround patch should
be imported in upstream tree directly. It's just a proposal, I would understand
this is refused.

Cheers,
Romain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
@ 2023-04-24  0:12 ` pinskia at gcc dot gnu.org
  2023-04-24  0:14 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-24  0:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am 99% sure this patch is not portable at all. In that not all env supports
--unset.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
  2023-04-24  0:12 ` [Bug libstdc++/109602] " pinskia at gcc dot gnu.org
@ 2023-04-24  0:14 ` pinskia at gcc dot gnu.org
  2023-04-24  8:16 ` arsen at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-24  0:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Second who sets LD_LIBRARY_PATH in the first place.
Third these I thought was only done for maintenance mode.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
  2023-04-24  0:12 ` [Bug libstdc++/109602] " pinskia at gcc dot gnu.org
  2023-04-24  0:14 ` pinskia at gcc dot gnu.org
@ 2023-04-24  8:16 ` arsen at gcc dot gnu.org
  2023-04-24 12:37 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-24  8:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #3 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
this patch is not upstream because we haven't proposed it for inclusion in the
tree yet.  if concerned with gentoo packaging, please open a bug on our bug
tracker or talk to us on #gentoo-toolchain on libera.chat

(In reply to Andrew Pinski from comment #1)
> I am 99% sure this patch is not portable at all. In that not all env
> supports --unset.

this is part of the reason why we have not done so.

(In reply to Andrew Pinski from comment #2)
> Second who sets LD_LIBRARY_PATH in the first place.
> Third these I thought was only done for maintenance mode.

GCC tarballs appear to lack .mo files entirely (checked gcc-12.2.0.tar.xz and
gcc-14-20230423.tar.xz) in all components, so this step would necessarily run.

the LD_LIBRARY_PATH is set through RPATH_ENVVAR when partway through
bootstrapping:

 
LD_LIBRARY_PATH=/home/arsen/gcc/releases/gcc-11b/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs:/home/arsen/gcc/releases/gcc-11b/x86_64-pc-linux-gnu/libgomp/.libs:/home/arsen/gcc/releases/gcc-11b/x86_64-pc-linux-gnu/libitm/.libs:/home/arsen/gcc/releases/gcc-11b/./gcc:/home/arsen/gcc/releases/gcc-11b/./prev-gcc

this is done, it'd seem, through all-target-libstdc++-v3 ->
RAW_CXX_TARGET_EXPORTS -> BASE_TARGET_EXPORTS

this happens on the 13 branch as well, but is not noticeable since that's not a
downgrade on my system.

it's a bit unsafe to set this variable globally like this (since it affects
build-machine programs like make and msgfmt and sh too), but I'm not sure how
one could avoid it, since the configure script needs it set, but not the shell
that runs it, etc.. (and, even worse, only some programs configure runs need it
set..)  maybe it'd be easier to inject a runpath into linker flags or
something? not all things can be fixed by patching like the msgfmt patch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
                   ` (2 preceding siblings ...)
  2023-04-24  8:16 ` arsen at gcc dot gnu.org
@ 2023-04-24 12:37 ` sjames at gcc dot gnu.org
  2023-04-24 12:42 ` romain.geissler at amadeus dot com
  2023-04-24 19:46 ` arsen at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-24 12:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #4 from Sam James <sjames at gcc dot gnu.org> ---
Arsen is, of course, spot on, but to add some more notes:
- Please in future, don't unilaterally send downstream patches upstream without
attempting to speak to us first. This is on our list to send upstream and
hasn't been yet for the reasons Arsen describes (it needs tidying + proper
rationale included). We're very easily reached and this caught me *very* off
guard.

- The issues for gettext come from msgfmt->libxml2->icu, but it also happens
(we have a similar patch) for when using libarchive tar instead of GNU tar too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
                   ` (3 preceding siblings ...)
  2023-04-24 12:37 ` sjames at gcc dot gnu.org
@ 2023-04-24 12:42 ` romain.geissler at amadeus dot com
  2023-04-24 19:46 ` arsen at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: romain.geissler at amadeus dot com @ 2023-04-24 12:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

--- Comment #5 from Romain Geissler <romain.geissler at amadeus dot com> ---
Hi,

My intention was to try to raise upstream an issue that people packaging gcc
may hit in some cases. Gentoo has such a patch, but I also have a similar one
on my side since couple of years, it's only yesterday that I discovered Gentoo
had one too (and Alpine Linux). I am not a user of Gentoo nor Alpine Linux
myself, I just also package my own gcc.

So I apologize to the Gentoo and Gcc communities if I offended anyone by
opening this bug report, that was not the intention.

Cheers,
Romain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/109602] Import Gentoo msgfmt patch ?
  2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
                   ` (4 preceding siblings ...)
  2023-04-24 12:42 ` romain.geissler at amadeus dot com
@ 2023-04-24 19:46 ` arsen at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-24 19:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109602

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #6 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
(In reply to Romain Geissler from comment #5)
> Hi,
> 
> My intention was to try to raise upstream an issue that people packaging gcc
> may hit in some cases. Gentoo has such a patch, but I also have a similar
> one on my side since couple of years, it's only yesterday that I discovered
> Gentoo had one too (and Alpine Linux). I am not a user of Gentoo nor Alpine
> Linux myself, I just also package my own gcc.
> 
> So I apologize to the Gentoo and Gcc communities if I offended anyone by
> opening this bug report, that was not the intention.

no worries, I doubt anyone took offense.  we (Gentoo) try to work as closely as
possible with upstream GCC, so usually a patch being on our end only means that
nobody reworked it to be upstreamable.  if in doubt, you can email
toolchain@gentoo.org - we'd be happy to answer.

in this instance, the 'fix' we use is not applicable in the general case, since
it doesn't solve the general problem of building a downgraded gcc, so we never
upstreamed it.

PS: the general issue is reported, marking as dupe

have a lovely day!

*** This bug has been marked as a duplicate of bug 105688 ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-24 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24  0:09 [Bug libstdc++/109602] New: Import Gentoo msgfmt patch ? romain.geissler at amadeus dot com
2023-04-24  0:12 ` [Bug libstdc++/109602] " pinskia at gcc dot gnu.org
2023-04-24  0:14 ` pinskia at gcc dot gnu.org
2023-04-24  8:16 ` arsen at gcc dot gnu.org
2023-04-24 12:37 ` sjames at gcc dot gnu.org
2023-04-24 12:42 ` romain.geissler at amadeus dot com
2023-04-24 19:46 ` arsen at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).