Re: Creating sparc64 installation images
On 12/26/2015 08:50 PM, John Paul Adrian Glaubitz wrote:
> The patch isn't complete in any case, udivid3.S has to be patched as
> well:
Ok, the full patch is actually simple, once you know what to fix.
Attaching my version.
Cheers,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
>From 13e3cbbf31c98643e92de3d709c036ede7b047ea Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sat, 26 Dec 2015 19:56:50 +0000
Subject: [PATCH] Fix builds on sparc64.
---
Rules.make | 5 ++---
common/divdi3.S | 10 +++++++++-
common/udivdi3.S | 10 +++++++++-
second/muldi3.S | 10 +++++++++-
4 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/Rules.make b/Rules.make
index 0f176db..e46af48 100644
--- a/Rules.make
+++ b/Rules.make
@@ -2,10 +2,9 @@ VERSION=1.4.14
IMGVERSION=0.99
SHELL=/bin/bash
RM=rm -f
-# We want to force 32-bit builds
-CC=gcc -m32
+CC=gcc
HOSTCC=gcc
-LD=ld -m elf32_sparc
+LD=ld
AS=as
STRIP=strip
NM=nm
diff --git a/common/divdi3.S b/common/divdi3.S
index 681b368..e9a5fce 100644
--- a/common/divdi3.S
+++ b/common/divdi3.S
@@ -17,9 +17,17 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#if __WORDSIZE == 32
+# define STACK_BIAS 0
+#else
+#define STACK_BIAS 2047
+#endif
+
.data
.align 8
.globl __clz_tab
+ .register %g2,#scratch
+ .register %g3,#scratch
__clz_tab:
.byte 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
.byte 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
@@ -36,7 +44,7 @@ __clz_tab:
.align 4
.globl __divdi3
__divdi3:
- save %sp,-104,%sp
+ save %sp,-STACK_BIAS-104,%sp
cmp %i0,0
bge .LL40
mov 0,%l4
diff --git a/common/udivdi3.S b/common/udivdi3.S
index b430f1f..57eaca0 100644
--- a/common/udivdi3.S
+++ b/common/udivdi3.S
@@ -17,11 +17,19 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#if __WORDSIZE == 32
+# define STACK_BIAS 0
+#else
+#define STACK_BIAS 2047
+#endif
+
.text
.align 4
.globl __udivdi3
+ .register %g2,#scratch
+ .register %g3,#scratch
__udivdi3:
- save %sp,-104,%sp
+ save %sp,-STACK_BIAS-104,%sp
mov %i3,%o3
cmp %i2,0
bne .LL40
diff --git a/second/muldi3.S b/second/muldi3.S
index 7f17872..e74cc54 100644
--- a/second/muldi3.S
+++ b/second/muldi3.S
@@ -17,11 +17,19 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#if __WORDSIZE == 32
+# define STACK_BIAS 0
+#else
+#define STACK_BIAS 2047
+#endif
+
.text
.align 4
.globl __muldi3
+ .register %g2,#scratch
+ .register %g3,#scratch
__muldi3:
- save %sp, -104, %sp
+ save %sp,-STACK_BIAS-104,%sp
wr %g0, %i1, %y
sra %i3, 0x1f, %g2
and %i1, %g2, %g2
--
2.6.4
Reply to: