Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with MinGW LLVM: "unknown argument: -nostdlib, -soname" #410

Open
ariankordi opened this issue Apr 20, 2024 · 0 comments
Open

Building with MinGW LLVM: "unknown argument: -nostdlib, -soname" #410

ariankordi opened this issue Apr 20, 2024 · 0 comments
Labels

Comments

@ariankordi
Copy link

I'm trying to build for Windows ARM64 from Linux and this LLVM MinGW toolchain I got from https://github.com/mstorsjo/llvm-mingw seems to be the best choice.

However, I've tried on and off to build this, even with the x86_64 version, and it keeps showing me this (I've tried versions going back to 2018 and it shows the same thing):

arian@debian /d/s/glew (master)> PATH=/dev/shm/llvm-mingw-20240417-ucrt-ubuntu-20.04-x86_64/bin/:$PATH SYSTEM=linux-mingw64 make
mkdir lib
x86_64-w64-mingw32-gcc -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -fno-builtin -fno-stack-protector -Wno-cast-function-type  -o tmp/linux-mingw64/default/shared/glew.o -c src/glew.c
x86_64-w64-mingw32-ld -nostdlib -shared -soname libglew32.dll --out-implib lib/libglew32.dll.a     -o lib/glew32.dll tmp/linux-mingw64/default/shared/glew.o  -L/usr/x86_64-w64-mingw32/lib -lopengl32 -lgdi32 -luser32 -lkernel32 
lld: error: unknown argument: -nostdlib
lld: error: unknown argument: -soname
make: *** [Makefile:123: lib/glew32.dll] Error 1

If I remove -nostdlib and -soname, it shows me this:

arian@debian /d/s/glew (master)> PATH=/dev/shm/llvm-mingw-20240417-ucrt-ubuntu-20.04-x86_64/bin/:$PATH SYSTEM=linux-mingw64 make
x86_64-w64-mingw32-ld -shared --out-implib lib/libglew32.dll.a     -o lib/glew32.dll tmp/linux-mingw64/default/shared/glew.o  -L/usr/x86_64-w64-mingw32/lib -lopengl32 -lgdi32 -luser32 -lkernel32 
ld.lld: error: <root>: undefined symbol: _DllMainCRTStartup
make: *** [Makefile:123: lib/glew32.dll] Error 1

I know that the linux-mingw64 config assumes GCC and this is probably clang, but I'm not sure what modifications to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants