public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] OpenRISC: Fix kernel build problem on OpenRISC
@ 2015-05-12 13:45 anees
  2015-05-12 20:07 ` Guenter Roeck
  0 siblings, 1 reply; 14+ messages in thread
From: anees @ 2015-05-12 13:45 UTC (permalink / raw)
  To: Jonas Bonn, linux; +Cc: linux-kernel, 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

Signed-off-by: anees <rean12is@gmail.com>
---
 arch/openrisc/Kconfig              | 12 ++++++++++++
 arch/openrisc/kernel/vmlinux.lds.S |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index e5a693b..c7fe7c8 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -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
diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S
index 2d69a85..5cd274c 100644
--- a/arch/openrisc/kernel/vmlinux.lds.S
+++ b/arch/openrisc/kernel/vmlinux.lds.S
@@ -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
-- 
1.9.1


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

end of thread, other threads:[~2015-06-11 15:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12 13:45 [PATCH 1/1] OpenRISC: Fix kernel build problem on OpenRISC anees
2015-05-12 20:07 ` Guenter Roeck
2015-05-13  9:58   ` Paul Bolle
2015-05-13 13:20     ` Guenter Roeck
2015-05-13 13:33       ` Paul Bolle
2015-05-13 13:41         ` Jonas Bonn
2015-05-13 14:28           ` Paul Bolle
2015-05-13 14:44             ` Geert Uytterhoeven
2015-05-13 16:49               ` Guenter Roeck
2015-05-13 16:57           ` Guenter Roeck
2015-06-10 20:21           ` Guenter Roeck
2015-06-11  9:52             ` Paul Bolle
2015-06-11 15:42               ` Guenter Roeck
2015-05-13 13:45         ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox