SHA256
1
0
forked from pool/qemu
qemu/SLOF_ppc64le.patch
Andreas Färber 15d50565ca Accepting request 338512 from home:a_faerber:branches:Virtualization
Allow building SLOF on ppc64le (bsc#949016) and add two checks for DictZip and tar qemu-img behavior (bsc#945778)

OBS-URL: https://build.opensuse.org/request/show/338512
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=274
2015-10-13 16:39:07 +00:00

49 lines
1.3 KiB
Diff

From 14f14004dd8f7a9be63510284c10445c7a8be5d7 Mon Sep 17 00:00:00 2001
From: Dinar Valeev <dvaleev@suse.com>
Date: Fri, 9 Oct 2015 13:01:12 +0200
Subject: [PATCH] Allow to build SLOF on Little Endian host
Don't require cross compiler in order to build SLOF on ppc64le platform.
Native compiler is capable to build ELFv1 BE binary. We just need to
instruct it how to do it. By adding -mbig and -mabi=elfv1 flags
Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
make.rules | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/make.rules b/make.rules
index aebc4e3..cbc6353 100644
--- a/make.rules
+++ b/make.rules
@@ -19,8 +19,12 @@
ARCH := $(shell uname -p)
# Auto-detect ppc64
-ifeq ($(ARCH), ppc64)
-CROSS = ""
+ifeq (ppc64,$(findstring ppc64,$(ARCH)))
+ ifeq ($(ARCH), ppc64le)
+ EXTRA_CC = -mbig -mabi=elfv1
+ EXTRA_LD = -mbig
+ endif
+CROSS ?=
else
CROSS ?= powerpc64-linux-
endif
@@ -31,8 +35,8 @@ HOSTCC ?= gcc
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
DD = dd
-ONLY_CC = $(CROSS)gcc -m$(CELLSIZE)
-ONLY_AS = $(CROSS)as -m$(CELLSIZE)
+ONLY_CC = $(CROSS)gcc -m$(CELLSIZE) $(EXTRA_CC)
+ONLY_AS = $(CROSS)as -m$(CELLSIZE) $(EXTRA_LD)
ONLY_LD = $(CROSS)ld -melf$(CELLSIZE)ppc
# Verbose level:
--
2.1.4