linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Kconfig: default to AEABI w/ Clang
@ 2019-06-25 21:04 Nick Desaulniers
  2019-07-04  7:24 ` Arnd Bergmann
  2019-07-04  8:13 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Desaulniers @ 2019-06-25 21:04 UTC (permalink / raw)
  To: linux
  Cc: clang-built-linux, broonie, Nick Desaulniers, Arnd Bergmann,
	Masahiro Yamada, Linus Walleij, Paul Burton, Mike Rapoport,
	Ard Biesheuvel, Lorenzo Pieralisi, Palmer Dabbelt,
	linux-arm-kernel, linux-kernel

Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for
arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI
is not selected (such as when OABI_COMPAT is selected).

While this means that OABI userspaces wont be able to upgraded to
kernels built with Clang, it means that boards that don't enable AEABI
like s3c2410_defconfig will stop failing to link in KernelCI when built
with Clang.

Link: https://github.com/ClangBuiltLinux/linux/issues/482
Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/arm/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8869742a85df..3539be870055 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1545,8 +1545,9 @@ config ARM_PATCH_IDIV
 	  code to do integer division.
 
 config AEABI
-	bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && !CPU_V7M && !CPU_V6 && !CPU_V6K
-	default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K
+	bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && \
+		!CPU_V7M && !CPU_V6 && !CPU_V6K && !CC_IS_CLANG
+	default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K || CC_IS_CLANG
 	help
 	  This option allows for the kernel to be compiled using the latest
 	  ARM ABI (aka EABI).  This is only useful if you are using a user
-- 
2.22.0.410.gd8fdbe21b5-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: Kconfig: default to AEABI w/ Clang
  2019-06-25 21:04 [PATCH] ARM: Kconfig: default to AEABI w/ Clang Nick Desaulniers
@ 2019-07-04  7:24 ` Arnd Bergmann
  2019-07-04  8:13 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2019-07-04  7:24 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Russell King - ARM Linux, clang-built-linux, Mark Brown,
	Masahiro Yamada, Linus Walleij, Paul Burton, Mike Rapoport,
	Ard Biesheuvel, Lorenzo Pieralisi, Palmer Dabbelt, Linux ARM,
	Linux Kernel Mailing List

On Tue, Jun 25, 2019 at 11:04 PM 'Nick Desaulniers' via Clang Built
Linux <clang-built-linux@googlegroups.com> wrote:
>
> Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for
> arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI
> is not selected (such as when OABI_COMPAT is selected).
>
> While this means that OABI userspaces wont be able to upgraded to
> kernels built with Clang, it means that boards that don't enable AEABI
> like s3c2410_defconfig will stop failing to link in KernelCI when built
> with Clang.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/482
> Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Looks good to me,

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Please add it to Russell's patch tracker if you haven't already.

Most of the .config files that don't set AEABI (and a lot of the others
as well) have likely never been booted on real hardware with a modern
kernel in a long time. There have not been any distros using OABI in
a long time (Debian Lenny was released in 2009), and gcc dropped
support for it a few years later.

We could probably change most of these to use OABI_COMPAT
instead, aside from any ones that Russell wants to keep building as
OABI for his own machines.

       Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: Kconfig: default to AEABI w/ Clang
  2019-06-25 21:04 [PATCH] ARM: Kconfig: default to AEABI w/ Clang Nick Desaulniers
  2019-07-04  7:24 ` Arnd Bergmann
@ 2019-07-04  8:13 ` Linus Walleij
  2019-07-04  8:29   ` Arnd Bergmann
  1 sibling, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2019-07-04  8:13 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Russell King, clang-built-linux, Mark Brown, Arnd Bergmann,
	Masahiro Yamada, Paul Burton, Mike Rapoport, Ard Biesheuvel,
	Lorenzo Pieralisi, Palmer Dabbelt, Linux ARM, linux-kernel,
	Marc Zyngier

On Tue, Jun 25, 2019 at 11:04 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:

> Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for
> arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI
> is not selected (such as when OABI_COMPAT is selected).
>
> While this means that OABI userspaces wont be able to upgraded to
> kernels built with Clang, it means that boards that don't enable AEABI
> like s3c2410_defconfig will stop failing to link in KernelCI when built
> with Clang.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/482
> Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

As reflecting the state of things with CLANG it's:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

But I think we in general need to have some discussion on how to
proceed with OABI userspaces.

I am well aware of distributions like OpenWrt using EABI even
on ARMv4 with "tricks" like this:
https://github.com/openwrt/openwrt/blob/master/toolchain/gcc/patches/9.1.0/840-armv4_pass_fix-v4bx_to_ld.patch

I have one OABI that I can think of would be nice to live on
and it's the RedHat derivative on my Foorbridge NetWinder.
OK I wouldn't cry if we have to kill it because it is too hard to
keep supporting it, but it has been running the latest kernels
all along so if it's not a huge effort I'd be interested in knowing
the options.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: Kconfig: default to AEABI w/ Clang
  2019-07-04  8:13 ` Linus Walleij
@ 2019-07-04  8:29   ` Arnd Bergmann
  2019-07-04  8:56     ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2019-07-04  8:29 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Nick Desaulniers, Russell King, clang-built-linux, Mark Brown,
	Masahiro Yamada, Paul Burton, Mike Rapoport, Ard Biesheuvel,
	Lorenzo Pieralisi, Palmer Dabbelt, Linux ARM, linux-kernel,
	Marc Zyngier

On Thu, Jul 4, 2019 at 10:13 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Jun 25, 2019 at 11:04 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> > Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for
> > arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI
> > is not selected (such as when OABI_COMPAT is selected).
> >
> > While this means that OABI userspaces wont be able to upgraded to
> > kernels built with Clang, it means that boards that don't enable AEABI
> > like s3c2410_defconfig will stop failing to link in KernelCI when built
> > with Clang.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/482
> > Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ
> > Suggested-by: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
> As reflecting the state of things with CLANG it's:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> But I think we in general need to have some discussion on how to
> proceed with OABI userspaces.
>
> I am well aware of distributions like OpenWrt using EABI even
> on ARMv4 with "tricks" like this:
> https://github.com/openwrt/openwrt/blob/master/toolchain/gcc/patches/9.1.0/840-armv4_pass_fix-v4bx_to_ld.patch

I did not expect that to be necessary in gcc as long as it supports
building for armv4 (non-t), but I might be missing something here.

> I have one OABI that I can think of would be nice to live on
> and it's the RedHat derivative on my Foorbridge NetWinder.
> OK I wouldn't cry if we have to kill it because it is too hard to
> keep supporting it, but it has been running the latest kernels
> all along so if it's not a huge effort I'd be interested in knowing
> the options.

But do you see any problems with cross-compiling kernels to
EABI with CONFIG_OABI_COMPAT for machines like that?

I would guess that you can't actually build modern kernels
on the RedHat OABI compiler any more as they presumably
predate the current minimum gcc-4.6.

      Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: Kconfig: default to AEABI w/ Clang
  2019-07-04  8:29   ` Arnd Bergmann
@ 2019-07-04  8:56     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux admin @ 2019-07-04  8:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Nick Desaulniers, clang-built-linux, Mark Brown,
	Masahiro Yamada, Paul Burton, Mike Rapoport, Ard Biesheuvel,
	Lorenzo Pieralisi, Palmer Dabbelt, Linux ARM, linux-kernel,
	Marc Zyngier

On Thu, Jul 04, 2019 at 10:29:35AM +0200, Arnd Bergmann wrote:
> On Thu, Jul 4, 2019 at 10:13 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Tue, Jun 25, 2019 at 11:04 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
> >
> > > Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for
> > > arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI
> > > is not selected (such as when OABI_COMPAT is selected).
> > >
> > > While this means that OABI userspaces wont be able to upgraded to
> > > kernels built with Clang, it means that boards that don't enable AEABI
> > > like s3c2410_defconfig will stop failing to link in KernelCI when built
> > > with Clang.
> > >
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/482
> > > Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ
> > > Suggested-by: Arnd Bergmann <arnd@arndb.de>
> > > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> >
> > As reflecting the state of things with CLANG it's:
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >
> > But I think we in general need to have some discussion on how to
> > proceed with OABI userspaces.
> >
> > I am well aware of distributions like OpenWrt using EABI even
> > on ARMv4 with "tricks" like this:
> > https://github.com/openwrt/openwrt/blob/master/toolchain/gcc/patches/9.1.0/840-armv4_pass_fix-v4bx_to_ld.patch
> 
> I did not expect that to be necessary in gcc as long as it supports
> building for armv4 (non-t), but I might be missing something here.
> 
> > I have one OABI that I can think of would be nice to live on
> > and it's the RedHat derivative on my Foorbridge NetWinder.
> > OK I wouldn't cry if we have to kill it because it is too hard to
> > keep supporting it, but it has been running the latest kernels
> > all along so if it's not a huge effort I'd be interested in knowing
> > the options.
> 
> But do you see any problems with cross-compiling kernels to
> EABI with CONFIG_OABI_COMPAT for machines like that?

Yes, there are a few ioctls that break.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-04  8:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 21:04 [PATCH] ARM: Kconfig: default to AEABI w/ Clang Nick Desaulniers
2019-07-04  7:24 ` Arnd Bergmann
2019-07-04  8:13 ` Linus Walleij
2019-07-04  8:29   ` Arnd Bergmann
2019-07-04  8:56     ` Russell King - ARM Linux admin

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).