mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.93k stars 186 forks source link

-mwin32 option not supported #450

Open tomager opened 2 months ago

tomager commented 2 months ago

The gcc-supported option -mwin32 doesn't appear to be supported in llvm-mingw/clang.

A handful of the other options listed at [2] are also unsupported, but -mwin32 seems to be the only "core" option that isn't supported on the llvm side.

The supported options are -mwindows -municode -mthreads -mdll -mconsole

The unsupported options are -mpe-aligned-commons -fwritable-relocated-rdata -fno-set-stack-executable -mnop-fun-dllimport -mwin32

[1] from libusb llvm-mingw build:

# xllvm-x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc -mwin32 core.c
clang: error: unknown argument: '-mwin32'

[2] https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html

[3]

# /xllvm-x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc --version
clang version 18.1.8 (git b2669acf1d335d910be106ced6fca6ef5d67d399)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: /xllvm-x86_64-w64-mingw32/linux-x86_64/bin
mati865 commented 2 months ago

-mwin32 is a Cygwin option, not MinGW/mingw-w64 related one: https://github.com/libusb/libusb/blob/467b6a8896daea3d104958bf0887312c5d14d150/configure.ac#L130

tomager commented 2 months ago

I guess this was recently changed. In 1.0.26 which we use and is quite recent it’s for both cygwin and mingw:

https://github.com/libusb/libusb/blob/v1.0.26/configure.ac

The current gcc docs (link I posted earlier) say it’s for both:

This option is available for Cygwin and MinGW targets. It specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor, but does not influence the choice of runtime library/startup code.