public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/110651] New: libgfortran.spec links twice with libgcc spec
@ 2023-07-13  9:22 ro at gcc dot gnu.org
  2023-07-13  9:22 ` [Bug libfortran/110651] " ro at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2023-07-13  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110651
           Summary: libgfortran.spec links twice with libgcc spec
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org, fxcoudert at gcc dot gnu.org,
                    iains at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-apple-darwin23.0.0
            Target: x86_64-apple-darwin23.0.0
             Build: x86_64-apple-darwin23.0.0

When bootstrapping current trunk on macOS 14.0 beta 3 with Xcode 15 beta 4,
every single fortran link test FAILs like

FAIL: gfortran.dg/c-interop/allocatable-dummy.f90   -O0  (test for excess
errors)
Excess errors: 
ld: warning: ignoring duplicate library '-lemutls_w'
ld: warning: ignoring duplicate library '-lgcc'

The link line ends in

-lgfortran -lemutls_w -lgcc -lquadmath -lemutls_w -lgcc -lSystem
-no_compact_unwind -idsym -dsym

I could trace this to libgfortran.spec, which has

%rename lib liborig
*lib: %{static-libquadmath:libquadmath.a%s;:-lquadmath}  %(libgcc) %(liborig)

The libgcc spec is included twice, once explicitly here and another time in
%(liborig).  I have no idea why this is done this way: this already was in 
the original patch that introduced libgfortran.spec.in:

commit 1ec601bf9fb0fbc39b3a6cb90450500f857adae8
Author: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date:   Tue Nov 16 21:23:19 2010 +0000

    re PR fortran/32049 (Support on x86_64 also kind=16)

I see quite a number of possible solutions:

* Get rid of %(libgcc) in libgfortran.spec.in.

* Include it conditionally depending on a configure test.

* Disable ld warnings with -w in the spec, probably using some
@TARGET_LDFLAGS@.

* Disable ld warnings globally in the Darwin driver code.  That may be
  undisable since it would disable possibly benign warnings, too.

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

end of thread, other threads:[~2024-02-11 13:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13  9:22 [Bug libfortran/110651] New: libgfortran.spec links twice with libgcc spec ro at gcc dot gnu.org
2023-07-13  9:22 ` [Bug libfortran/110651] " ro at gcc dot gnu.org
2023-07-13  9:30 ` iains at gcc dot gnu.org
2023-07-13  9:34 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-07-21 11:39 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-12-19  8:17 ` fxcoudert at gcc dot gnu.org
2024-02-10 15:48 ` iains at gcc dot gnu.org
2024-02-11 13:53 ` fxcoudert 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).