Skip to content

libunwind: Do not use __attribute__((target("gcs"))) with non-clang compilers #138077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

kraj
Copy link
Contributor

@kraj kraj commented May 1, 2025

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

@kraj kraj requested a review from a team as a code owner May 1, 2025 02:59
@llvmbot
Copy link
Member

llvmbot commented May 1, 2025

@llvm/pr-subscribers-libunwind

Author: Khem Raj (kraj)

Changes

…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


Full diff: https://github.com/llvm/llvm-project/pull/138077.diff

1 Files Affected:

  • (modified) libunwind/src/UnwindLevel1.c (+2-2)
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

kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
…ompilers

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=      |                      ^~~~~~~~~~~~~~~

Upstream-Status: Submitted [llvm#138077]
[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
…ompilers

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=      |                      ^~~~~~~~~~~~~~~

Upstream-Status: Submitted [llvm#138077]
[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af

Signed-off-by: Khem Raj <[email protected]>
@kraj kraj force-pushed the kraj/libunwind-gcc15-aarch64-musl branch from 13d2bff to 399e475 Compare May 1, 2025 05:15
kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
…ompilers

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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
@pinskia
Copy link

pinskia commented May 1, 2025

Actually GCC 15 does support GCS, the syntax is just __attribute__((target("+gcs"))) Note the + there. The error message is clear too.

kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
…ompilers

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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
@kraj kraj force-pushed the kraj/libunwind-gcc15-aarch64-musl branch from 399e475 to e9870d6 Compare May 1, 2025 05:31
Copy link

github-actions bot commented May 1, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 1, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
@kraj kraj force-pushed the kraj/libunwind-gcc15-aarch64-musl branch from e9870d6 to aabc92e Compare May 1, 2025 05:36
__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 <[email protected]>
@kraj kraj force-pushed the kraj/libunwind-gcc15-aarch64-musl branch from aabc92e to bcc31a9 Compare May 1, 2025 05:52
kraj added a commit to kraj/llvm-project that referenced this pull request May 6, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 6, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 8, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 9, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 10, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 10, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 10, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 15, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 15, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 18, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 18, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 19, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 19, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 21, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 21, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 22, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 22, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 23, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 23, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 23, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 29, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 29, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request May 30, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 1, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 2, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 4, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 4, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 5, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 6, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 7, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 11, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 11, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I vaguely recall that clang's target attribute parsing is loose and may accept some forms that is not supported by gcc. @john-brawn-arm

@MaskRay MaskRay changed the title libunwind: Do not use __attribute__((target("gcs"))) with non-clang … libunwind: Do not use __attribute__((target("gcs"))) with non-clang compilers Jun 12, 2025
@MaskRay MaskRay merged commit b46f344 into llvm:main Jun 12, 2025
81 checks passed
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 12, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…ompilers (llvm#138077)

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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 19, 2025
__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

Upstream-Status: Submitted [llvm#138077]

Signed-off-by: Khem Raj <[email protected]>
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
…ompilers (llvm#138077)

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants