lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] OpenRISC: Fix kernel build problem on OpenRISC
Date
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


\
 
 \ /
  Last update: 2015-05-12 16:21    [W:0.065 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site