Skip to content

Commit

Permalink
LoongArch: Add support percpu model attribute for clang
Browse files Browse the repository at this point in the history
As like GCC does now, this patch adds the model("large") attribute
to the percpu variable to solve the address mode issue of clang.

Signed-off-by: WANG Rui <[email protected]>
  • Loading branch information
heiher committed Nov 22, 2023
1 parent 4c49d51 commit e540e0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/loongarch/include/asm/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
*/
#if defined(MODULE) && defined(CONFIG_AS_HAS_EXPLICIT_RELOCS)
# if __has_attribute(model)
# define PER_CPU_ATTRIBUTES __attribute__((model("extreme")))
# ifdef __clang__
# define PER_CPU_ATTRIBUTES __attribute__((model("large")))
# else
# define PER_CPU_ATTRIBUTES __attribute__((model("extreme")))
# endif
# else
# error compiler support for the model attribute is necessary when a recent assembler is used
# endif
Expand Down

0 comments on commit e540e0f

Please sign in to comment.