Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mingw64-toolchain and mold
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 185

PostPosted: Tue Mar 26, 2024 10:57 am    Post subject: mingw64-toolchain and mold Reply with quote

Hi,

After the profile upgrade, the "emerge -e @world" didn't complete, I noticed it crashed when recompiling mingw64-toolchain. Here's a part of build.log

Code:
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=native -fuse-ld=mold -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o ranlib ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a -lfl
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=native -fuse-ld=mold -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o addr2line addr2line.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=native -fuse-ld=mold -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o elfedit elfedit.o version.o elfcomm.o  ../libiberty/libiberty.a
gcc: fatal error: no input files
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
mold: fatal: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1094: windmc] Error 1
gcc: fatal error: no input files
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
mold: fatal: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1051: ranlib] Error 1
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=native -fuse-ld=mold -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o bfdtest1 bfdtest1.o  ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=native -fuse-ld=mold -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o cxxfilt cxxfilt.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a
mv -f .deps/dlltool.Tpo .deps/dlltool.Po
mv -f .deps/objdump.Tpo .deps/objdump.Po
mv -f .deps/dwarf.Tpo .deps/dwarf.Po
mv -f .deps/readelf.Tpo .deps/readelf.Po
make[4]: Leaving directory '/var/tmp/portage/dev-util/mingw64-toolchain-11.0.0_p2/work/binutils-build/binutils'
make[3]: *** [Makefile:1438: all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/dev-util/mingw64-toolchain-11.0.0_p2/work/binutils-build/binutils'
make[2]: *** [Makefile:881: all] Error 2
make[2]: Leaving directory '/var/tmp/portage/dev-util/mingw64-toolchain-11.0.0_p2/work/binutils-build/binutils'
make[1]: *** [Makefile:4061: all-binutils] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-util/mingw64-toolchain-11.0.0_p2/work/binutils-build'
make: *** [Makefile:1004: all] Error 2


Since I'm using mold systemwide LDFLAGS="-fuse-ld=mold ${LDFLAGS}", I tried again using a no-mold gcc, and it worked.
Can anyone confirm that issue ? Should I report it to mold github ?


Gcc version 13.2.1_p20240210; mold version 2.4.0
_________________
Dragon Princess Music Games Heroes and villains
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2837

PostPosted: Tue Mar 26, 2024 12:39 pm    Post subject: Reply with quote

lto-wrapper coming up sounds odd, the ebuild does filter-lto unconditionally (even with USE=custom-cflags) because it's known broken as things are, and "afaik" binutils shouldn't be adding it on its own without pgo (which is always disabled for this ebuild). Not that I can see what happened earlier without the full build.log.

From a quick try, it builds fine with 23.0 LDFLAGS + -fuse-ld=mold for me, maybe I'm missing something to trigger it. Albeit for fwiw I used ~testing mold-2.30.0 (haven't tried 2.4.0), my gcc is the same.

Not impossible you just hit a rare race condition and it's entirely unrelated to mold too (no input files error sounds odd as well), i.e. may work if try again maybe with a different MAKEOPTS=-jN value to help. Albeit first time I see this one.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 185

PostPosted: Tue Mar 26, 2024 12:57 pm    Post subject: Reply with quote

Here's the full build.log

I'm no expert, but as I understand it, the first lines are telling mingw64-toolchain provides its own gcc version. Could that be the cause ?
_________________
Dragon Princess Music Games Heroes and villains
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2837

PostPosted: Tue Mar 26, 2024 1:03 pm    Post subject: Reply with quote

krumpf wrote:
Here's the full build.log

I'm no expert, but as I understand it, the first lines are telling mingw64-toolchain provides its own gcc version. Could that be the cause ?
Doesn't matter, it's failing while building binutils which is the first step before it even builds mingw gcc.

That aside, unfortunately no immediate idea what might've happened looking at the log.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 185

PostPosted: Tue Mar 26, 2024 1:58 pm    Post subject: Reply with quote

I've tried again after upgrading mold from 2.4.1 to 2.30.0, it ends the same way.
Here's the build.log for this attempt.
_________________
Dragon Princess Music Games Heroes and villains
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum