Skip to contentSkip to conversation

openrisc: Support both old (or32) and new (or1k) toolchain

PATCH Superseded Guenter Roeck 3 participants 5 messages Sep 8, 2014 – Sep 22, 2014 Openrisc architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openrisc: Support both old (or32) and new (or1k) toolchain

The output file format for openrisc has changed from "elf32-or32" to "elf32-or1k" when using the or1k instead of the older or32 toochain. Select the correct output format automatically to be able to compile the kernel with both toolchain variants.

Cc Stefan Kristiansson <[email protected]>

---
Candidate for -stable ?

 arch/openrisc/kernel/vmlinux.lds.S | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/openrisc/kernel/vmlinux.lds.S +7 -1
index 2d69a85..1c5d21a 100644
@@ -30,7 +30,13 @@
 #include <asm/cache.h>
 #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
+#ifdef __OR1K__
+#define __OUTPUT_FORMAT	"elf32-or1k"
+#else
+#define __OUTPUT_FORMAT	"elf32-or32"
+#endif
+
+OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)
 jiffies = jiffies_64 + 4;
 
 SECTIONS
Signature · 1 line
1.9.1
#1 lore raw

ping ... comments / feedback anyone ?

Guenter

Quoted 33 lines · Guenter Roeck

The output file format for openrisc has changed from "elf32-or32" to "elf32-or1k" when using the or1k instead of the older or32 toochain. Select the correct output format automatically to be able to compile the kernel with both toolchain variants.

Cc Stefan Kristiansson <[email protected]>

---
Candidate for -stable ?

  arch/openrisc/kernel/vmlinux.lds.S | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
arch/openrisc/kernel/vmlinux.lds.S +7 -1
index 2d69a85..1c5d21a 100644
@@ -30,7 +30,13 @@
  #include <asm/cache.h>
  #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
+#ifdef __OR1K__
+#define __OUTPUT_FORMAT	"elf32-or1k"
+#else
+#define __OUTPUT_FORMAT	"elf32-or32"
+#endif
+
+OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)
  jiffies = jiffies_64 + 4;
 
  SECTIONS
#2 lore raw
Quoted 4 lines · Guenter Roeck

ping ... comments / feedback anyone ?

Guenter

FWIW, I've tested this and it works fine.

Stefan

Quoted 35 lines · Guenter Roeck
Quoted 33 lines

The output file format for openrisc has changed from "elf32-or32" to "elf32-or1k" when using the or1k instead of the older or32 toochain. Select the correct output format automatically to be able to compile the kernel with both toolchain variants.

Cc Stefan Kristiansson <[email protected]>

---
Candidate for -stable ?

 arch/openrisc/kernel/vmlinux.lds.S | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/openrisc/kernel/vmlinux.lds.S +7 -1
index 2d69a85..1c5d21a 100644
@@ -30,7 +30,13 @@
 #include <asm/cache.h>
 #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
+#ifdef __OR1K__
+#define __OUTPUT_FORMAT	"elf32-or1k"
+#else
+#define __OUTPUT_FORMAT	"elf32-or32"
+#endif
+
+OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)
 jiffies = jiffies_64 + 4;
 
 SECTIONS
#3 lore raw
Quoted 8 lines · Stefan Kristiansson
Quoted 4 lines · Guenter Roeck

ping ... comments / feedback anyone ?

Guenter

FWIW, I've tested this and it works fine.

Hi Stefan,

Great, thanks a lot for testing. Any idea if Jonas is available to send it upstream, or should I try to send it to Linus directly ?

Thanks,
Guenter

Quoted 38 lines

Stefan

Quoted 35 lines · Guenter Roeck
Quoted 33 lines

The output file format for openrisc has changed from "elf32-or32" to "elf32-or1k" when using the or1k instead of the older or32 toochain. Select the correct output format automatically to be able to compile the kernel with both toolchain variants.

Cc Stefan Kristiansson <[email protected]>

---
Candidate for -stable ?

  arch/openrisc/kernel/vmlinux.lds.S | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
arch/openrisc/kernel/vmlinux.lds.S +7 -1
index 2d69a85..1c5d21a 100644
@@ -30,7 +30,13 @@
  #include <asm/cache.h>
  #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
+#ifdef __OR1K__
+#define __OUTPUT_FORMAT	"elf32-or1k"
+#else
+#define __OUTPUT_FORMAT	"elf32-or32"
+#endif
+
+OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)
  jiffies = jiffies_64 + 4;
 
  SECTIONS
maintainer
#4 lore raw

Hi Guenter,

Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Stefan Kristiansson
Quoted 4 lines · Guenter Roeck

ping ... comments / feedback anyone ?

Guenter

FWIW, I've tested this and it works fine.

Thanks, the patch is fine... will apply. It's a nice solution to an icky problem...

/Jonas

Quoted 5 lines

Hi Stefan,

Great, thanks a lot for testing. Any idea if Jonas is available to send it upstream,
or should I try to send it to Linus directly ?