alire-project / GNAT-FSF-builds

Builds of the GNAT Ada compiler from FSF GCC releases
MIT License
32 stars 9 forks source link

gnat 12.2.1 does not link on Windows #43

Open stephe-ada-guru opened 1 year ago

stephe-ada-guru commented 1 year ago

$ alr toolchain --install gnat_native --install-dir=c:/home/stephe/.local

;;# include in PATH

$ gprbuild hello using project file C:\home\stephe.local\gprbuild_22.0.1_c842bbc5\share\gpr_default.gpr Compile [Ada] hello.adb Bind [gprbind] hello.bexch [Ada] hello.ali Link [link] hello.adb c:/home/stephe/.local/gnat_native_12.2.1_c210a022/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/home/stephe/.local/gnat_native_12.2.1_c210a022/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/liblto_plugin.dll: error loading plugin: collect2.exe: error: ld returned 1 exit status gprbuild: link of hello.adb failed gprbuild: failed command was: c:\home\stephe.local\gnat_native_12.2.1_c210a022\bin\gcc.exe hello.o b__hello.o -LC:\home\stephe\Ada_Work\ -LC:\home\stephe\Ada_Work\ -LC:/home/stephe/.local/gnat_native_12.2.1_c210a022/lib/gcc/x86_64-w64-mingw32/12.2.0/adalib/ -static-libgcc C:/home/stephe/.local/gnat_native_12.2.1_c210a022/lib/gcc/x86_64-w64-mingw32/12.2.0/adalib/libgnat.a -Wl,--stack=0x2000000 -o hello.exe

liblto_plugin.dll exists; apparently it is corrupted.

gnat_native 12.1.1 has the same problem; as a workaround, I'm using gnat community 2021 on Windows.

hello.adb.txt

stephe-ada-guru commented 1 year ago

Is this the proper place to report this? or is there a gnat issue site? or gnat crate issue site?

mosteo commented 1 year ago

Our indexed builds come from the https://github.com/alire-project/GNAT-FSF-builds repo

I'm going to transfer this issue there as I think it is the right place.

Fabien-Chouteau commented 1 year ago

liblto_plugin.dll exists; apparently it is corrupted.

If the file is corrupted you should first try to re-install. 12.2.1 is working fine on my setup.

stephe-ada-guru commented 1 year ago

I reinstalled, same error. Adding -v didn't give any more useful information.

Perhaps it's trying to load some plugin, and that's failing. How do I get it to tell me which plugin? Or does the fact that there is no plugin name in the error message indicate it's trying to load a plugin with no name?

stephe-ada-guru commented 1 year ago

Just tried 'alr build' again; this time it deployed gnat 11.2.4; same error.

stephe-ada-guru commented 1 year ago

I just installed Alire on a virgin PC (Windows 11, no previous install of gnat or msys), and built emacs_ada_mode. The link succeeded. So it's something about my Windows setup that's causing the link fail. Sigh.