Bug#1029841: binutils-mingw-w64-x86-64: x86_64-w64-mingw32-ld internal error in ldlang.c
Hi Stephen, Thank you, I did some more testing in order to isolate it better, and have now uploaded a bug report upstream. I'll report depending on the outcome. (https://sourceware.org/bugzilla/show_bug.cgi?id=30079) Regards, Didier On 29/01/2023 15:08, Stephen Kitt wrote: Hi Didier, On Sat, 28 Jan 2023 18:07:12 +0100, Didier Smets wrote: I have a C project that I cross-compile for Win64 from Linux using mingw-w64. One of the targets is a dll which fails to build with the following : [ 96%] Linking C shared library libXPSV.dll /usr/bin/x86_64-w64-mingw32-ld: internal error: aborting at ./upstream/ld/ldlang.c:527 in compare_section /usr/bin/x86_64-w64-mingw32-ld: please report this bug collect2: error: ld returned 1 exit status The same project builds fine in bullseye. This appears to be an upstream bug; would you mind reporting it to <https://sourceware.org/bugzilla/>? You’ll probably have to provide more details. The CMake setup isn’t necessarily relevant; if at all possible, it would be useful to see the full commands used at each step, notably the ld invocation. The failure occurs at an abort() line, so it would also be useful to know what’s calling it; to see that, run the linker command using gdb, and note the output of "bt" when the linker aborts. Regards, Stephen
Bug#1029841: binutils-mingw-w64-x86-64: x86_64-w64-mingw32-ld internal error in ldlang.c
Package: binutils-mingw-w64-x86-64 Version: 2.39.90.20230110-1+10.3 Severity: normal Dear maintainer(s), I have a C project that I cross-compile for Win64 from Linux using mingw-w64. One of the targets is a dll which fails to build with the following : [ 96%] Linking C shared library libXPSV.dll /usr/bin/x86_64-w64-mingw32-ld: internal error: aborting at ./upstream/ld/ldlang.c:527 in compare_section /usr/bin/x86_64-w64-mingw32-ld: please report this bug collect2: error: ld returned 1 exit status The same project builds fine in bullseye. If that may help: The build goes through cmake using the following toolchain config file : # This file is intented to be used as a toolchain file for cmake # crosscompiling for Windows from Linux with mingw32-w64. set(CMAKE_SYSTEM_NAME Windows) set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) #set(CMAKE_EXE_LINKER_FLAGS " -static-libgcc ") Kind regards, Didier Smets -- System Information: Debian Release: bookworm/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 6.1.0-2-amd64 (SMP w/16 CPU threads; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages binutils-mingw-w64-x86-64 depends on: ii binutils-common 2.40-2 ii libc62.36-8 ii libzstd1 1.5.2+dfsg2-3 ii zlib1g 1:1.2.13.dfsg-1 binutils-mingw-w64-x86-64 recommends no packages. binutils-mingw-w64-x86-64 suggests no packages. -- no debconf information