Skip to content

Commit

Permalink
riscv: Do not use cfi_label when building with clang
Browse files Browse the repository at this point in the history
The .cfi_label is a gas extension not supported by clang.  From a
ziglang discussion [1], it seems that it is not really required.

[1] ziglang/zig#3340
  • Loading branch information
zatrazz committed Apr 2, 2024
1 parent a900809 commit 5c0ed4a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions sysdeps/generic/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
# define cfi_window_save .cfi_window_save
# define cfi_personality(enc, exp) .cfi_personality enc, exp
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
/* .cfi_label is a gas extension not supported by clang. */
# ifndef __clang__
# define cfi_label(label) .cfi_label label
# else
# define cfi_label(label)
# endif

#else /* ! ASSEMBLER */

Expand Down
2 changes: 1 addition & 1 deletion sysdeps/riscv/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ENTRY (ENTRY_POINT)
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
.cfi_label .Ldummy
cfi_label (.Ldummy)
cfi_undefined (ra)
call load_gp
mv a5, a0 /* rtld_fini. */
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/unix/sysv/linux/riscv/clone.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ENTRY (__thread_start)
L (thread_start):
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
.cfi_label .Ldummy
cfi_label (.Ldummy)
cfi_undefined (ra)

/* Restore the arg for user's function. */
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/unix/sysv/linux/riscv/clone3.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ENTRY(__thread_start_clone3)
L(thread_start):
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
.cfi_label .Ldummy
cfi_label (.Ldummy)
cfi_undefined (ra)

/* Restore the arg for user's function and call the user's
Expand Down

0 comments on commit 5c0ed4a

Please sign in to comment.