public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
@ 2023-09-27  9:25 jamborm at gcc dot gnu.org
  2023-09-27  9:43 ` [Bug target/111610] " iains at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-09-27  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111610
           Summary: Cannot build cross compiler to darwin targets after
                    r14-4108-g47346acb72b50d
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-apple-darwin

We periodically try building cross-compilers (from x86_64-linux) to
most available targets in order to detect early when they don't build.
Recently we have detected failures building cross-compiler to
i686-apple-darwin, i686-apple-darwin9, i686-apple-darwin10, powerpc-darwin8,
powerpc-darwin7, powerpc64-darwin and x86_64-apple-darwin.

On x86_64-apple-darwin, we I have bisected the problem to
r14-4108-g47346acb72b50d (Darwin,debug : Switch to DWARF 3 or 4 when
dsymutil supports it):

    Darwin,debug : Switch to DWARF 3 or 4 when dsymutil supports it.

    The main reason that Darwin has been using DWARF2 only as debug is that
    earlier debug linkers (dsymutil) did not support any extensions to this
    so that the default "non-strict" mode used in GCC would cause tool errors.

    There are two sources for dsymutil, those based off a closed source base
    "dwarfutils" and those based off LLVM.

    For dsymutil versions based off LLVM-7+ we can use up to DWARF-4, and for
    versions based on dwarfutils 121+ we can use DWARF-3.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

    gcc/ChangeLog:

            * config/darwin-protos.h (enum darwin_external_toolchain): New.
            * config/darwin.cc (DSYMUTIL_VERSION): New.
            (darwin_override_options): Choose the default debug DWARF version
            depending on the configured dsymutil version.


We configure GCC with:

    ../src/configure --prefix=/tmp/some/prefix --enable-languages=c,c++
--enable-checking=yes --disable-bootstrap --disable-multilib --enable-obsolete
--target=x86_64-apple-darwin

and then check by running:  make -j64 all-host

The failure is:

g++  -fno-PIE -c   -g -O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H
-fno-PIE -I. -I. -I/home/mjambor/gcc/mine/src/gcc
-I/home/mjambor/gcc/mine/src/gcc/. -I/home/mjambor/gcc/mine/src/gcc/../include 
-I/home/mjambor/gcc/mine/src/gcc/../libcpp/include
-I/home/mjambor/gcc/mine/src/gcc/../libcody 
-I/home/mjambor/gcc/mine/src/gcc/../libdecnumber
-I/home/mjambor/gcc/mine/src/gcc/../libdecnumber/dpd -I../libdecnumber
-I/home/mjambor/gcc/mine/src/gcc/../libbacktrace   -o darwin.o -MT darwin.o
-MMD -MP -MF ./.deps/darwin.TPo /home/mjambor/gcc/mine/src/gcc/config/darwin.cc
In file included from ./config.h:6,
                 from /home/mjambor/gcc/mine/src/gcc/config/darwin.cc:21:
./auto-host.h:106:26: error: cannot convert ‘rtx_code’ to
‘darwin_external_toolchain’ in initialization
  106 | #define DSYMUTIL_VERSION UNKNOWN,0,0,0
      |                          ^~~~~~~
      |                          |
      |                          rtx_code
/home/mjambor/gcc/mine/src/gcc/config/darwin.cc:128:23: note: in expansion of
macro ‘DSYMUTIL_VERSION’
  128 | } dsymutil_version = {DSYMUTIL_VERSION};
      |                       ^~~~~~~~~~~~~~~~

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
@ 2023-09-27  9:43 ` iains at gcc dot gnu.org
  2023-09-27 11:35 ` jamborm at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2023-09-27  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-09-27
             Status|UNCONFIRMED                 |NEW
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
Hmm - so I guess you have no host-side dsymutil (e.g. built from LLVM) and do
something like symlink /usr/bin/true -> dsymutil?

I guess we have to fix configure to return an "unknown" for that.

----

As a matter of record, we do not really support cross-compilers targeting an
unknown Darwin version (the idea of xxx-apple-darwin [without a specific
version] was to support building natively on macOS).  What will happen is you
will get the earliest supported OS version for the target arch (which might not
really be very representative)

It would likely be more representative/useful to choose some suitable OS
version:

e.g. powerpc-apple-darwin9 (latest) i686-apple-darwin17 (last 32b support)
x86_64-apple-darwin21 (up to date) .. and eventually aarch64-apple-darwin2x
....

Of course, the build should not fail so we must fix it - but just pointing out
that the results from the current builds are from a configuration that will be
issuing warnings about choice of OS version.

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
  2023-09-27  9:43 ` [Bug target/111610] " iains at gcc dot gnu.org
@ 2023-09-27 11:35 ` jamborm at gcc dot gnu.org
  2023-09-27 13:35 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-09-27 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #1)
> As a matter of record, we do not really support cross-compilers targeting an
> unknown Darwin version (the idea of xxx-apple-darwin [without a specific
> version] was to support building natively on macOS).  What will happen is
> you will get the earliest supported OS version for the target arch (which
> might not really be very representative)
> 
> It would likely be more representative/useful to choose some suitable OS
> version:
> 
> e.g. powerpc-apple-darwin9 (latest) i686-apple-darwin17 (last 32b support)
> x86_64-apple-darwin21 (up to date) .. and eventually aarch64-apple-darwin2x
> ....
> 
> Of course, the build should not fail so we must fix it - but just pointing
> out that the results from the current builds are from a configuration that
> will be issuing warnings about choice of OS version.

IIUC, the test script takes all targets listed in contrib/config-list.mk and
tries the above configuration and make all-host steps on all of those targets
that are not explicitly excluded (currently only powerpc-freebsd13 because of
PR 108491). I don't really know how (or if) the list in that file is
maintained, but it looks like if they should be removed, they should be removed
from there?  Of course, we can exclude anything on our end too.

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
  2023-09-27  9:43 ` [Bug target/111610] " iains at gcc dot gnu.org
  2023-09-27 11:35 ` jamborm at gcc dot gnu.org
@ 2023-09-27 13:35 ` iains at gcc dot gnu.org
  2023-09-27 13:42 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2023-09-27 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Martin Jambor from comment #2)
> (In reply to Iain Sandoe from comment #1)
> > As a matter of record, we do not really support cross-compilers targeting an
> > unknown Darwin version (the idea of xxx-apple-darwin [without a specific
> > version] was to support building natively on macOS).  What will happen is
> > you will get the earliest supported OS version for the target arch (which
> > might not really be very representative)
> > 
> > It would likely be more representative/useful to choose some suitable OS
> > version:
> > 
> > e.g. powerpc-apple-darwin9 (latest) i686-apple-darwin17 (last 32b support)
> > x86_64-apple-darwin21 (up to date) .. and eventually aarch64-apple-darwin2x
> > ....
> > 
> > Of course, the build should not fail so we must fix it - but just pointing
> > out that the results from the current builds are from a configuration that
> > will be issuing warnings about choice of OS version.
> 
> IIUC, the test script takes all targets listed in contrib/config-list.mk and
> tries the above configuration and make all-host steps on all of those
> targets that are not explicitly excluded (currently only powerpc-freebsd13
> because of PR 108491). I don't really know how (or if) the list in that file
> is maintained, but it looks like if they should be removed, they should be
> removed from there?  Of course, we can exclude anything on our end too.

OK. Perhaps that list should be edited to reflect modern practice - but, if not
it's still better to have an old configuration tested than nothing (after all
it found this issue).  As it happens, we did already check for the
missing/unknown case for dsymutil but the enumeration clashes with another RTL
use of "UNKNOWN".  I'll land the fix shortly.

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-09-27 13:35 ` iains at gcc dot gnu.org
@ 2023-09-27 13:42 ` cvs-commit at gcc dot gnu.org
  2023-09-27 13:49 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-27 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:2ecab2f32b9e9a75bf563f80752d5b44dcd26b98

commit r14-4298-g2ecab2f32b9e9a75bf563f80752d5b44dcd26b98
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Sep 27 11:05:31 2023 +0100

    Darwin, configure: Allow for an unrecognisable dsymutil [PR111610].

    We had a catch-all configuration case for missing or unrecognised dsymutil
    but it was setting the dsymutil source to "UNKNOWN" which is not usable in
    this context (since it clashes with an existing enum).  We rename this to
    DET_UNKNOWN (for Darwin External Toolchain).

            PR target/111610

    gcc/ChangeLog:

            * configure: Regenerate.
            * configure.ac: Rename the missing dsymutil case to "DET_UNKNOWN".

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-09-27 13:42 ` cvs-commit at gcc dot gnu.org
@ 2023-09-27 13:49 ` iains at gcc dot gnu.org
  2024-03-31  9:00 ` cvs-commit at gcc dot gnu.org
  2024-04-25 19:24 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2023-09-27 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
so, should be fixed.

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-09-27 13:49 ` iains at gcc dot gnu.org
@ 2024-03-31  9:00 ` cvs-commit at gcc dot gnu.org
  2024-04-25 19:24 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-31  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:17e5d36db43f22a696a97c24afb5fb36b00dfb0b

commit r13-8533-g17e5d36db43f22a696a97c24afb5fb36b00dfb0b
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Sep 27 11:05:31 2023 +0100

    Darwin, configure: Allow for an unrecognisable dsymutil [PR111610].

    We had a catch-all configuration case for missing or unrecognised dsymutil
    but it was setting the dsymutil source to "UNKNOWN" which is not usable in
    this context (since it clashes with an existing enum).  We rename this to
    DET_UNKNOWN (for Darwin External Toolchain).

            PR target/111610

    gcc/ChangeLog:

            * configure: Regenerate.
            * configure.ac: Rename the missing dsymutil case to "DET_UNKNOWN".

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit 2ecab2f32b9e9a75bf563f80752d5b44dcd26b98)

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

* [Bug target/111610] Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d
  2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-03-31  9:00 ` cvs-commit at gcc dot gnu.org
@ 2024-04-25 19:24 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-25 19:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:1fd4db58480a518b05dd835157e59b2ed9fd2bc1

commit r11-11371-g1fd4db58480a518b05dd835157e59b2ed9fd2bc1
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Sep 27 11:05:31 2023 +0100

    Darwin, configure: Allow for an unrecognisable dsymutil [PR111610].

    We had a catch-all configuration case for missing or unrecognised dsymutil
    but it was setting the dsymutil source to "UNKNOWN" which is not usable in
    this context (since it clashes with an existing enum).  We rename this to
    DET_UNKNOWN (for Darwin External Toolchain).

            PR target/111610

    gcc/ChangeLog:

            * configure: Regenerate.
            * configure.ac: Rename the missing dsymutil case to "DET_UNKNOWN".

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit 2ecab2f32b9e9a75bf563f80752d5b44dcd26b98)

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27  9:25 [Bug target/111610] New: Cannot build cross compiler to darwin targets after r14-4108-g47346acb72b50d jamborm at gcc dot gnu.org
2023-09-27  9:43 ` [Bug target/111610] " iains at gcc dot gnu.org
2023-09-27 11:35 ` jamborm at gcc dot gnu.org
2023-09-27 13:35 ` iains at gcc dot gnu.org
2023-09-27 13:42 ` cvs-commit at gcc dot gnu.org
2023-09-27 13:49 ` iains at gcc dot gnu.org
2024-03-31  9:00 ` cvs-commit at gcc dot gnu.org
2024-04-25 19:24 ` cvs-commit 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).