mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: anees <rean12is@gmail.com>
To: Jonas Bonn <jonas@southpole.se>, linux@lists.openrisc.net
Cc: linux-kernel@vger.kernel.org, anees <rean12is@gmail.com>
Subject: [PATCH 1/1] OpenRISC: Fix kernel build problem on OpenRISC
Date: Tue, 12 May 2015 15:45:21 +0200	[thread overview]
Message-ID: <1431438321-4697-1-git-send-email-rean12is@gmail.com> (raw)

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


             reply	other threads:[~2015-05-12 13:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 13:45 anees [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431438321-4697-1-git-send-email-rean12is@gmail.com \
    --to=rean12is@gmail.com \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@lists.openrisc.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome