[clang] [Cygwin] Enable TLS on Cygwin target (PR #138618)

2025-05-05 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/138618 Cygwin environment and toolchain supports EMUTLS. >From >https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=config/tls.m4;hb=HEAD#l118, ``` $ LANG=C gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO

[clang] [Cygwin] Global symbols should be external by default (PR #139797)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/139797 Behaves as same as both of Clang and GCC targetting MinGW. Required for compatibility for Cygwin-GCC. Divided from https://github.com/llvm/llvm-project/pull/138773 >From 8bb0b61112d68f6cecbc15411f5080c413a4

[clang] [Cygwin] RTTI and VTable should be dllexport-ed (PR #139798)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/139798 Behaves as same as both of Clang and GCC targetting MinGW. Required for compatibility for Cygwin-GCC. Divided from https://github.com/llvm/llvm-project/pull/138773 Rate limit · GitHu

[clang] [Cygwin] Template instantiations should be exported by default (PR #139799)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/139799 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Thank you. I have divided into separated PRs. They don't have conflict each. https://github.com/llvm/llvm-project/pull/139797 https://github.com/llvm/llvm-project/pull/139798 https://github.com/llvm/llvm-project/pull/139799 https://github.com/llvm/llvm-project/pull/138773 ___

[clang] [Cygwin] Template instantiations should be exported by default (PR #139799)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/139799 Behaves as same as both of Clang and GCC targetting MinGW. Required for compatibility for Cygwin-GCC. https://github.com/llvm/llvm-project/pull/138773 Rate limit · GitHub

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/138773 MinGW-GCC and MinGW-Clang exports these symbols. Cygwin-GCC also exports them, so Cygwin-Clang should do so. Some of tests have new DAG pattern because i686-cygwin don't use __thiscall but __cdecl for member

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/138773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/3] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 47f81a804a36a5b685f130f22d2ab5d330170861 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 47f81a804a36a5b685f130f22d2ab5d330170861 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-14 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya closed https://github.com/llvm/llvm-project/pull/138773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cygwin] Global symbols should be external by default (PR #139797)

2025-05-14 Thread Tomohiro Kashiwada via cfe-commits
@@ -2,6 +2,8 @@ // RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm -std=c11 -O0 -o - %s | FileCheck %s // RUN: %clang_cc1 -triple i686-windows-gnu-fms-extensions -emit-llvm -std=c11 -O0 -o - %s | FileCheck %s // RUN: %clang_cc1 -triple x86_64-window

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-17 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 4f0eab77111d15515082c82d288f25ca88424a9e Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-20 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/140145 >From 37af003a4cc9afb74a05cddd5118ed0695cec632 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 21 Apr 2025 23:30:13 +0900 Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in explicitly-instantiation-de

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-15 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/140145 resolves https://github.com/llvm/llvm-project/issues/135910 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -a

[clang] [Clang-Tools][Windows] Fix driver name transformation in scan-build (PR #143135)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/143135 >From 7d6d26873656417f3dc194937d3406d90e47accb Mon Sep 17 00:00:00 2001 From: kikairoya Date: Fri, 2 May 2025 23:13:16 +0900 Subject: [PATCH] [Clang-Tools][Windows] Fix driver name transformation in scan-buil

[clang] [Clant-Tools][Windows] Fix driver name transformation in scan-build (PR #143135)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/143135 On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to "clang++.exe". >From 206a1215c3a26861e65e89951d3bf1b9552894b5 Mon Sep 17 00:00

[clang] [Clang-Tools][Windows] Fix driver name transformation in scan-build (PR #143135)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/143135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-10 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/143115 >From c64472a188825a1d814ea0523a6097d25949d6fb Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sun, 25 May 2025 14:07:29 +0900 Subject: [PATCH 1/3] [Cygwin] va_list must be treated like normal Windows Handling

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/143115 Handling of va_list on Cygwin environment must be matched to normal Windows environment. A new test file is added as existing test contains a unsupported functionality. >From c64472a188825a1d814ea0523a6097d25

[clang] [Cygwin] wint_t is unsigned int (PR #143117)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/143117 On Cygwin environment, wint_t is unsigned int as shown here: ``` $ echo | gcc -m32 -xc - -E -dM | grep WINT_T 145:#define __SIZEOF_WINT_T__ 4 315:#define __WINT_TYPE__ unsigned int ``` ``` $ echo | gcc -xc - -

[clang] [Clang][Cygwin] Use correct BuiltinVaListKind. (PR #143166)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: I have a test already: https://github.com/llvm/llvm-project/pull/143115 https://github.com/llvm/llvm-project/pull/143166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/143115 >From c64472a188825a1d814ea0523a6097d25949d6fb Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sun, 25 May 2025 14:07:29 +0900 Subject: [PATCH 1/2] [Cygwin] va_list must be treated like normal Windows Handling

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-07 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/143115 >From c64472a188825a1d814ea0523a6097d25949d6fb Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sun, 25 May 2025 14:07:29 +0900 Subject: [PATCH 1/2] [Cygwin] va_list must be treated like normal Windows Handling

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-09 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/143115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-09 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/143115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-09 Thread Tomohiro Kashiwada via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm < %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-cygwin -emit-llvm < %s | FileCheck %s + +// copy ms_abi block only from ../ms_abi.c kikairoya wrote: Updated description. https:/

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-10 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/143115 >From c64472a188825a1d814ea0523a6097d25949d6fb Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sun, 25 May 2025 14:07:29 +0900 Subject: [PATCH 1/3] [Cygwin] va_list must be treated like normal Windows Handling

[clang] [Cygwin] va_list must be treated like normal Windows (PR #143115)

2025-06-10 Thread Tomohiro Kashiwada via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm < %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-cygwin -emit-llvm < %s | FileCheck %s + +// copy ms_abi block only from ../ms_abi.c kikairoya wrote: I understand. Sorry. https:/

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

[clang] [llvm] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Thanks again. > I got pretty strong negative feedback on including these symlinks at all. I didn’t expect such a strong reaction... I'm really sorry for dragging you into it. > I've tried this with msys2 (where symlinks are really copies and > `LLVM_USE_SYMLINKS=OFF` and got

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-18 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > * LLD requires passing `-u _Znwm` and other operators explicitly, otherwise > [`default_cygwin_cxx_malloc` defined in > `libcygwin.a`](https://github.com/mirror/newlib-cygwin/blob/1b7c72fdcc4bde7520407d2d3364146f04fb8312/winsup/cygwin/cxx.cc#L92) > pulls wrong reference (at

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/147132 On Cygwin, a shared library target generates a versioned DLL file like `cyg${OUTPUT_NAME}-${VERSION}.dll` and an import library `lib${OUTPUT_NAME}.dll.a`, but it does *not* generate the expected unversioned

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/147108 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-04 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/147108 All other declarations of clang-c already have CINDEX_LINKAGE. >From 53359252688692f2b0e25f529335848db94cc166 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 11:50:14 +0900 Subject: [PATCH] [l

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-07 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/147132 >From 9198e98e6dd7a02c5c5b65e400d788b6bac3a3c3 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 13:11:42 +0900 Subject: [PATCH 1/4] [libclang][Cygwin] Put unversioned DLL file aside of versione

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-07 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Updated for use relative path to link target. https://github.com/llvm/llvm-project/pull/147132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang][Cygwin] Use LLVM_EXPORTED_SYMBOL_FILE (*.def file) for Cygwin (PR #147278)

2025-07-07 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/147278 This is not mandatory but recommended for completeness and consistency with MinGW. >From 8b20535225bcbbf7153eb133217ebc87083a7a23 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Mon, 7 Jul 2025 19:30:52 +0900

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-07 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > Yes, it's not mandatory but seems to be recommended. I will submit a new PR > later. https://github.com/llvm/llvm-project/pull/147278 https://github.com/llvm/llvm-project/pull/147108 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-08 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: I'm thinking about each DLLs: - libLLVM: - On Linux: `libLLVM.so`(symlink) and `libLLVM.so.21.0git` are built and installed. `libLLVM-21git.so`(symlink) is installed but doesn't appear in build-tree. - On Cygwin: Only `libLLVM-21git.dll.a` and `cygLLVM-21git.dll`

[clang] [llvm] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > I tested this and it broke things for me. This turns cygLLVM-20.dll into a > symlink, this doesn't work with existing binaries because DLLs in the import > table can't follow the Cygwin symlinks (they're loaded by the Windows > loader). It looks like for new binaries it does

[clang] [llvm] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/147132 >From 9198e98e6dd7a02c5c5b65e400d788b6bac3a3c3 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 13:11:42 +0900 Subject: [PATCH 1/5] [libclang][Cygwin] Put unversioned DLL file aside of versione

[clang] [llvm] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/147132 >From 9198e98e6dd7a02c5c5b65e400d788b6bac3a3c3 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 13:11:42 +0900 Subject: [PATCH 1/6] [libclang][Cygwin] Put unversioned DLL file aside of versione

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

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Thanks. 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,

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

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
@@ -1504,6 +1506,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args, switch (Type) { case ToolChain::CST_Libcxx: CmdArgs.push_back("-lc++"); +CmdArgs.push_back("-lc++abi"); kikairoya wrote: It's packaging policy matter, but it would be be

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

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: If we should consider cross-compiling, it's needed to be aware that `$SYSROOT/usr/lib` doesn't appear in real filesystem. https://github.com/llvm/llvm-project/pull/147960 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

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

2025-07-10 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Could you let I know output of `echo | clang -xc - -v` (and some option variants) with patch? Does this patch consider to use of LLD? ( gcc can use with LLD: `-fuse-ld=lld -L/usr/lib/w32api -Wl,--enable-auto-import,--disable-high-entropy-va,--disable-nxcompat,--wrap,_Znwm,--w

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

2025-07-10 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,289 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

[clang] [llvm] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-11 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > I think linking with `-lLLVM-20` should bind to `cygLLVM-20.dll`, or > `cygLLVM-20.1.dll` if `-lLLVM` but is it possible? It may be possible with llvm-dlltool but seems hacky. I've just reversed the link direction using SONAME and putting symlinks to it. https://github.com/

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/147132 >From 9198e98e6dd7a02c5c5b65e400d788b6bac3a3c3 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 13:11:42 +0900 Subject: [PATCH 1/2] [libclang][Cygwin] Put unversioned DLL file aside of versione

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > > AFAIK the dllexport annotations have been added using some automated tools, > > so it may be good to find the person who added the other annotations, so it > > can be looked into why this was missing here, if the annotations otherwise > > were seemingly complete enough. >

[clang] [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (PR #147122)

2025-07-04 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/147122 This is needed for Cygwin build without `-DLLVM_LINK_LLVM_DYLIB=ON`, otherwise causes a linker error 'export ordinal too large'. >From 4406a457b7cf3713dc9bea67bd7b68ecb61966bd Mon Sep 17 00:00:00 2001 From: k

[clang] [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (PR #147122)

2025-07-04 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Before merge this, requires https://github.com/llvm/llvm-project/pull/147108 https://github.com/llvm/llvm-project/pull/147122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (PR #147122)

2025-07-04 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: `git clang-format` makes reformat below, should it be applied? ```diff diff --git a/clang/include/clang-c/Platform.h b/clang/include/clang-c/Platform.h index 8d341ddd6f8e..1c28ccf81981 100644 --- a/clang/include/clang-c/Platform.h +++ b/clang/include/clang-c/Platform.h @@ -23,13

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > > Still it may be good to figure out why this hasn't been an issue so far, > > for whoever otherwise were using these dllexport annotations. > > I suspect it relates to module definition file (*.def). On MinGW, the symbol > is properly exported without annotation. Regular w

[clang] [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (PR #147122)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > > Before merge this, requires #147108 > > Can you elaborate on why this is needed - what happens without it - wouldn't > that issue be happening already now in regular win32 builds so far? The linker reports undefined reference to clang_install_aborting_llvm_fatal_error_han

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-05 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: https://github.com/llvm/llvm-project/blob/53359252688692f2b0e25f529335848db94cc166/clang/tools/libclang/CMakeLists.txt#L88-L93 MSVC doesn't use `libclang.def` and doesn't export `clang_install_aborting_llvm_fatal_error_handler`. ``` $ llvm-readobj --coff-exports '/c/Program Fil

[clang] [libclang] Add missing dllexport annotation (PR #147108)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > LGTM, but can you amend the PR description with the extra info you gathered, > about why this hasn't been an issue in other existing configurations? Thanks. I've update the description. > > It seems `AND NOT CYGWIN` should be added here. > > That sounds like a good additi

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/147132 >From 9198e98e6dd7a02c5c5b65e400d788b6bac3a3c3 Mon Sep 17 00:00:00 2001 From: kikairoya Date: Sat, 28 Jun 2025 13:11:42 +0900 Subject: [PATCH 1/3] [libclang][Cygwin] Put unversioned DLL file aside of versione

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/147132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > > a symlink alone won't suffice here, as `dlopen()` ultimately calls > > `LoadLibraryExW`, which does not follow Cygwin-style symlinks. > > If dlopen doesn't work on a Cygwin symlink, that is a bug in dlopen and > should be fixed in Cygwin. I had been misunderstood the func

[clang] [libclang][Cygwin] Provide unversioned DLL file alongside versioned one (PR #147132)

2025-07-06 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: I learned that a symlink works fine, so adding it to install-target might be a good idea. I'll look into that later. https://github.com/llvm/llvm-project/pull/147132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

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

2025-07-17 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > $ clang++ -fuse-ld=lld hello.cc Do you have patched to LLD locally? This should fail with `unable to find library -lkernel32`. > But it would mean that using gcc -fuse-ld=lld wouldn't work due to wrong > defaults. LLD and Clang are both part of LLVM, so they should be exp

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

2025-07-18 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > > > $ clang++ -fuse-ld=lld hello.cc > > > > > > Do you have patched to LLD locally? This should fail with `unable to find > > library -lkernel32`. > > this new driver should be passing all the necessary `-L` paths to the linker, > including `/usr/lib/w32api` Ah, yes, I wa

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

2025-07-18 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,294 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

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

2025-07-25 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: > Do the same for dynamicbase and nxcompat as a precaution. dynamicbase is needed for 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

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

2025-07-25 Thread Tomohiro Kashiwada via cfe-commits
kikairoya wrote: Sorry for causing extra work -- it seems my explanation and investigation weren’t quite sufficient. Thank you for the elaboration. > ``` > Cannot access memory at address 0x7ff6b417 > ``` > > > > > > Notably, those ending in `` are invalid memory. Might `0x

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

2025-07-30 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,282 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +void cygwin::Linker::Constru

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

2025-07-29 Thread Tomohiro Kashiwada via cfe-commits
@@ -107,3 +110,282 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +void cygwin::Linker::Constru

[clang] [clang][DebugInfo] Disable VTable debug info (#130255) on COFF platforms (PR #151684)

2025-08-01 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/151684 On COFF platform, d1b0cbff806b50d399826e79b9a53e4726c21302 generates a debug info linked with VTable regardless definition is present or not. If that VTable ends up implicitly dllimported from another DLL, l