[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 15 06:17:26 PDT 2025


tyan0 wrote:

> It looks like some linker options might still be missing or need adjustments:
> 
> * `--enable-auto-import`, `--disable-high-entropy-va`, and `--dll-search-prefix=cyg` are generally required on Cygwin.
> * `-pie` has no effect when targeting PE/COFF and can be ignored.
> 
> Also, a few options should be handled in both `class Cygwin` and in the linker job construction:
> 
> * `-mwindows` should be translated into `--subsystem=windows`.
> * `-shared` and `-mdll` are subtly different in what they instruct GCC to link with.

I have been convinced by your points regarding `-dll-search-prefix=cyg`, `-pie`, `-mwindows`, `-shared`, and `-mdll`. These have been implemented to the PR.

However, as for `--enable-auto-import` and `--disable-high-entropy-va`, gcc/g++ do not add these flags by default. I doubt these are really necessary. Why do you think these are needed?


https://github.com/llvm/llvm-project/pull/147960


More information about the cfe-commits mailing list