* [PATCH] ARM: omap1: fix building with clang IAS
@ 2021-03-08 15:34 Arnd Bergmann
2021-03-09 9:57 ` Tony Lindgren
2021-04-01 10:23 ` Arnd Bergmann
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-03-08 15:34 UTC (permalink / raw)
To: Aaro Koskinen, Tony Lindgren
Cc: soc, Arnd Bergmann, Nathan Chancellor, Nick Desaulniers,
linux-omap, linux-arm-kernel, linux-kernel, clang-built-linux
From: Arnd Bergmann <arnd@arndb.de>
The clang integrated assembler fails to build one file with
a complex asm instruction:
arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: error: invalid instruction, any one of the following would fix this:
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^
arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: armv6t2
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^
arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: thumb2
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^
The problem is that 'NR_IRQS_LEGACY' is not defined here. Apparently
gas does not care because we first add and then subtract this number,
leading to the immediate value to be the same regardless of the
specific definition of NR_IRQS_LEGACY.
Neither the way that 'gas' just silently builds this file, nor the
way that clang IAS makes nonsensical suggestions for how to fix it
is great. Fortunately there is an easy fix, which is to #include
the header that contains the definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
index a0fb7cca0fc3..e6a33024f6b4 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S
+++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
@@ -16,6 +16,7 @@
#include <asm/assembler.h>
#include <linux/soc/ti/omap1-io.h>
+#include <asm/irq.h>
#include "hardware.h"
#include "ams-delta-fiq.h"
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: omap1: fix building with clang IAS
2021-03-08 15:34 [PATCH] ARM: omap1: fix building with clang IAS Arnd Bergmann
@ 2021-03-09 9:57 ` Tony Lindgren
2021-04-01 10:23 ` Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2021-03-09 9:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Aaro Koskinen, soc, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, linux-omap, linux-arm-kernel, linux-kernel,
clang-built-linux
* Arnd Bergmann <arnd@kernel.org> [210308 15:35]:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The clang integrated assembler fails to build one file with
> a complex asm instruction:
>
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: error: invalid instruction, any one of the following would fix this:
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: armv6t2
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: thumb2
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
>
> The problem is that 'NR_IRQS_LEGACY' is not defined here. Apparently
> gas does not care because we first add and then subtract this number,
> leading to the immediate value to be the same regardless of the
> specific definition of NR_IRQS_LEGACY.
>
> Neither the way that 'gas' just silently builds this file, nor the
> way that clang IAS makes nonsensical suggestions for how to fix it
> is great. Fortunately there is an easy fix, which is to #include
> the header that contains the definition.
Acked-by: Tony Lindgren <tony@atomide.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: omap1: fix building with clang IAS
2021-03-08 15:34 [PATCH] ARM: omap1: fix building with clang IAS Arnd Bergmann
2021-03-09 9:57 ` Tony Lindgren
@ 2021-04-01 10:23 ` Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-04-01 10:23 UTC (permalink / raw)
To: Aaro Koskinen, Tony Lindgren, Arnd Bergmann
Cc: Arnd Bergmann, linux-kernel, linux-arm-kernel, Nick Desaulniers,
soc, clang-built-linux, Nathan Chancellor, linux-omap
From: Arnd Bergmann <arnd@arndb.de>
On Mon, 8 Mar 2021 16:34:21 +0100, Arnd Bergmann wrote:
> The clang integrated assembler fails to build one file with
> a complex asm instruction:
>
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: error: invalid instruction, any one of the following would fix this:
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: armv6t2
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
> arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: thumb2
> mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
> ^
>
> [...]
Applied to arm/fixes.
[1/1] ARM: omap1: fix building with clang IAS
commit: b897653a2fd4b7d0a77aa209d1e6b5cc08899bbf
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-01 10:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-08 15:34 [PATCH] ARM: omap1: fix building with clang IAS Arnd Bergmann
2021-03-09 9:57 ` Tony Lindgren
2021-04-01 10:23 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).