From 47e9f42ea39b891016144ecdd3156f55e2d2a4b1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 26 Feb 2020 18:49:20 +0000 Subject: [PATCH] Remove sparc64 specific buid-system hacks Remove all the sparc64 hacks and tweaks to the build system. We don't need them anymore. --- share/mk/bsd.cpu.mk | 29 ++------------------------- share/mk/bsd.endian.mk | 1 - share/mk/bsd.lib.mk | 5 ----- share/mk/bsd.sys.mk | 4 ---- share/mk/local.meta.sys.mk | 2 +- share/mk/src.opts.mk | 41 ++++++++++++++------------------------ 6 files changed, 18 insertions(+), 64 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 3c996714ac9b..b7fd6cfdd5b1 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -20,8 +20,6 @@ MACHINE_CPU = mips MACHINE_CPU = aim . elif ${MACHINE_CPUARCH} == "riscv" MACHINE_CPU = riscv -. elif ${MACHINE_CPUARCH} == "sparc64" -MACHINE_CPU = ultrasparc . endif .else @@ -75,12 +73,6 @@ CPUTYPE = pentium-mmx CPUTYPE = pentium . endif . endif -. elif ${MACHINE_ARCH} == "sparc64" -. if ${CPUTYPE} == "us" -CPUTYPE = ultrasparc -. elif ${CPUTYPE} == "us3" -CPUTYPE = ultrasparc3 -. endif . endif ############################################################################### @@ -152,14 +144,6 @@ _CPUCFLAGS = -march=${CPUTYPE} # sb1, xlp, xlr _CPUCFLAGS = -march=${CPUTYPE:S/^mips//} . endif -. elif ${MACHINE_ARCH} == "sparc64" -. if ${CPUTYPE} == "v9" -_CPUCFLAGS = -mcpu=v9 -. elif ${CPUTYPE} == "ultrasparc" -_CPUCFLAGS = -mcpu=ultrasparc -. elif ${CPUTYPE} == "ultrasparc3" -_CPUCFLAGS = -mcpu=ultrasparc3 -. endif . elif ${MACHINE_CPUARCH} == "aarch64" _CPUCFLAGS = -mcpu=${CPUTYPE} . endif @@ -298,15 +282,6 @@ MACHINE_CPU = booke softfp ########## riscv . elif ${MACHINE_CPUARCH} == "riscv" MACHINE_CPU = riscv -########## sparc64 -. elif ${MACHINE_ARCH} == "sparc64" -. if ${CPUTYPE} == "v9" -MACHINE_CPU = v9 -. elif ${CPUTYPE} == "ultrasparc" -MACHINE_CPU = v9 ultrasparc -. elif ${CPUTYPE} == "ultrasparc3" -MACHINE_CPU = v9 ultrasparc ultrasparc3 -. endif . endif .endif @@ -353,7 +328,7 @@ MACHINE_CPU += softfp # when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow building of # soft-float ABI libraries. In this case, we have to add the -mfloat-abi=softfp # to force that. -.if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" +. if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI # not a nice optimization. Please note: softfp ABI uses hardware floating # instructions, but passes arguments to function calls in integer regsiters. @@ -361,7 +336,7 @@ MACHINE_CPU += softfp # supported. softfp support in FreeBSD may disappear in FreeBSD 13.0 since # it was a transition tool from FreeBSD 10 to 11 and is a bit of an odd duck. CFLAGS += -mfloat-abi=softfp -.endif +. endif .endif .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk index e39f69d1ba49..5d057266dca7 100644 --- a/share/mk/bsd.endian.mk +++ b/share/mk/bsd.endian.mk @@ -12,7 +12,6 @@ LOCALEDEF_ENDIAN= -l .elif ${MACHINE_ARCH} == "powerpc" || \ ${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "powerpcspe" || \ - ${MACHINE_ARCH} == "sparc64" || \ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} != "") || \ ${MACHINE_ARCH:Mmips*} != "" TARGET_ENDIANNESS= 4321 diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 7c3b8eef5a7f..ee870b84fd96 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -111,14 +111,9 @@ CFLAGS += -mno-relax .SUFFIXES: .out .o .bc .ll .po .pico .nossppico .pieo .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln .if !defined(PICFLAG) -.if ${MACHINE_CPUARCH} == "sparc64" -PICFLAG=-fPIC -PIEFLAG=-fPIE -.else PICFLAG=-fpic PIEFLAG=-fpie .endif -.endif PO_FLAG=-pg diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 184d4e423289..d5cce6418387 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -214,10 +214,6 @@ CLANG_OPT_SMALL+= -mllvm -enable-gvn=false CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false .endif CFLAGS.clang+= -Qunused-arguments -.if ${MACHINE_CPUARCH} == "sparc64" -# Don't emit .cfi directives, since we must use GNU as on sparc64, for now. -CFLAGS.clang+= -fno-dwarf2-cfi-asm -.endif # SPARC64 # The libc++ headers use c++11 extensions. These are normally silenced because # they are treated as system headers, but we explicitly disable that warning # suppression when building the base system to catch bugs in our headers. diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 8286f43a4cc8..0212d00ee1d9 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -25,7 +25,7 @@ BOOT_MACHINE_DIR.amd64 = boot/i386 MACHINE_ARCH.host = ${_HOST_ARCH} # the list of machines we support -ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips powerpc riscv sparc64 +ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips powerpc riscv .for m in ${ALL_MACHINE_LIST:O:u} MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m} MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 4c28196bf3d1..5d1bfa869f16 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -103,6 +103,7 @@ __DEFAULT_YES_OPTIONS = \ FTP \ GAMES \ GDB \ + GDB_LIBEXEC \ GNU_DIFF \ GNU_GREP \ GOOGLETEST \ @@ -271,9 +272,8 @@ __LLVM_TARGETS= \ mips \ powerpc \ riscv \ - sparc \ x86 -__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ +__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/arm64/aarch64/:S/powerpc64/powerpc/ .for __llt in ${__LLVM_TARGETS} # Default enable the given TARGET's LLVM_TARGET support .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} @@ -286,6 +286,8 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif .endfor +# until we can unwind clang + sparc +MK_LLVM_TARGET_SPARC:=no __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF @@ -293,10 +295,10 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF # If the compiler is not C++11 capable, disable Clang. External toolchain will # be required. -.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && ${__TT} != "sparc64") +.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips") # Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD -.elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64" +.elif ${COMPILER_FEATURES:Mc++11} # If an external compiler that supports C++11 is used as ${CC} and Clang # supports the target, then Clang is enabled but we still require an external # toolchain. @@ -319,8 +321,7 @@ __DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif -.if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && \ - ${__T} != "sparc64" +.if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD @@ -330,13 +331,6 @@ __DEFAULT_YES_OPTIONS+=LLDB .else __DEFAULT_NO_OPTIONS+=LLDB .endif -# GDB in base is generally less functional than GDB in ports. Ports GDB -# sparc64 kernel support has not been tested. -.if ${__T} == "sparc64" -__DEFAULT_NO_OPTIONS+=GDB_LIBEXEC -.else -__DEFAULT_YES_OPTIONS+=GDB_LIBEXEC -.endif # LIB32 is supported on amd64, mips64, and powerpc64 .if (${__T} == "amd64" || ${__T:Mmips64*} || ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=LIB32 @@ -355,23 +349,23 @@ BROKEN_OPTIONS+=LIBSOFT # marked no longer broken with the switch to LLVM. BROKEN_OPTIONS+=GOOGLETEST SSP .endif -# EFI doesn't exist on mips, powerpc, sparc or riscv. -.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} +# EFI doesn't exist on mips, powerpc, or riscv. +.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Mriscv*} BROKEN_OPTIONS+=EFI .endif -# OFW is only for powerpc and sparc64, exclude others -.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" +# OFW is only for powerpc, exclude others +.if ${__T:Mpowerpc*} == "" BROKEN_OPTIONS+=LOADER_OFW .endif # UBOOT is only for arm, mips and powerpc, exclude others .if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" BROKEN_OPTIONS+=LOADER_UBOOT .endif -# GELI and Lua in loader currently cause boot failures on sparc64 and powerpc. +# GELI and Lua in loader currently cause boot failures on powerpc. # Further debugging is required -- probably they are just broken on big # endian systems generically (they jump to null pointers or try to read # crazy high addresses, which is typical of endianness problems). -.if ${__T} == "sparc64" || ${__T:Mpowerpc*} +.if ${__T:Mpowerpc*} BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif @@ -380,7 +374,7 @@ BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA BROKEN_OPTIONS+=PROFILE .endif .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ - ${__T} != "powerpc64" && ${__T} != "sparc64" + ${__T} != "powerpc64" BROKEN_OPTIONS+=CXGBETOOL BROKEN_OPTIONS+=MLX5TOOL .endif @@ -396,11 +390,6 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif -.if ${__T:Msparc64} -# PR 233405 -BROKEN_OPTIONS+=LLVM_LIBUNWIND -.endif - .if ${COMPILER_FEATURES:Mc++11} && \ (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=OPENMP @@ -482,7 +471,7 @@ MK_BSDINSTALL:= no MK_SVNLITE:= no .endif -.if (${__TT} == "mips" || ${__TT} == "sparc64") && ${MK_GCC} == "no" +.if ${__TT} == "mips" && ${MK_GCC} == "no" MK_BINUTILS_BOOTSTRAP:= no .endif