diff options
author | Tom Rini <trini@konsulko.com> | 2023-04-04 14:36:43 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-04-04 14:36:43 -0400 |
commit | 698c2bd364ce4122a0d0db82b5a8d842186b2fa4 (patch) | |
tree | 3e6bccfc2033f154209afc4b888897ffa301f7d2 /include/linker_lists.h | |
parent | 0916377b837a7a964587564c4560e4534aec72cb (diff) | |
parent | d7e0678c7627e68ea3810ddc6ac3df209670a6cf (diff) |
Merge branch '2023-04-04-update-to-clang-16'
- Update our CI to use clang-16 for tests. This also changes slightly
how we do linker lists so that we don't rely on undefined behavior
that lead to clang-15 and later failing to work (and in some cases
seemingly, earlier versions of clang would sometimes fail).
Diffstat (limited to 'include/linker_lists.h')
-rw-r--r-- | include/linker_lists.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linker_lists.h b/include/linker_lists.h index d3da9d44e85..f9a2ee0c762 100644 --- a/include/linker_lists.h +++ b/include/linker_lists.h @@ -127,7 +127,9 @@ static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN) \ __attribute__((unused)) \ __section("__u_boot_list_2_"#_list"_1"); \ - (_type *)&start; \ + _type * tmp = (_type *)&start; \ + asm("":"+r"(tmp)); \ + tmp; \ }) /** @@ -153,7 +155,9 @@ ({ \ static char end[0] __aligned(4) __attribute__((unused)) \ __section("__u_boot_list_2_"#_list"_3"); \ - (_type *)&end; \ + _type * tmp = (_type *)&end; \ + asm("":"+r"(tmp)); \ + tmp; \ }) /** * ll_entry_count() - Return the number of elements in linker-generated array @@ -247,7 +251,9 @@ ({ \ static char start[0] __aligned(4) __attribute__((unused)) \ __section("__u_boot_list_1"); \ - (_type *)&start; \ + _type * tmp = (_type *)&start; \ + asm("":"+r"(tmp)); \ + tmp; \ }) /** @@ -270,7 +276,9 @@ ({ \ static char end[0] __aligned(4) __attribute__((unused)) \ __section("__u_boot_list_3"); \ - (_type *)&end; \ + _type * tmp = (_type *)&end; \ + asm("":"+r"(tmp)); \ + tmp; \ }) #endif /* __ASSEMBLY__ */ |