public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/115300] New: gcc 14 cannot compile itself on Windows when bootstrap-lto is specified
@ 2024-05-31  7:00 tanksherman27 at gmail dot com
  2024-05-31  7:08 ` [Bug lto/115300] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tanksherman27 at gmail dot com @ 2024-05-31  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115300
           Summary: gcc 14 cannot compile itself on Windows when
                    bootstrap-lto is specified
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tanksherman27 at gmail dot com
  Target Milestone: ---

gcc 14 seems to be unable to compile itself when the bootstrap config that is
active is bootstrap-lto, to turn on Link Time Optimization for the gcc being
compiled. The following is the configure command:

  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105507#c3
  # At least with mingw32 + dwarf-2 exceptions there can only be one libgcc in
  # process, or exceptions will no longer work. Since some of the gcc deps are
  # linked dynamically like gmp/zlib/zstd and those pull in libgcc we can't
  # allow libgcc to be linked statically. The default is "-static-libstdc++
  # -static-libgcc" for both, so we drop "-static-libgcc" here:
  # GCC 14 Update: Since we dropped 32bit Ada with GCC 14.1 and GCC doesn't use
  # exceptions elsewhere this could in theory be removed, in case it makes
problems.
  _extra_config+=(
    '--with-boot-ldflags="-static-libstdc++"'
    '--with-stage1-ldflags="-static-libstdc++"'
  )

  # In addition adaint.c does `#include <accctrl.h>` which pulls in msxml.h,
hacky hack:
  CPPFLAGS+=" -DCOM_NO_WINDOWS_H"

  ../${_sourcedir}/configure \
    --prefix=${MINGW_PREFIX} \
    --with-local-prefix=${MINGW_PREFIX}/local \
    --with-build-config='bootstrap-lto' \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --with-native-system-header-dir=${MINGW_PREFIX}/include \
    --libexecdir=${MINGW_PREFIX}/lib \
    --enable-bootstrap \
    --enable-checking=release \
    --with-arch=${_arch} \
    --with-tune=generic \
    --enable-languages=${_languages} \
    --enable-shared \
    --enable-static \
    --enable-libatomic \
    --enable-threads=${_threads} \
    --enable-graphite \
    --enable-fully-dynamic-string \
    --enable-libstdcxx-threads \
    --enable-libstdcxx-filesystem-ts \
    --enable-libstdcxx-time \
    --disable-libstdcxx-pch \
    --enable-lto \
    --enable-libgomp \
    --disable-libssp \
    --disable-multilib \
    --disable-rpath \
    --disable-win32-registry \
    --disable-nls \
    --disable-werror \
    --disable-symvers \
    --with-libiconv \
    --with-system-zlib \
    --with-{gmp,mpfr,mpc,isl}=${MINGW_PREFIX} \
    --with-pkgversion="Rev${pkgrel}, Built by MSYS2 project" \
    --with-bugurl="https://github.com/msys2/MINGW-packages/issues" \
    --with-gnu-as \
    --with-gnu-ld \
    "${_extra_config[@]}"

...and the invocation of make:

  # https://gcc.gnu.org/onlinedocs/gccint/Makefile.html
  make -O STAGE1_CFLAGS="-O2" \
          --jobs profiledbootstrap

This fails with the following error:

C:\msys64\ucrt64\x86_64-w64-mingw32\bin\ld.exe: error: export ordinal too
large: 91917
C:\msys64\ucrt64\x86_64-w64-mingw32\bin\ld.exe: error: export ordinal too
large: 91820
collect2.exe: error: ld returned 1 exit status
make[3]: *** [../../gcc-14.1.0/gcc/lto/Make-lang.in:102: lto-dump.exe] Error 1
make[3]: *** Waiting for unfinished jobs....
collect2.exe: error: ld returned 1 exit status
make[3]: *** [../../gcc-14.1.0/gcc/lto/Make-lang.in:96: lto1.exe] Error 1
C:\msys64\ucrt64\x86_64-w64-mingw32\bin\ld.exe: error: export ordinal too
large: 94928
collect2.exe: error: ld returned 1 exit status
make[3]: *** [../../gcc-14.1.0/gcc/c/Make-lang.in:87: cc1.exe] Error 1
C:\msys64\ucrt64\x86_64-w64-mingw32\bin\ld.exe: error: export ordinal too
large: 97453
collect2.exe: error: ld returned 1 exit status
make[3]: *** [../../gcc-14.1.0/gcc/cp/Make-lang.in:145: cc1plus.exe] Error 1
rm gcc.pod
make[2]: *** [Makefile:5228: all-stageprofile-gcc] Error 2
make[1]: *** [Makefile:23910: stageprofile-bubble] Error 2
make: *** [Makefile:24164: profiledbootstrap] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

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

* [Bug lto/115300] gcc 14 cannot compile itself on Windows when bootstrap-lto is specified
  2024-05-31  7:00 [Bug lto/115300] New: gcc 14 cannot compile itself on Windows when bootstrap-lto is specified tanksherman27 at gmail dot com
@ 2024-05-31  7:08 ` pinskia at gcc dot gnu.org
  2024-05-31  7:10 ` tanksherman27 at gmail dot com
  2024-05-31  8:22 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-31  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2024-05-31
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This looks more like a binutils ld issue. We are linking an executable here,
not a dll.

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

* [Bug lto/115300] gcc 14 cannot compile itself on Windows when bootstrap-lto is specified
  2024-05-31  7:00 [Bug lto/115300] New: gcc 14 cannot compile itself on Windows when bootstrap-lto is specified tanksherman27 at gmail dot com
  2024-05-31  7:08 ` [Bug lto/115300] " pinskia at gcc dot gnu.org
@ 2024-05-31  7:10 ` tanksherman27 at gmail dot com
  2024-05-31  8:22 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tanksherman27 at gmail dot com @ 2024-05-31  7:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Julian Waters <tanksherman27 at gmail dot com> ---
Understood, will also report this to binutils

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

* [Bug lto/115300] gcc 14 cannot compile itself on Windows when bootstrap-lto is specified
  2024-05-31  7:00 [Bug lto/115300] New: gcc 14 cannot compile itself on Windows when bootstrap-lto is specified tanksherman27 at gmail dot com
  2024-05-31  7:08 ` [Bug lto/115300] " pinskia at gcc dot gnu.org
  2024-05-31  7:10 ` tanksherman27 at gmail dot com
@ 2024-05-31  8:22 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-31  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can you try --disable-plugin?  It might be the mingw equivalent of exporting
all dynamic symbols from the cc1 binary runs into target limitations?  It looks
like the default on *-*-mingw* is disabled though ...

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

end of thread, other threads:[~2024-05-31  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-31  7:00 [Bug lto/115300] New: gcc 14 cannot compile itself on Windows when bootstrap-lto is specified tanksherman27 at gmail dot com
2024-05-31  7:08 ` [Bug lto/115300] " pinskia at gcc dot gnu.org
2024-05-31  7:10 ` tanksherman27 at gmail dot com
2024-05-31  8:22 ` rguenth 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).