msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.27k stars 1.21k forks source link

collect2.exe: error: ld returned 1 exit status #11670

Open masta99wrfvsHsa opened 2 years ago

masta99wrfvsHsa commented 2 years ago

Tried compiling luajit with mingw64.but failed,other project also failed with the collect2.exe error

log> make ==== Building LuaJIT 2.1.0-beta3 ==== make -C src make[1]: Entering directory '/d/Coding/C/3rdpartyfosslib/LuaJIT-2.1/src' HOSTLINK host/minilua.exe /usr/bin/ld: error: E:/sharedfossbin/WinPortablesoftware/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../lib/crt2.o: lseek: Bad file descriptor collect2.exe: error: ld returned 1 exit status make[1]: [Makefile:642: host/minilua.exe] Error 1 make[1]: Leaving directory '/d/Coding/C/3rdpartyfosslib/LuaJIT-2.1/src' make: [Makefile:113: default] Error 2

masta99wrfvsHsa commented 2 years ago

bump,is it NOT-FIXABLE?

Biswa96 commented 2 years ago

Apology for missing this issue 🙇 Can you provide all the steps to reproduce this issue? luajit package is provided as a mingw package. See all the files here https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-luajit

masta99wrfvsHsa commented 2 years ago

to utilize the package.do i just do:pacman -S luajit ? Actually the main reason I wanted to self compile luajit is to have a static binary for windows and use it in environments that may not have msys2. Is that possible?

masta99wrfvsHsa commented 2 years ago

thanks for update btw

masta99wrfvsHsa commented 2 years ago

i am not even sure where to start for steps, what i know is the toolchain is up to date. $ pacman -S --needed base-devel mingw-w64-x86_64-toolchain warning: base-devel-2022.01-2 is up to date -- skipping .....

so i assume there are only two possibility,local copy corrupt or maybe toolchain bug.

Biswa96 commented 2 years ago

There is a libluajit-5.1.a static library in luajit package. If you want to compile native windows binary you can install the package with pacman -S mingw-w64-x86_64-luajit command. But I am not sure if static linking is possible. The mingw package itself may require some modifications to do so.

masta99wrfvsHsa commented 2 years ago

Noted,i will keep this issue open then since I wanted to have static binary.Thanks for the help though.