Re: Strange behaviour with Resource Compiler og GCC (MinGW32/64) and LLVM

2025年9月04日 10:39:43 -0700

On Thu, 4 Sep 2025, Thierry DECHAIZE via Cygwin wrote:
> Hi,
>
> I test new implementation of LLVM 20.1.8 recently provided by CYGWIN64 on
> WIN11 64 bit.
>
> Just to illustrated this strange behaviour read joined text : some tests with
> different Resource Compiler.
>
> I'm not a specialist, but it's seem important to ameliorate this behaviour in
> future release of LLVM on Cygwin64.
>
> You agree ?
This was kind of hard to follow... TL;DR: using Windows-style paths with
Cygwin programs yields inconsistent results. LLVM/Clang work better than
Binutils/GCC.
Specific failing case for llvm-windres:
$ mkdir src
$ touch src/resource.h
$ echo '#include "resource.h"' > src/test.rc
$ llvm-windres -v -o src/test.o src/test.rc
 /usr/bin/clang-21 --driver-mode=gcc -target x86_64-pc-windows-cygnus -E -xc 
-DRC_INVOKED src/test.rc -o /tmp/preproc-c14940.rc
$ llvm-windres -v -o src/test.o src\\test.rc
 /usr/bin/clang-21 --driver-mode=gcc -target x86_64-pc-windows-cygnus -E -xc 
-DRC_INVOKED "src\\test.rc" -o /tmp/preproc-9202d9.rc
src\test.rc:1:10: fatal error: 'resource.h' file not found
 1 | #include "resource.h"
 | ^~~~~~~~~~~~
1 error generated.
llvm-rc: Preprocessing failed.
In general, it's better to stick with Cygwin paths (forward slashes,
/cygdrive/c/ instead of C:\) for Cygwin programs. If you want native
LLVM/Clang that is also available, ie
https://github.com/mstorsjo/llvm-mingw or https://www.msys2.org CLANG64
environment
-- 
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple

Reply via email to