Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/conf Clean up the 32-bit vs. 64-bit kernel ...



details:   https://anonhg.NetBSD.org/src/rev/3022fb3e0412
branches:  trunk
changeset: 516535:3022fb3e0412
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Oct 24 18:49:38 2001 +0000

description:
Clean up the 32-bit vs. 64-bit kernel configuration stuff:
- Put all options necessary to build a 64-bit kernel into std.sparc64-64,
  which can be included after std.sparc64.
- Change the logic used to enable 64-bit kernels.  The kernel Makefile now
  uses an LP64 make variable, and explicitly sets compiler flags and linker
  scripts to generate 32-bit or 64-bit kernels.

diffstat:

 sys/arch/sparc64/conf/GENERIC          |  12 ++++++------
 sys/arch/sparc64/conf/GENERIC32        |   6 ++----
 sys/arch/sparc64/conf/INSTALL          |  10 +++++-----
 sys/arch/sparc64/conf/Makefile.sparc64 |  26 +++++++++++++++++++++++---
 sys/arch/sparc64/conf/NONPLUS          |   4 +---
 sys/arch/sparc64/conf/NONPLUS64        |   7 ++-----
 sys/arch/sparc64/conf/POWEROFSEVEN     |   9 +--------
 sys/arch/sparc64/conf/POWEROFSEVEN.inc |   4 +---
 sys/arch/sparc64/conf/POWEROFSEVEN32   |   7 +------
 sys/arch/sparc64/conf/SPLODE           |   6 ++----
 sys/arch/sparc64/conf/std.sparc64      |   6 ++++--
 sys/arch/sparc64/conf/std.sparc64-64   |  11 +++++++++++
 12 files changed, 59 insertions(+), 49 deletions(-)

diffs (truncated from 301 to 300 lines):

diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/GENERIC
--- a/sys/arch/sparc64/conf/GENERIC     Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/GENERIC     Wed Oct 24 18:49:38 2001 +0000
@@ -1,18 +1,18 @@
-#      $NetBSD: GENERIC,v 1.42 2001/02/11 01:00:51 eeh Exp $
+#      $NetBSD: GENERIC,v 1.43 2001/10/24 18:49:38 thorpej Exp $
 
 include "arch/sparc64/conf/GENERIC32"
 
-#ident                 "GENERIC64-$Revision: 1.42 $"
+#ident                 "GENERIC-$Revision: 1.43 $"
 
-options        _LP64           # we're using a 64-bit compiler
+include "arch/sparc64/conf/std.sparc64-64"
+
 options        COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options                COMPAT_SVR4_32  # SunOS 5.x 32-bit binary compatibility
-options        EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries.
 
 # DEBUG options turned on:
 
-#options               LOCKDEBUG
-#options               DIAGNOSTIC
+#options       LOCKDEBUG
+#options       DIAGNOSTIC
 makeoptions    DEBUG="-g"
 #options       DEBUG
 #options       SYSCALL_DEBUG
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/GENERIC32
--- a/sys/arch/sparc64/conf/GENERIC32   Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/GENERIC32   Wed Oct 24 18:49:38 2001 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: GENERIC32,v 1.21 2001/09/21 22:08:41 eeh Exp $
+#      $NetBSD: GENERIC32,v 1.22 2001/10/24 18:49:39 thorpej Exp $
 
 include "arch/sparc64/conf/std.sparc64"
 
-#ident                 "GENERIC-$Revision: 1.21 $"
+#ident                 "GENERIC-$Revision: 1.22 $"
 
 maxusers       64
 
@@ -12,7 +12,6 @@
 # Options for variants of the Sun SPARC architecure.
 # We currently support three architecture types; at least one is required.
 options        SUN4U           # sun4u - UltraSPARC
-#options       _LP64           # we're using a 64-bit compiler
 
 ## System options specific to the sparc machine type
 
@@ -135,7 +134,6 @@
 #options       COMPAT_NETBSD32 # NetBSD/sparc binary compatibility -- 64-bit only
 options        EXEC_AOUT       # execve(2) support for a.out binaries
 options        EXEC_ELF32      # Exec module for SunOS 5.x binaries.
-#options       EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries. -- 64-bit only
 #options       SYSCALL_DEBUG
 
 #options       TCP_COMPAT_42   # 4.2BSD TCP/IP bug compat. Not recommended.
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/INSTALL
--- a/sys/arch/sparc64/conf/INSTALL     Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/INSTALL     Wed Oct 24 18:49:38 2001 +0000
@@ -1,17 +1,17 @@
-#      $NetBSD: INSTALL,v 1.2 2001/08/18 04:55:29 eeh Exp $
+#      $NetBSD: INSTALL,v 1.3 2001/10/24 18:49:39 thorpej Exp $
 
 include "arch/sparc64/conf/GENERIC32"
 
-#ident                 "GENERIC64-$Revision: 1.2 $"
+#ident                 "INSTALL-$Revision: 1.3 $"
 
-options        _LP64           # we're using a 64-bit compiler
+include "arch/sparc64/conf/std.sparc64-64"
+
 options        COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options                COMPAT_SVR4_32  # SunOS 5.x 32-bit binary compatibility
-options        EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries.
 
 # DEBUG options turned on:
 
-#options               LOCKDEBUG
+#options       LOCKDEBUG
 options                DIAGNOSTIC
 makeoptions    DEBUG="-g"
 options        DEBUG
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/Makefile.sparc64
--- a/sys/arch/sparc64/conf/Makefile.sparc64    Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/Makefile.sparc64    Wed Oct 24 18:49:38 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.sparc64,v 1.39 2001/10/21 19:46:16 thorpej Exp $
+#      $NetBSD: Makefile.sparc64,v 1.40 2001/10/24 18:49:39 thorpej Exp $
 
 # Makefile for NetBSD
 #
@@ -12,6 +12,11 @@
 #      /sys/arch/sparc64/conf/Makefile.sparc64
 # after which config should be rerun for all machines of that type.
 
+# Always use sparc64 as the MACHINE_ARCH, so we select the correct
+# toolchain (i.e. need v9 instruction support in the assembler, etc.)
+# 32-bit vs. 64-bit will be selected based on compiler/assember options.
+MACHINE_ARCH=sparc64
+
 .include <bsd.own.mk>
 
 # DEBUG is set to -g if debugging.
@@ -46,10 +51,25 @@
 # XXX always get it right.  --thorpej
 CWARNFLAGS+=   -Wno-uninitialized
 CWARNFLAGS+=   -Wno-main
+
+# Select the compiler, assembler, and linker flags based on the
+# LP64 variable.
+LP64?= no
+.if ${LP64} == "yes"
+CC:=           ${CC} -m64
+AS:=           ${AS} -64
+LD:=           ${LD} -m elf64_sparc
+CPPFLAGS+=     -D_LP64
+.else
+CC:=           ${CC} -m32
+AS:=           ${AS} -32
+LD:=           ${LD} -m elf32_sparc
+.endif
+
 CFLAGS=                ${DEBUG} ${COPTS} ${CWARNFLAGS} -Wa,-Av9a -mno-fpu
 .if defined(PROF)
 # We need to run the compiler in medlow memory model.
-CFLAGS += -mcmodel=medlow
+CFLAGS+=       -mcmodel=medlow
 .endif
 AFLAGS=                -x assembler-with-cpp -traditional-cpp -D_LOCORE -Wa,-Av9a
 
@@ -61,7 +81,7 @@
 #LINKFLAGS=    -Ttext f1000000 -Tdata f1400000 -e start
 
 LINKFLAGS+=    -n -T ${SPARC64}/conf/${KERN_LDSCRIPT}
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${LP64} == "yes"
 KERN_LDSCRIPT?= kern.ldscript
 .else
 KERN_LDSCRIPT?= kern32.ldscript
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/NONPLUS
--- a/sys/arch/sparc64/conf/NONPLUS     Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/NONPLUS     Wed Oct 24 18:49:38 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NONPLUS,v 1.28 2001/07/23 21:06:37 eeh Exp $
+#      $NetBSD: NONPLUS,v 1.29 2001/10/24 18:49:39 thorpej Exp $
 
 include "arch/sparc64/conf/std.sparc64"
 
@@ -12,7 +12,6 @@
 # We currently support three architecture types; at least one is required.
 options                SUN4U           # sun4u - UltraSPARC
 options                __ELF__         # we use elf 
-#options       _LP64           # we're using a 64-bit compiler
 #options       __SWAP_BROKEN
 makeoptions    SPARC_BINARIES=1
 
@@ -136,7 +135,6 @@
 options        COMPAT_SVR4     # SunOS 5.x binary compatibility
 #options       COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options        EXEC_ELF32      # Exec module for NetBSD/sparc 1.5 binaries.
-#options       EXEC_ELF64      # Exec module for NetBSD/sparc64 binaries.
 #options       SYSCALL_DEBUG
 options        EXEC_AOUT       # Exec module for NetBSD/sparc pre-1.5 binaries.
 
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/NONPLUS64
--- a/sys/arch/sparc64/conf/NONPLUS64   Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/NONPLUS64   Wed Oct 24 18:49:38 2001 +0000
@@ -1,11 +1,8 @@
-#      $NetBSD: NONPLUS64,v 1.18 2001/02/11 01:04:59 eeh Exp $
+#      $NetBSD: NONPLUS64,v 1.19 2001/10/24 18:49:39 thorpej Exp $
 
 include "arch/sparc64/conf/NONPLUS"
 
-#ident                 "GENERIC64-$Revision: 1.18 $"
+#ident                 "GENERIC64-$Revision: 1.19 $"
 
-options        _LP64           # we're using a 64-bit compiler
 options        COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options                COMPAT_SVR4_32  # 32-bit SVR4 binaries
-options        EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries.
-makeoptions    _LP64=1
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/POWEROFSEVEN
--- a/sys/arch/sparc64/conf/POWEROFSEVEN        Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/POWEROFSEVEN        Wed Oct 24 18:49:38 2001 +0000
@@ -1,13 +1,6 @@
-#      $NetBSD: POWEROFSEVEN,v 1.19 2001/09/02 05:53:38 mrg Exp $
+#      $NetBSD: POWEROFSEVEN,v 1.20 2001/10/24 18:49:40 thorpej Exp $
 
 include "arch/sparc64/conf/POWEROFSEVEN.inc"
 
-options        _LP64           # we're using a 64-bit compiler
 #options       COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 #options       COMPAT_SVR4_32  # SunOS 5.x 32-bit binary compatibility
-options        EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries.
-
-makeoptions    MACHINE_ARCH=sparc64
-makeoptions    CC="cc -m64"
-makeoptions    LD="ld -m elf64_sparc"
-makeoptions    AS="as -64"
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/POWEROFSEVEN.inc
--- a/sys/arch/sparc64/conf/POWEROFSEVEN.inc    Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/POWEROFSEVEN.inc    Wed Oct 24 18:49:38 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: POWEROFSEVEN.inc,v 1.3 2001/10/22 16:42:44 mrg Exp $
+#      $NetBSD: POWEROFSEVEN.inc,v 1.4 2001/10/24 18:49:40 thorpej Exp $
 #
 # from: $NetBSD: POWEROFSEVEN32,v 1.10 2001/08/25 15:04:26 mrg Exp
 # from: NetBSD: GENERIC32,v 1.13 2001/02/28 00:08:18 mjacob Exp
@@ -15,7 +15,6 @@
 # Options for variants of the Sun SPARC architecure.
 # We currently support three architecture types; at least one is required.
 options                SUN4U           # sun4u - UltraSPARC
-#options       _LP64           # we're using a 64-bit compiler
 
 ## System options specific to the sparc machine type
 
@@ -138,7 +137,6 @@
 #options       COMPAT_SUNOS    # SunOS 4.x binary compatibility
 #options       COMPAT_SVR4     # SunOS 5.x binary compatibility
 #options       EXEC_ELF32      # Exec module for 32 bit ELF binaries.
-#options       EXEC_ELF64      # Exec module for 64 bit ELF binaries. -- 64-bit only
 #options       EXEC_AOUT       # execve(2) support for a.out binaries
 
 #options       TCP_COMPAT_42   # 4.2BSD TCP/IP bug compat. Not recommended.
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/POWEROFSEVEN32
--- a/sys/arch/sparc64/conf/POWEROFSEVEN32      Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/POWEROFSEVEN32      Wed Oct 24 18:49:38 2001 +0000
@@ -1,8 +1,3 @@
-#      $NetBSD: POWEROFSEVEN32,v 1.11 2001/09/02 05:53:38 mrg Exp $
+#      $NetBSD: POWEROFSEVEN32,v 1.12 2001/10/24 18:49:40 thorpej Exp $
 
 include "arch/sparc64/conf/POWEROFSEVEN.inc"
-
-makeoptions    MACHINE_ARCH=sparc
-makeoptions    CC="cc -m32"
-makeoptions    LD="ld -m elf32_sparc"
-makeoptions    AS="as -32"
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/SPLODE
--- a/sys/arch/sparc64/conf/SPLODE      Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/SPLODE      Wed Oct 24 18:49:38 2001 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: SPLODE,v 1.2 2001/09/22 00:58:46 mrg Exp $
+#      $NetBSD: SPLODE,v 1.3 2001/10/24 18:49:40 thorpej Exp $
 #
 # Configuration for Ultra1, 32 bit mode.
 
 include "arch/sparc64/conf/std.sparc64"
 
-#ident                 "GENERIC-$Revision: 1.2 $"
+#ident                 "GENERIC-$Revision: 1.3 $"
 
 maxusers       64
 
@@ -15,7 +15,6 @@
 # We currently support three architecture types; at least one is required.
 options        SUN4U           # sun4u - UltraSPARC
 #options       LOCKDEBUG
-#options       _LP64           # we're using a 64-bit compiler
 
 ## System options specific to the sparc machine type
 
@@ -141,7 +140,6 @@
 #options       COMPAT_NETBSD32 # NetBSD/sparc binary compatibility -- 64-bit only
 options        EXEC_AOUT       # execve(2) support for a.out binaries
 options        EXEC_ELF32      # Exec module for SunOS 5.x binaries.
-#options       EXEC_ELF64      # Exec module for sparc64 & SunOs 5.x binaries. -- 64-bit only
 #options       SYSCALL_DEBUG
 
 #options       TCP_COMPAT_42   # 4.2BSD TCP/IP bug compat. Not recommended.
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/std.sparc64
--- a/sys/arch/sparc64/conf/std.sparc64 Wed Oct 24 18:40:16 2001 +0000
+++ b/sys/arch/sparc64/conf/std.sparc64 Wed Oct 24 18:49:38 2001 +0000
@@ -1,7 +1,9 @@
-#      $NetBSD: std.sparc64,v 1.9 2001/10/23 21:24:18 thorpej Exp $
+#      $NetBSD: std.sparc64,v 1.10 2001/10/24 18:49:40 thorpej Exp $
 
 #
-# Mandatory NetBSD/sparc kernel options.
+# Mandatory NetBSD/sparc64 kernel options when building either 32-bit or
+# 64-bit kernels.  Additional mandatory options for 64-bit kernels are
+# picked up by also including "std.sparc64-64".
 #
 
 machine                sparc64         # Machine architecture; required by config(8)
diff -r 5149713f325b -r 3022fb3e0412 sys/arch/sparc64/conf/std.sparc64-64
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc64/conf/std.sparc64-64      Wed Oct 24 18:49:38 2001 +0000
@@ -0,0 +1,11 @@
+#      $NetBSD: std.sparc64-64,v 1.1 2001/10/24 18:49:40 thorpej Exp $
+
+#
+# Mandatory NetBSD/sparc64 kernel options when building 64-bit kernels.
+# Note, you still must include "std.sparc64" in your kernel config file.
+# Note this file MUST be included *after* "std.sparc64".
+#
+
+makeoptions    LP64="yes"      # enable 64-bit logic in kernel Makefile
+



Home | Main Index | Thread Index | Old Index