* [PATCH] fix compilation breakage in entry-armv.S
@ 2011-11-08 11:36 Guennadi Liakhovetski
2011-11-08 11:40 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-11-08 11:36 UTC (permalink / raw)
To: linux-arm-kernel
Compilation of Linus' tree of today without THUMB support for V7 machines
breaks:
linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
Fix this by adding a check for CONFIG_ARM_THUMB.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 9ad50c4..6f8fbfe 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -497,7 +497,7 @@ ENDPROC(__und_usr)
.popsection
.pushsection __ex_table,"a"
.long 1b, 4b
-#if __LINUX_ARM_ARCH__ >= 7
+#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 7
.long 2b, 4b
.long 3b, 4b
#endif
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] fix compilation breakage in entry-armv.S
2011-11-08 11:36 [PATCH] fix compilation breakage in entry-armv.S Guennadi Liakhovetski
@ 2011-11-08 11:40 ` Russell King - ARM Linux
2011-11-08 12:03 ` Guennadi Liakhovetski
0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2011-11-08 11:40 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 08, 2011 at 12:36:36PM +0100, Guennadi Liakhovetski wrote:
> Compilation of Linus' tree of today without THUMB support for V7 machines
> breaks:
>
> linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
> linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
>
> Fix this by adding a check for CONFIG_ARM_THUMB.
This still looks wrong. The code for '2' and '3' is included when:
#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
is true - so the condition on including it in the exception tables should
be the same as that.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] fix compilation breakage in entry-armv.S
2011-11-08 11:40 ` Russell King - ARM Linux
@ 2011-11-08 12:03 ` Guennadi Liakhovetski
2011-11-08 12:08 ` Russell King - ARM Linux
2011-11-11 15:15 ` Dave Martin
0 siblings, 2 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-11-08 12:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 8 Nov 2011, Russell King - ARM Linux wrote:
> On Tue, Nov 08, 2011 at 12:36:36PM +0100, Guennadi Liakhovetski wrote:
> > Compilation of Linus' tree of today without THUMB support for V7 machines
> > breaks:
> >
> > linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
> > linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> > linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> > make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
> >
> > Fix this by adding a check for CONFIG_ARM_THUMB.
>
> This still looks wrong. The code for '2' and '3' is included when:
>
> #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
>
> is true - so the condition on including it in the exception tables should
> be the same as that.
Yes, I saw those, but, aren't they superfluous? Let's see:
arch/arm/mm/Kconfig:
config CPU_V7
...
select CPU_32v7
arch/arm/Makefile:
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
So, looks like CPU_V7 implies __LINUX_ARM_ARCH__=7? Ok, I picked up the
wrong pair, so, should this be enough:
#if CONFIG_ARM_THUMB && CONFIG_CPU_V7
and the original condition, where the labels are defined, that you
quoted, can be reduced too?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] fix compilation breakage in entry-armv.S
2011-11-08 12:03 ` Guennadi Liakhovetski
@ 2011-11-08 12:08 ` Russell King - ARM Linux
2011-11-11 15:15 ` Dave Martin
1 sibling, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2011-11-08 12:08 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 08, 2011 at 01:03:02PM +0100, Guennadi Liakhovetski wrote:
> On Tue, 8 Nov 2011, Russell King - ARM Linux wrote:
>
> > On Tue, Nov 08, 2011 at 12:36:36PM +0100, Guennadi Liakhovetski wrote:
> > > Compilation of Linus' tree of today without THUMB support for V7 machines
> > > breaks:
> > >
> > > linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
> > > linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> > > linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> > > make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
> > >
> > > Fix this by adding a check for CONFIG_ARM_THUMB.
> >
> > This still looks wrong. The code for '2' and '3' is included when:
> >
> > #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
> >
> > is true - so the condition on including it in the exception tables should
> > be the same as that.
>
> Yes, I saw those, but, aren't they superfluous? Let's see:
>
> arch/arm/mm/Kconfig:
>
> config CPU_V7
> ...
> select CPU_32v7
>
> arch/arm/Makefile:
>
> arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
>
> So, looks like CPU_V7 implies __LINUX_ARM_ARCH__=7? Ok, I picked up the
> wrong pair, so, should this be enough:
>
> #if CONFIG_ARM_THUMB && CONFIG_CPU_V7
>
> and the original condition, where the labels are defined, that you
> quoted, can be reduced too?
It looks like you're right. I'm going to bat this one over to
Dave Martin to confirm.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] fix compilation breakage in entry-armv.S
2011-11-08 12:03 ` Guennadi Liakhovetski
2011-11-08 12:08 ` Russell King - ARM Linux
@ 2011-11-11 15:15 ` Dave Martin
2011-11-16 15:05 ` [PATCH v2] " Guennadi Liakhovetski
1 sibling, 1 reply; 8+ messages in thread
From: Dave Martin @ 2011-11-11 15:15 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 08, 2011 at 01:03:02PM +0100, Guennadi Liakhovetski wrote:
> On Tue, 8 Nov 2011, Russell King - ARM Linux wrote:
>
> > On Tue, Nov 08, 2011 at 12:36:36PM +0100, Guennadi Liakhovetski wrote:
> > > Compilation of Linus' tree of today without THUMB support for V7 machines
> > > breaks:
> > >
> > > linux-2.6/arch/arm/kernel/entry-armv.S: Assembler messages:
> > > linux-2.6/arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> > > linux-2.6/arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> > > make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
> > >
> > > Fix this by adding a check for CONFIG_ARM_THUMB.
> >
> > This still looks wrong. The code for '2' and '3' is included when:
> >
> > #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
> >
> > is true - so the condition on including it in the exception tables should
> > be the same as that.
>
> Yes, I saw those, but, aren't they superfluous? Let's see:
>
> arch/arm/mm/Kconfig:
>
> config CPU_V7
> ...
> select CPU_32v7
>
> arch/arm/Makefile:
>
> arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
>
> So, looks like CPU_V7 implies __LINUX_ARM_ARCH__=7? Ok, I picked up the
> wrong pair, so, should this be enough:
>
> #if CONFIG_ARM_THUMB && CONFIG_CPU_V7
>
> and the original condition, where the labels are defined, that you
> quoted, can be reduced too?
No-- although the reason why is a bit confusing.
In arch/arm/Makefile, __LINUX_ARM_ARCH__ will be repeatedly redefined
for each CPU supported by the kernel. This means that the value
actuslly used will be the earliest architecture supported by all
supported CPUs (i.e., it represents the architecture subset supported
by all enabled CPUs). This happens because of the way the definitions
of __LIUNX_ARM_ARCH__ are ordered in the Makefile.
The affected code needs to be enabled whenever an ARMv7 CPU is supported
if support for Thumb userspace binaries is enabled, even if v6 CPUs
are also supported in the same kernel (in which case __LINUX_ARM_ARCH__
has the value 6, and CONFIG_CPU_V6 and CONFIG_CPU_V7 will both be
defined).
However, some cheeky assumptions are made so that we can restore the
assembler's target architecture after temporarily changing it -- so
although __LINUX_ARM_ARCH__ >= 6 is not strictly necessary (since
building pre-v6 and v7 CPUs the the same kernel is not allowed), I
kept it there in order to avoid unpleasant surprises. Unfortunately,
the assembler doesn't allow its target architecture to be restored
reliably after temporarily overriding it.
So I think the affected #ifdef does need be:
CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
Arnd Bergmann had previously suggested the same change, but the
discussion went stale, and it looks like I never made an actual
patch. Looks like my bad...
Can you update your patch and repost?
Thanks
---Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] fix compilation breakage in entry-armv.S
2011-11-11 15:15 ` Dave Martin
@ 2011-11-16 15:05 ` Guennadi Liakhovetski
2011-11-18 15:23 ` Dave Martin
0 siblings, 1 reply; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-11-16 15:05 UTC (permalink / raw)
To: linux-arm-kernel
Fix compilation failure, when Thumb support is not enabled:
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
v2: use exactly the same preprocessor condition, as the one used for the
code, defining labels "2" and "3"
arch/arm/kernel/entry-armv.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 9ad50c4..b145f16 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -497,7 +497,7 @@ ENDPROC(__und_usr)
.popsection
.pushsection __ex_table,"a"
.long 1b, 4b
-#if __LINUX_ARM_ARCH__ >= 7
+#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
.long 2b, 4b
.long 3b, 4b
#endif
--
1.7.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] fix compilation breakage in entry-armv.S
2011-11-16 15:05 ` [PATCH v2] " Guennadi Liakhovetski
@ 2011-11-18 15:23 ` Dave Martin
2011-11-19 19:03 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: Dave Martin @ 2011-11-18 15:23 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 16, 2011 at 04:05:04PM +0100, Guennadi Liakhovetski wrote:
> Fix compilation failure, when Thumb support is not enabled:
>
> arch/arm/kernel/entry-armv.S: Assembler messages:
> arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
That looks fine to me.
If Russell is OK with this, please send the patch to his patch system
so we can get this merged.
Reviewed-by: Dave Martin <dave.martin@linaro.org>
> v2: use exactly the same preprocessor condition, as the one used for the
> code, defining labels "2" and "3"
>
> arch/arm/kernel/entry-armv.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index 9ad50c4..b145f16 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -497,7 +497,7 @@ ENDPROC(__und_usr)
> .popsection
> .pushsection __ex_table,"a"
> .long 1b, 4b
> -#if __LINUX_ARM_ARCH__ >= 7
> +#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
> .long 2b, 4b
> .long 3b, 4b
> #endif
> --
> 1.7.2.5
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] fix compilation breakage in entry-armv.S
2011-11-18 15:23 ` Dave Martin
@ 2011-11-19 19:03 ` Russell King - ARM Linux
0 siblings, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2011-11-19 19:03 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Nov 18, 2011 at 03:23:22PM +0000, Dave Martin wrote:
> On Wed, Nov 16, 2011 at 04:05:04PM +0100, Guennadi Liakhovetski wrote:
> > Fix compilation failure, when Thumb support is not enabled:
> >
> > arch/arm/kernel/entry-armv.S: Assembler messages:
> > arch/arm/kernel/entry-armv.S:501: Error: backward ref to unknown label "2:"
> > arch/arm/kernel/entry-armv.S:502: Error: backward ref to unknown label "3:"
> > make[2]: *** [arch/arm/kernel/entry-armv.o] Error 1
> >
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> That looks fine to me.
>
> If Russell is OK with this, please send the patch to his patch system
> so we can get this merged.
>
> Reviewed-by: Dave Martin <dave.martin@linaro.org>
Yes, looks fine to me too.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-11-19 19:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 11:36 [PATCH] fix compilation breakage in entry-armv.S Guennadi Liakhovetski
2011-11-08 11:40 ` Russell King - ARM Linux
2011-11-08 12:03 ` Guennadi Liakhovetski
2011-11-08 12:08 ` Russell King - ARM Linux
2011-11-11 15:15 ` Dave Martin
2011-11-16 15:05 ` [PATCH v2] " Guennadi Liakhovetski
2011-11-18 15:23 ` Dave Martin
2011-11-19 19:03 ` Russell King - ARM Linux
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).