public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin
@ 2024-03-05  7:24 fxcoudert at gcc dot gnu.org
  2024-03-05  7:25 ` [Bug target/114233] " fxcoudert at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2024-03-05  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114233
           Summary: Newly-introduced pr113617.C test fails on Darwin
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

FAIL: g++.dg/other/pr113617.C  -std=gnu++14 (test for excess errors)
Excess errors:
ld: Undefined symbols:
  R::Y<N1::N2::N3::X<0>>::operator->(), referenced from:
      A<long long>::foo(long long, long long) in cci8MVgO.o
  R::Y<N1::N2::N3::X<1>>::operator->(), referenced from:
      A<long long>::foo(long long, long long) in cci8MVgO.o
  N1::N2::N3::AB::bleh(), referenced from:
      A<long long>::foo(long long, long long) in cci8MVgO.o
  N1::N2::N3::AC::m1(R::S<void ()>), referenced from:
      void N1::N2::N3::X<1>::boo<N1::N2::N3::C<(anonymous namespace)::D<long
long>, false>>(long long, long long, long long, N1::N2::N3::C<(anonymous
namespace)::D<long long>, false>&) in cci8MVgO.o
      void N1::N2::N3::X<1>::boo<N1::N2::N3::C<(anonymous namespace)::D<long
long>, false>>(long long, long long, long long, N1::N2::N3::C<(anonymous
namespace)::D<long long>, false>&) in ccjwgqSE.o
  N1::N2::N3::AC::AC(int), referenced from:
      void N1::N2::N3::X<1>::boo<N1::N2::N3::C<(anonymous namespace)::D<long
long>, false>>(long long, long long, long long, N1::N2::N3::C<(anonymous
namespace)::D<long long>, false>&) in cci8MVgO.o
      void N1::N2::N3::X<1>::boo<N1::N2::N3::C<(anonymous namespace)::D<long
long>, false>>(long long, long long, long long, N1::N2::N3::C<(anonymous
namespace)::D<long long>, false>&) in ccjwgqSE.o
  _main, referenced from:
      <initial-undefines>

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
@ 2024-03-05  7:25 ` fxcoudert at gcc dot gnu.org
  2024-03-06 20:32 ` iains at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2024-03-05  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-apple-darwin23
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-03-05
                 CC|                            |iains at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
  2024-03-05  7:25 ` [Bug target/114233] " fxcoudert at gcc dot gnu.org
@ 2024-03-06 20:32 ` iains at gcc dot gnu.org
  2024-03-07 13:31 ` fxcoudert at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-06 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
note Darwin's linker does not, by default permit symbols to be undefined.  If
the test case requires allowing undefined symbols to complete, then either we
need to specify them thus:
 -Wl,-U,_XXXXXXX (for each symbol)

or if they are unknown at build time, but required dynamically at runtime...

 -Wl,-undefined,dynamic_lookup

( I am not sure if this is a requirement of the test, or some artefact of the
test case reduction ).

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
  2024-03-05  7:25 ` [Bug target/114233] " fxcoudert at gcc dot gnu.org
  2024-03-06 20:32 ` iains at gcc dot gnu.org
@ 2024-03-07 13:31 ` fxcoudert at gcc dot gnu.org
  2024-03-07 14:25 ` fxcoudert at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2024-03-07 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Jakub, could you advise on what should happen for this test case? It's failing
on darwin due to undefined symbols.

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-03-07 13:31 ` fxcoudert at gcc dot gnu.org
@ 2024-03-07 14:25 ` fxcoudert at gcc dot gnu.org
  2024-03-07 15:06 ` iains at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2024-03-07 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Jakub has posted a patch in the linker PR (thanks!).

But there remains a darwin bug. The test in check_effective_target_shared
actually works with C, but not with C++, because:

Undefined symbols for architecture arm64:
  "__Z3foov", referenced from:
      __Z3bazv in ccCj5plO.o

Why have we not seen it before? Because most of the use of that check is in {
dg-require-effective-target shared } so we're effectively skipping tests, and
that is silent. As far as I can tell, this addition is the first time { target
shared } is used as a conditional in something like { dg-additional-options }
in the C++ testsuite.

The fix is simple:

diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index ae33c4f1e3a..467b539b20d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1390,7 +1390,7 @@ proc check_effective_target_shared { } {
     # here to be undefined.
     set extra_flags ""
     if { [istarget *-*-darwin\[912\]*] } {
-      set extra_flags "-Wl,-U,_foo,-U,_bar"
+      set extra_flags "-Wl,-U,_foo,-U,_bar,-U,__Z3foov"
     }
     # Note that M68K has a multilib that supports -fpic but not
     # -fPIC, so we need to check both.  We test with a program that

The question is: will this reveal new issues in other tests that weren't
running before. I'm starting a new regtest and will post the results here.

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-03-07 14:25 ` fxcoudert at gcc dot gnu.org
@ 2024-03-07 15:06 ` iains at gcc dot gnu.org
  2024-03-07 15:45 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-07 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #3)
> Jakub has posted a patch in the linker PR (thanks!).
> 
> But there remains a darwin bug. The test in check_effective_target_shared
> actually works with C, but not with C++, because:
> 

> diff --git a/gcc/testsuite/lib/target-supports.exp
> b/gcc/testsuite/lib/target-supports.exp
> index ae33c4f1e3a..467b539b20d 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -1390,7 +1390,7 @@ proc check_effective_target_shared { } {
>      # here to be undefined.
>      set extra_flags ""
>      if { [istarget *-*-darwin\[912\]*] } {
> -      set extra_flags "-Wl,-U,_foo,-U,_bar"
> +      set extra_flags "-Wl,-U,_foo,-U,_bar,-U,__Z3foov"
>      }

Ah that's an omission on my part, the fix applied recently was incomplete :-(.
(FWIW, the "C" fix doubled the number of libphobos tests, IIRC).

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-03-07 15:06 ` iains at gcc dot gnu.org
@ 2024-03-07 15:45 ` iains at gcc dot gnu.org
  2024-03-08 14:19 ` cvs-commit at gcc dot gnu.org
  2024-03-29 18:55 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-07 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #3)


> The question is: will this reveal new issues in other tests that weren't
> running before. I'm starting a new regtest and will post the results here.

Well, I do not think that actually matters (perhaps if newly revealed tests
hang, it's a problem - but otherwise it's just telling us something we should
already have known).

So, FAOD absent something drastic like a hanging testsuite, the update to the
darwin-specific code in the target-supports is OK.

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-03-07 15:45 ` iains at gcc dot gnu.org
@ 2024-03-08 14:19 ` cvs-commit at gcc dot gnu.org
  2024-03-29 18:55 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-08 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:8263a4b6505f84973c2ed2fb8d4f2036ca335ff3

commit r14-9392-g8263a4b6505f84973c2ed2fb8d4f2036ca335ff3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 8 15:18:56 2024 +0100

    testsuite: Fix up pr113617 test for darwin [PR113617]

    The test attempts to link a shared library, and apparently Darwin doesn't
    allow by default for shared libraries to contain undefined symbols.

    The following patch just adds dummy definitions for the symbols, so that
    the library no longer has any undefined symbols at least in my linux
    testing.
    Furthermore, for target { !shared } targets (like darwin until the it is
    fixed in target-supports.exp), because we then link a program rather than
    shared library, the patch also adds a dummy main definition so that it
    can link.

    2024-03-08  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/113617
            PR target/114233
            * g++.dg/other/pr113617.C: Define -DSHARED when linking with
-shared.
            * g++.dg/other/pr113617-aux.cc: Add definitions for used methods
and
            templates not defined elsewhere.

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

* [Bug target/114233] Newly-introduced pr113617.C test fails on Darwin
  2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-03-08 14:19 ` cvs-commit at gcc dot gnu.org
@ 2024-03-29 18:55 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-29 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> ---
thanks for the fixes, now passing on Darwin.

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

end of thread, other threads:[~2024-03-29 18:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05  7:24 [Bug target/114233] New: Newly-introduced pr113617.C test fails on Darwin fxcoudert at gcc dot gnu.org
2024-03-05  7:25 ` [Bug target/114233] " fxcoudert at gcc dot gnu.org
2024-03-06 20:32 ` iains at gcc dot gnu.org
2024-03-07 13:31 ` fxcoudert at gcc dot gnu.org
2024-03-07 14:25 ` fxcoudert at gcc dot gnu.org
2024-03-07 15:06 ` iains at gcc dot gnu.org
2024-03-07 15:45 ` iains at gcc dot gnu.org
2024-03-08 14:19 ` cvs-commit at gcc dot gnu.org
2024-03-29 18:55 ` iains 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).