RISC-V: fix compile error from decuplicated
From: Heiko Stuebner <heiko.stuebner@...> Date: Tue, 3 Jan 2023 13:25:52 +0100
Commit-Message
On the non-assembler-side wrapping alternative-macros inside other macros to prevent duplication of code works, as the end result will just be a string that gets fed to the asm instruction. In real assembler code, wrapping .macro blocks inside other .macro blocks brings more restrictions on usage and the optimization done by commit 2ba8c7dc71c0 ("riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2") results in a compile error like: ../arch/riscv/lib/strcmp.S: Assembler messages: ../arch/riscv/lib/strcmp.S:15: Error: too many positional arguments ../arch/riscv/lib/strcmp.S:15: Error: backward ref to unknown label "886:" ../arch/riscv/lib/strcmp.S:15: Error: backward ref to unknown label "887:" ../arch/riscv/lib/strcmp.S:15: Error: backward ref to unknown label "886:" ../arch/riscv/lib/strcmp.S:15: Error: backward ref to unknown label "887:" ../arch/riscv/lib/strcmp.S:15: Error: backward ref to unknown label "886:" ../arch/riscv/lib/strcmp.S:15: Error: attempt to move .org backwards Going back to the original code for the non-assembler-part makes that code work again. So this reverts the #ifdef ASSEMBLY part of that commit to the previous variant with duplicated base. Fixes: 2ba8c7dc71c0 ("riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2") Signed-off-by: Heiko Stuebner <heiko.stuebner@...>
Patch-Comment
I was of two minds about either to revert the full patch, or doing just this partial one for the ASSEMBLY part. I did go with this variant, as I still like the idea of deduplicating as much as possible :-) arch/riscv/include/asm/alternative-macros.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Statistics
- 12 lines added
- 1 lines removed