tyan0 wrote:

> Could you let I know output of `echo | clang -xc - -v` (and some option 
> variants) with patch?

```
$ echo | clang -xc - -v
clang version 20.1.7 (ssh://ty...@cygwin.com/git/cygwin-packages/clang 
9fadb5f0ea7d31bddc623bbd3c6a9beff4d235fc)
Target: x86_64-pc-windows-cygnus
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-cygwin/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-pc-cygwin/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/usr/bin/clang-20" -cc1 -triple x86_64-pc-windows-cygnus -emit-obj -dumpdir 
a- -disable-free -clear-ast-before-backend -disable-llvm-verifier 
-discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 
-mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math 
-mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic 
-debugger-tuning=gdb 
-fdebug-compilation-dir=/home/yano/llvm-project/clang/lib/Driver/ToolChains -v 
-fcoverage-compilation-dir=/home/yano/llvm-project/clang/lib/Driver/ToolChains 
-resource-dir /usr/lib/clang/20 -internal-isystem /usr/local/include 
-internal-isystem /usr/lib/clang/20/include -internal-isystem 
/usr/bin/../lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/include 
-internal-externc-isystem /include -internal-externc-isystem /usr/include 
-internal-externc-isystem /usr/include/w32api -ferror-limit 19 -femulated-tls 
-fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -exception-model=seh 
-fcolor-diagnostics -faddrsig -o /tmp/--cf4ef2.o -x c -
clang -cc1 version 20.1.7 based upon LLVM 20.1.7 default target 
x86_64-pc-windows-cygnus
ignoring nonexistent directory 
"/usr/bin/../lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/clang/20/include
 /usr/include
 /usr/include/w32api
End of search list.
 "/usr/bin/ld" -m i386pep --wrap=_Znwm --wrap=_Znam --wrap=_ZdlPv --wrap=_ZdaPv 
--wrap=_ZnwmRKSt9nothrow_t --wrap=_ZnamRKSt9nothrow_t 
--wrap=_ZdlPvRKSt9nothrow_t --wrap=_ZdaPvRKSt9nothrow_t -o a.exe 
/usr/bin/../lib/crt0.o /usr/bin/../lib/gcc/x86_64-pc-cygwin/12/crtbegin.o 
-L/usr/bin/../lib/gcc/x86_64-pc-cygwin/12 
-L/usr/bin/../lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/lib 
-L/usr/bin/../lib -L/lib -L/usr/lib -L/usr/lib/w32api /tmp/--cf4ef2.o -lgcc 
-lgcc_s -lc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc -lgcc_s 
/usr/bin/../lib/gcc/x86_64-pc-cygwin/12/crtend.o
/usr/bin/ld: /usr/bin/../lib/libcygwin.a(libcmain.o): in function `main':
/usr/src/debug/cygwin-3.6.3-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x79):
 undefined reference to `WinMain'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

> Does this patch consider to use of LLD? ( gcc and clang can use with LLD: 
> `-fuse-ld=lld -L/usr/lib/w32api 
> -Wl,--enable-auto-import,--disable-high-entropy-va,--disable-nxcompat,--wrap,_Znwm,--wrap,_Znam,--wrap,_ZdlPv,--wrap,_ZdaPv,--wrap,_ZnwmRKSt9nothrow_t,--wrap,_ZnamRKSt9nothrow_t,--wrap,_ZdlPvRKSt9nothrow_t,--wrap,_ZdaPvRKSt9nothrow_t,-u,_Znwm,-u,_Znam,-u,_ZdlPv,-u,_ZdaPv,-u,_ZnwmRKSt9nothrow_t,-u,_ZnamRKSt9nothrow_t,-u,_ZdlPvRKSt9nothrow_t,-u,_ZdaPvRKSt9nothrow_t`
>  )

I confirmed 'clang++ -fuse-ld=lld` works. What is your concern about LLD?


https://github.com/llvm/llvm-project/pull/147960
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to