Skip to contentSkip to conversation

OpenRISC: Fix kernel build problem on OpenRISC

PATCH In review anees 5 participants 14 messages May 12, 2015 – Jun 11, 2015 Openrisc architecture

lore
Share & tools
lore

anees

author
#0 lore raw

PATCH 1/1 OpenRISC: Fix kernel build problem on OpenRISC

Kernel build fails with error "target elf32-or32 not found" This is due to the change in OpenRISC compiler prefix from "or12" to "or1k". Add config options that set architecture output format default to "or1k" but also allow user to select older prefix.

Tested with gcc version 4.9.1 uclibc

---
 arch/openrisc/Kconfig              | 12 ++++++++++++
 arch/openrisc/kernel/vmlinux.lds.S |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)
arch/openrisc/Kconfig +12 -0
index e5a693b..c7fe7c8 100644
@@ -75,6 +75,18 @@ config OPENRISC_BUILTIN_DTB
         string "Builtin DTB"
         default ""
 
+config OUTPUT_FORMAT_TYPE
+	string "Architecture output format type"
+	default "or1k"
+	help
+	  Write "or12" if building kernel against an older toolchain
+	  else leave the default (or1k)
+
+config OUTPUT_FORMAT
+	string
+	default "elf32-or1k" if   OUTPUT_FORMAT_TYPE = "or1k"
+	default "elf32-or12" if   OUTPUT_FORMAT_TYPE = "or12"
+
 menu "Class II Instructions"
 
 config OPENRISC_HAVE_INST_FF1
arch/openrisc/kernel/vmlinux.lds.S +3 -3
index 2d69a85..5cd274c 100644
@@ -23,14 +23,14 @@
  *		- recheck if all aligments are really needed
  */
 
-#  define LOAD_OFFSET  PAGE_OFFSET
-#  define LOAD_BASE    PAGE_OFFSET
+#define LOAD_OFFSET  PAGE_OFFSET
+#define LOAD_BASE    PAGE_OFFSET
 
 #include <asm/page.h>
 #include <asm/cache.h>
 #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
+OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
 jiffies = jiffies_64 + 4;
 
 SECTIONS
Signature · 1 line
1.9.1
#1 lore raw
Quoted 18 lines · anees

Kernel build fails with error "target elf32-or32 not found" This is due to the change in OpenRISC compiler prefix from "or12" to "or1k". Add config options that set architecture output format default to "or1k" but also allow user to select older prefix.

Tested with gcc version 4.9.1 uclibc

---
 arch/openrisc/Kconfig              | 12 ++++++++++++
 arch/openrisc/kernel/vmlinux.lds.S |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)
arch/openrisc/Kconfig +0 -0
index e5a693b..c7fe7c8 100644

arch/openrisc/Kconfig config OPENRISC_BUILTIN_DTB · line 84

Quoted 10 lines
arch/openrisc/Kconfig +7 -0
@@ -75,6 +75,18 @@ config OPENRISC_BUILTIN_DTB
         string "Builtin DTB"
         default ""
 
+config OUTPUT_FORMAT_TYPE
+	string "Architecture output format type"
+	default "or1k"
+	help
+	  Write "or12" if building kernel against an older toolchain
+	  else leave the default (or1k)
+

That means I'll have to use different toolchains for different kernel versions, or hand-edit default configuration files to able to work with the same toolchain. Both is, from a testing perspective, quite annoying.

Maybe I should simply stop testing older kernels for openrisc after this patch has been merged; that would be much easier. Jonas, is that ok with you ?

Side note: I didn't drop it from Cc:, but the openrisc.net domain name expired and appears to be for sale.

Guenter

#2 lore raw
Quoted 22 lines · Guenter Roeck
Quoted 21 lines · anees

Kernel build fails with error "target elf32-or32 not found" This is due to the change in OpenRISC compiler prefix from "or12" to "or1k". Add config options that set architecture output format default to "or1k" but also allow user to select older prefix.

Tested with gcc version 4.9.1 uclibc

---
 arch/openrisc/Kconfig              | 12 ++++++++++++
 arch/openrisc/kernel/vmlinux.lds.S |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)
arch/openrisc/Kconfig +0 -0
index e5a693b..c7fe7c8 100644
@@ -75,6 +75,18 @@ config OPENRISC_BUILTIN_DTB
         string "Builtin DTB"
         default ""
 
Quoted 11 lines

arch/openrisc/Kconfig config OPENRISC_BUILTIN_DTB · line 84

Quoted 7 lines
arch/openrisc/Kconfig +7 -0
+config OUTPUT_FORMAT_TYPE
+	string "Architecture output format type"
+	default "or1k"
+	help
+	  Write "or12" if building kernel against an older toolchain
+	  else leave the default (or1k)
+

That means I'll have to use different toolchains for different kernel versions, or hand-edit default configuration files to able to work with the same toolchain. Both is, from a testing perspective, quite annoying.

Also quite annoying would be

    $ grep OUTPUT_FORMAT .config 
    CONFIG_OUTPUT_FORMAT_TYPE="typo"

(Note the missing CONFIG_OUTPUT_FORMAT= line.)

What might be less annoying would be something (completely untested) like:
choice
prompt "Architecture output format type"
default OUTPUT_FORMAT_OR1K
help
Choose "or12" if building kernel against an older toolchain else leave the default "or1k".

config OUTPUT_FORMAT_OR1K
bool "or1k"

config OUTPUT_FORMAT_OR12
bool "or12"

enchoice

config OUTPUT_FORMAT
string
default "elf32-or1k" if OUTPUT_FORMAT_OR1K default "elf32-or12" if OUTPUT_FORMAT_OR12

Quoted 3 lines

Maybe I should simply stop testing older kernels for openrisc after this patch has been merged; that would be much easier. Jonas, is that ok with you ?

Would testing be easier if you'd be provided with two defconfig files? Ie, one for "elf32-or1k" and "elf32-or12".

(Note that "elf32-or12" smells like a typo to me. Shouldn't that be "elf32-or32"? If not, where does "elf32-or32" fir in this story?)

Quoted 2 lines

Side note: I didn't drop it from Cc:, but the openrisc.net domain name expired and appears to be for sale.

That's ominous.

Thanks,

Paul Bolle

#3 lore raw
Quoted 63 lines · Paul Bolle
Quoted 22 lines · Guenter Roeck
Quoted 21 lines · anees

Kernel build fails with error "target elf32-or32 not found" This is due to the change in OpenRISC compiler prefix from "or12" to "or1k". Add config options that set architecture output format default to "or1k" but also allow user to select older prefix.

Tested with gcc version 4.9.1 uclibc

---
  arch/openrisc/Kconfig              | 12 ++++++++++++
  arch/openrisc/kernel/vmlinux.lds.S |  6 +++---
  2 files changed, 15 insertions(+), 3 deletions(-)
arch/openrisc/Kconfig +0 -0
index e5a693b..c7fe7c8 100644
@@ -75,6 +75,18 @@ config OPENRISC_BUILTIN_DTB
          string "Builtin DTB"
          default ""
 
Quoted 11 lines

arch/openrisc/Kconfig config OPENRISC_BUILTIN_DTB · line 84

Quoted 7 lines
arch/openrisc/Kconfig +7 -0
+config OUTPUT_FORMAT_TYPE
+	string "Architecture output format type"
+	default "or1k"
+	help
+	  Write "or12" if building kernel against an older toolchain
+	  else leave the default (or1k)
+

That means I'll have to use different toolchains for different kernel versions, or hand-edit default configuration files to able to work with the same toolchain. Both is, from a testing perspective, quite annoying.

Also quite annoying would be

     $ grep OUTPUT_FORMAT .config
     CONFIG_OUTPUT_FORMAT_TYPE="typo"

(Note the missing CONFIG_OUTPUT_FORMAT= line.)

What might be less annoying would be something (completely untested) like:
choice
prompt "Architecture output format type"
default OUTPUT_FORMAT_OR1K
help
Choose "or12" if building kernel against an older toolchain else leave the default "or1k".

config OUTPUT_FORMAT_OR1K
bool "or1k"

config OUTPUT_FORMAT_OR12
bool "or12"

enchoice

config OUTPUT_FORMAT
string
default "elf32-or1k" if OUTPUT_FORMAT_OR1K default "elf32-or12" if OUTPUT_FORMAT_OR12

Quoted 7 lines
Quoted 3 lines

Maybe I should simply stop testing older kernels for openrisc after this patch has been merged; that would be much easier. Jonas, is that ok with you ?

Would testing be easier if you'd be provided with two defconfig files? Ie, one for "elf32-or1k" and "elf32-or12".

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

Guenter

#4 lore raw
Quoted 1 line · Guenter Roeck

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

(That patch also suggests that "or12" in the patch we're discussing here is a typo.)

This is problem is present now for none months, apparently. Your patch was supposed to be applied already (see
https://lkml.org/lkml/2014/9/22/36 ), but clearly nothing happened. openrisc.net is for sale.

What's going on here?

Thanks,

Paul Bolle

#5 lore raw
Quoted 7 lines · Paul Bolle
Quoted 1 line · Guenter Roeck

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

(That patch also suggests that "or12" in the patch we're discussing here is a typo.)

This is problem is present now for none months, apparently. Your patch

The problem was already present when openrisc was introduced back in 2011; see arch/openrisc/TODO.openrisc. I just tried to get it fixed to let me use a more recent toolchain for my build tests.

Quoted 6 lines

was supposed to be applied already (see
https://lkml.org/lkml/2014/9/22/36 ), but clearly nothing happened. openrisc.net is for sale.

What's going on here?

No idea :-(

Guenter

maintainer
#6 lore raw
In reply to Paul Bolle
Quoted 11 lines · Paul Bolle
Quoted 1 line · Guenter Roeck

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

(That patch also suggests that "or12" in the patch we're discussing here is a typo.)

This is problem is present now for none months, apparently. Your patch was supposed to be applied already (see
https://lkml.org/lkml/2014/9/22/36 ), but clearly nothing happened. openrisc.net is for sale.

What's going on here?

openrisc.net is no more.... long story, not worth regurgitating.

Guenter's patch is the one to apply. You can put my Acked-by: Jonas Bonn <[email protected]> on it. Unfortunately, I'm not currently in a position to do anything meaningful with it, so please send it upstream directly via Andrew Morton's collection of assorted patches.

/Jonas

Quoted 6 lines

Thanks,

Paul Bolle

#7 lore raw
Quoted 1 line · Jonas Bonn

openrisc.net is no more.... long story, not worth regurgitating.

I see. What would you suggest as substitutes for:

    MAINTAINERS:W:    http://openrisc.net
    MAINTAINERS:L:    [email protected] (moderated for non-subscribers)
    MAINTAINERS:T:    git git://openrisc.net/~jonas/linux

arch/openrisc/README.openrisc: website http://openrisc.net
arch/openrisc/README.openrisc:1) The toolchain can be obtained from openrisc.net. Instructions for building arch/openrisc/README.openrisc:http://openrisc.net/toolchain-build.html
arch/openrisc/README.openrisc: git clone git://openrisc.net/jonas/or1ksim-svn
arch/openrisc/kernel/setup.c: printk(KERN_INFO "OpenRISC Linux -- http://openrisc.net\n");

Thanks,

Paul Bolle

#8 lore raw
Quoted 6 lines · Paul Bolle
Quoted 1 line · Jonas Bonn

openrisc.net is no more.... long story, not worth regurgitating.

I see. What would you suggest as substitutes for:
MAINTAINERS:W: http://openrisc.net
MAINTAINERS:L: [email protected] (moderated for non-subscribers)

[email protected] is still active.

Quoted 6 lines

MAINTAINERS:T: git git://openrisc.net/~jonas/linux
arch/openrisc/README.openrisc: website http://openrisc.net
arch/openrisc/README.openrisc:1) The toolchain can be obtained from openrisc.net. Instructions for building arch/openrisc/README.openrisc:http://openrisc.net/toolchain-build.html
arch/openrisc/README.openrisc: git clone git://openrisc.net/jonas/or1ksim-svn
arch/openrisc/kernel/setup.c: printk(KERN_INFO "OpenRISC Linux -- http://openrisc.net\n");

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#9 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 6 lines · Paul Bolle
Quoted 1 line · Jonas Bonn

openrisc.net is no more.... long story, not worth regurgitating.

I see. What would you suggest as substitutes for:
MAINTAINERS:W: http://openrisc.net
MAINTAINERS:L: [email protected] (moderated for non-subscribers)

[email protected] is still active.

Quoted 1 line

MAINTAINERS:T: git git://openrisc.net/~jonas/linux

Maybe replace it with https://github.com/openrisc/linux ?

Guenter

#10 lore raw
In reply to Jonas Bonn
Quoted 11 lines · Jonas Bonn
Quoted 10 lines · Paul Bolle
Quoted 1 line · Guenter Roeck

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

(That patch also suggests that "or12" in the patch we're discussing here is a typo.)

This is problem is present now for none months, apparently. Your patch was supposed to be applied already (see
https://lkml.org/lkml/2014/9/22/36 ), but clearly nothing happened. openrisc.net is for sale.

Quoted 9 lines
Quoted 1 line

What's going on here?

openrisc.net is no more.... long story, not worth regurgitating.

Guenter's patch is the one to apply. You can put my Acked-by: Jonas Bonn <[email protected]> on it. Unfortunately, I'm not currently in a position to do anything meaningful with it, so please send it upstream directly via Andrew Morton's collection of assorted patches.

I resent my patch with your Acked-by: and copied Andrew.

Guenter

#11 lore raw
In reply to Jonas Bonn
Quoted 11 lines · Jonas Bonn
Quoted 10 lines · Paul Bolle
Quoted 1 line · Guenter Roeck

Just remembered ... or just apply https://lkml.org/lkml/2014/9/19/11 instead.

(That patch also suggests that "or12" in the patch we're discussing here is a typo.)

This is problem is present now for none months, apparently. Your patch was supposed to be applied already (see
https://lkml.org/lkml/2014/9/22/36 ), but clearly nothing happened. openrisc.net is for sale.

Quoted 6 lines
Quoted 1 line

What's going on here?

openrisc.net is no more.... long story, not worth regurgitating.

Guenter's patch is the one to apply. You can put my Acked-by: Jonas Bonn <[email protected]> on it. Unfortunately, I'm not currently in a position to do anything meaningful with it, so please send it upstream directly via Andrew Morton's collection of assorted patches.

Jonas,

Looks like you are out for the time being, and we can not add Stefan as maintainer (yet) because he doesn't have a signed key.

Wonder if I should step in as interim maintainer to handle urgent requests like this one. Comments, thoughts, anyone ?

Guenter

#12 lore raw
Quoted 2 lines · Guenter Roeck

Wonder if I should step in as interim maintainer to handle urgent requests like this one. Comments, thoughts, anyone ?

This is about a pretty major build issue, that's been known for ten months now, isn't? If that's correct, this is not an urgent request, but a chronic issue. So in that case anyone who cares about OpenRISC should consider taking over. Because this looks like an orphaned architecture to me.

Am I being too strict?

Paul Bolle

#13 lore raw
Quoted 10 lines · Paul Bolle
Quoted 2 lines · Guenter Roeck

Wonder if I should step in as interim maintainer to handle urgent requests like this one. Comments, thoughts, anyone ?

This is about a pretty major build issue, that's been known for ten months now, isn't? If that's correct, this is not an urgent request, but a chronic issue. So in that case anyone who cares about OpenRISC should consider taking over. Because this looks like an orphaned architecture to me.

Those using the architecture simply apply the patch, or a similar patch, or use the tree Stefan maintains at github.

Sure, we can wait until Stefan gets a public key and we can add him as maintainer. I guess the active users use Stefan's tree at github anyway.

Guenter