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 <i...@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};
      |                       ^~~~~~~~~~~~~~~~

Reply via email to