Re: [PATCH] D18174: Fix libcxx build on musl

2016-03-15 Thread Khem Raj via cfe-commits
raj.khem added a comment.

@bcraig, right, check for __GLIBC__ can be moved after including features.h. 
https://chromium.googlesource.com/native_client/pnacl-libcxx/+/master%5E!/
seems to add needed tweaks which can be enabled by passing -D__musl__ in CFLAGS
may be it can be backported to 3.8 branch


http://reviews.llvm.org/D18174



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18174: Fix libcxx build on musl

2016-03-15 Thread Khem Raj via cfe-commits
raj.khem added a comment.

3.8 has it in there. So may be this is just not required. I will add 
-DLIBCXX_HAS_MUSL_LIBC=ON to Cmake and see what comes out


http://reviews.llvm.org/D18174



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18174: Fix libcxx build on musl

2016-03-15 Thread Khem Raj via cfe-commits
raj.khem added a comment.

I think my problem was that while compiling libcxxabi, it wants to peek into 
libcxx headers but then libcxxabi cmake infra doesnt have the musl support like 
libcxx. So Now I solved it by adding -D_LIBCPP_HAS_MUSL_LIBC to CXXFLAGS.


http://reviews.llvm.org/D18174



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18174: Fix libcxx build on musl

2016-03-15 Thread Khem Raj via cfe-commits
raj.khem added a comment.

libcxx still has problem compiling on musl/aarch64 though. I fixed it with this 
patch

https://github.com/kraj/meta-clang/blob/master/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch

does this make sense ?


http://reviews.llvm.org/D18174



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] clangd: Add a build option to disable building dexp (PR #133124)

2025-03-27 Thread Khem Raj via cfe-commits

https://github.com/kraj approved this pull request.

looks good to me.

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


[libunwind] libunwind: Do not use __attribute__((target("gcs"))) with non-clang … (PR #138077)

2025-04-30 Thread Khem Raj via cfe-commits

https://github.com/kraj updated https://github.com/llvm/llvm-project/pull/138077

>From 399e475a17022e6806803ddb7e83599403ffb53d Mon Sep 17 00:00:00 2001
From: Khem Raj 
Date: Wed, 30 Apr 2025 19:51:19 -0700
Subject: [PATCH] libunwind: Do not use __attribute__((target("gcs"))) with
 non-clang compilers

This attribute is unsupported in GCC, so far it worked because before GCC15
did not define this macros in _CHKFEAT_GCS in arm_acle.h [1]

With gcc15 compiler libunwind's check for this macros is succeeding and it
ends up enabling 'gcs' by using function attribute, this works with clang
but not with gcc.

We can see this in rust compiler bootstrap for aarch64/musl when system
uses gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj 
---
 libunwind/src/shadow_stack_unwind.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libunwind/src/shadow_stack_unwind.h 
b/libunwind/src/shadow_stack_unwind.h
index 1f229d8317116..72939fea86eaf 100644
--- a/libunwind/src/shadow_stack_unwind.h
+++ b/libunwind/src/shadow_stack_unwind.h
@@ -42,7 +42,8 @@
 #include 
 
 // We can only use GCS if arm_acle.h defines the GCS intrinsics.
-#ifdef _CHKFEAT_GCS
+// it uses attribute 'gcs' in source which does not work with gcc
+#if defined(_CHKFEAT_GCS) && defined(__clang__)
 #define _LIBUNWIND_USE_GCS 1
 #endif
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] libunwind: Do not use __attribute__((target("gcs"))) with non-clang … (PR #138077)

2025-04-30 Thread Khem Raj via cfe-commits

https://github.com/kraj updated https://github.com/llvm/llvm-project/pull/138077

>From aabc92ee06f3ccf89bcccf759c50a667d4eada0c Mon Sep 17 00:00:00 2001
From: Khem Raj 
Date: Wed, 30 Apr 2025 19:51:19 -0700
Subject: [PATCH] libunwind: Use +gcs instead of gcs target attribute

__attribute__((target("gcs"))) does not work with gcc

GCC-15 has added gcs intrinsics [1] but the syntax for enabling it is
slightly different. This syntax works with clang too.

With gcc15 compiler libunwind's check for this macros is succeeding and it
ends up enabling 'gcs' by using function attribute, this works with clang
but not with gcc but '+gcs' works with both

We can see this in rust compiler bootstrap for aarch64/musl when system
uses gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj 
---
 libunwind/src/UnwindLevel1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index a258a832a9c31..ccc36fab1ee88 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -188,7 +188,7 @@ extern int __unw_step_stage2(unw_cursor_t *);
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
 unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception 
*exception_object) {
@@ -332,7 +332,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *except
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
 unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] libunwind: Do not use __attribute__((target("gcs"))) with non-clang … (PR #138077)

2025-04-30 Thread Khem Raj via cfe-commits

https://github.com/kraj updated https://github.com/llvm/llvm-project/pull/138077

>From bcc31a9384d2df1c0f27ef140e1f0f9ee493034f Mon Sep 17 00:00:00 2001
From: Khem Raj 
Date: Wed, 30 Apr 2025 19:51:19 -0700
Subject: [PATCH] libunwind: Use +gcs instead of gcs target attribute

__attribute__((target("gcs"))) does not work with gcc

GCC-15 has added gcs intrinsics [1] but the syntax for enabling it is
slightly different. This syntax works with clang too.

With gcc15 compiler libunwind's check for this macros is succeeding and it
ends up enabling 'gcs' by using function attribute, this works with clang
but not with gcc but '+gcs' works with both

We can see this in rust compiler bootstrap for aarch64/musl when system
uses gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

Fix clang-tidy warnings along the way

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj 
---
 libunwind/src/UnwindLevel1.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index a258a832a9c31..f3b451ad9b730 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -188,10 +188,11 @@ extern int __unw_step_stage2(unw_cursor_t *);
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
-unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception 
*exception_object) {
+unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor,
+  _Unwind_Exception *exception_object) {
   __unw_init_local(cursor, uc);
 
   _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_obj=%p)",
@@ -332,12 +333,12 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *except
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
 unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
- _Unwind_Exception *exception_object,
- _Unwind_Stop_Fn stop, void *stop_parameter) {
+ _Unwind_Exception *exception_object, _Unwind_Stop_Fn stop,
+ void *stop_parameter) {
   __unw_init_local(cursor, uc);
 
   // uc is initialized by __unw_getcontext in the parent frame. The first stack
@@ -443,7 +444,6 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t 
*cursor,
   return _URC_FATAL_PHASE2_ERROR;
 }
 
-
 /// Called by __cxa_throw.  Only returns if there is a fatal error.
 _LIBUNWIND_EXPORT _Unwind_Reason_Code
 _Unwind_RaiseException(_Unwind_Exception *exception_object) {

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] libunwind: Do not use __attribute__((target("gcs"))) with non-clang … (PR #138077)

2025-04-30 Thread Khem Raj via cfe-commits

https://github.com/kraj updated https://github.com/llvm/llvm-project/pull/138077

>From e9870d6a848a95cf58f890a7e6d3a93a27e7c061 Mon Sep 17 00:00:00 2001
From: Khem Raj 
Date: Wed, 30 Apr 2025 19:51:19 -0700
Subject: [PATCH] libunwind: Do not use __attribute__((target("gcs"))) with
 non-clang compilers unwindlib: Use +gcs instead of gcs target attribute

GCC-15 has added gcs intrinsics [1] but the syntax for enabling it is
slightly different. This syntax works with clang too.

With gcc15 compiler libunwind's check for this macros is succeeding and it
ends up enabling 'gcs' by using function attribute, this works with clang
but not with gcc but '+gcs' works with both

We can see this in rust compiler bootstrap for aarch64/musl when system
uses gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj 
---
 libunwind/src/UnwindLevel1.c| 4 ++--
 libunwind/src/shadow_stack_unwind.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index a258a832a9c31..ccc36fab1ee88 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -188,7 +188,7 @@ extern int __unw_step_stage2(unw_cursor_t *);
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
 unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception 
*exception_object) {
@@ -332,7 +332,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *except
 
 #if defined(_LIBUNWIND_USE_GCS)
 // Enable the GCS target feature to permit gcspop instructions to be used.
-__attribute__((target("gcs")))
+__attribute__((target("+gcs")))
 #endif
 static _Unwind_Reason_Code
 unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
diff --git a/libunwind/src/shadow_stack_unwind.h 
b/libunwind/src/shadow_stack_unwind.h
index 1f229d8317116..ece49d028e5db 100644
--- a/libunwind/src/shadow_stack_unwind.h
+++ b/libunwind/src/shadow_stack_unwind.h
@@ -42,7 +42,7 @@
 #include 
 
 // We can only use GCS if arm_acle.h defines the GCS intrinsics.
-#ifdef _CHKFEAT_GCS
+#if defined(_CHKFEAT_GCS)
 #define _LIBUNWIND_USE_GCS 1
 #endif
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] libunwind: Do not use __attribute__((target("gcs"))) with non-clang … (PR #138077)

2025-04-30 Thread Khem Raj via cfe-commits

https://github.com/kraj created https://github.com/llvm/llvm-project/pull/138077

…compilers

This attribute is unsupported in GCC, so far it worked because before GCC15 did 
not define this macros in _CHKFEAT_GCS in arm_acle.h [1]

With gcc15 compiler libunwind's check for this macros is succeeding and it ends 
up enabling 'gcs' by using function attribute, this works with clang but not 
with gcc.

We can see this in rust compiler bootstrap for aarch64/musl when system uses 
gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+' cargo:warning=  191 | 
unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception 
*exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

>From 13d2bffa06845d9c2005e9d3871632a88a17d0d9 Mon Sep 17 00:00:00 2001
From: Khem Raj 
Date: Wed, 30 Apr 2025 19:51:19 -0700
Subject: [PATCH] libunwind: Do not use  __attribute__((target("gcs"))) with
 non-clang compilers

This attribute is unsupported in GCC, so far it worked because before GCC15
did not define this macros in _CHKFEAT_GCS in arm_acle.h [1]

With gcc15 compiler libunwind's check for this macros is succeeding and it
ends up enabling 'gcs' by using function attribute, this works with clang
but not with gcc.

We can see this in rust compiler bootstrap for aarch64/musl when system
uses gcc15, it ends up with these errors

Building libunwind.a for aarch64-poky-linux-musl
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *exception_object) {
cargo:warning=  | ^
cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22:
 error: arch extension 'gcs' should be prefixed by '+'
cargo:warning=  337 |  _Unwind_Stop_Fn stop, void 
*stop_parameter) {
cargo:warning=  |  ^~~

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj 
---
 libunwind/src/UnwindLevel1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index a258a832a9c31..4771632c49c31 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -186,7 +186,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *except
 }
 extern int __unw_step_stage2(unw_cursor_t *);
 
-#if defined(_LIBUNWIND_USE_GCS)
+#if defined(_LIBUNWIND_USE_GCS) && defined(__clang__)
 // Enable the GCS target feature to permit gcspop instructions to be used.
 __attribute__((target("gcs")))
 #endif
@@ -330,7 +330,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, 
_Unwind_Exception *except
   return _URC_FATAL_PHASE2_ERROR;
 }
 
-#if defined(_LIBUNWIND_USE_GCS)
+#if defined(_LIBUNWIND_USE_GCS) && defined(__clang__)
 // Enable the GCS target feature to permit gcspop instructions to be used.
 __attribute__((target("gcs")))
 #endif

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] clangd: Add a build option to disable building dexp (PR #133124)

2025-04-03 Thread Khem Raj via cfe-commits

kraj wrote:

> @kraj, you approved this and you are a project member, are you comfortable 
> merging this? If so, please go ahead.
> 
> From my point of view as a clangd maintainer, I'm supportive of having such 
> an option, but I have ~zero CMake knowledge, so if you think this needs more 
> review, we need to find and add another reviewer.

@HighCommander4 thanks, this has been tested in yocto autobuilder for few days 
already and I am happy with the change.

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