diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 6fdeaf6a37f3..3d59776973a1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -1,512 +1,512 @@ # $FreeBSD$ # # Option file for FreeBSD /usr/src builds. # # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} # with sensible (usually) defaults. # # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that # are applicable for that Makefile (typically there are none, but sometimes there # are exceptions). Recursive makes usually add MK_FOO=no for options that they wish # to omit from that make. # # Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO # variable. # # Makefiles may also assume that this file is included by src.opts.mk should it # need variables defined there prior to the end of the Makefile where # bsd.{subdir,lib.bin}.mk is traditionally included. # # The old-style YES_FOO and NO_FOO are being phased out. No new instances of them # should be added. Old instances should be removed since they were just to # bridge the gap between FreeBSD 4 and FreeBSD 5. # # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an # exception is made for _WITHOUT_SRCONF which turns off this mechanism # completely inside bsd.*.mk files). # .if !target(____) ____: .include # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the # make(1) environment. # These should be tested with `== "no"' or `!= "no"' in makefiles. # The NO_* variables should only be set by makefiles for variables # that haven't been converted over. # # These options are used by the src builds. Those listed in # __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned # off. __DEFAULT_NO_OPTIONS will default to 'no' and won't build # unless turned on. Any options listed in 'BROKEN_OPTIONS' will be # hard-wired to 'no'. "Broken" here means not working or # not-appropriate and/or not supported. It doesn't imply something is # wrong with the code. There's not a single good word for this, so # BROKEN was selected as the least imperfect one considered at the # time. Options are added to BROKEN_OPTIONS list on a per-arch basis. # At this time, there's no provision for mutually incompatible options. __DEFAULT_YES_OPTIONS = \ ACCT \ ACPI \ APM \ AT \ ATM \ AUDIT \ AUTHPF \ AUTOFS \ BHYVE \ BLACKLIST \ BLUETOOTH \ BOOT \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ BSDINSTALL \ BSNMP \ BZIP2 \ CALENDAR \ CAPSICUM \ CAROOT \ CASPER \ CCD \ CDDL \ CLANG \ CLANG_BOOTSTRAP \ CLANG_IS_CC \ CLEAN \ CPP \ CROSS_COMPILER \ CRYPT \ CUSE \ CXX \ CXGBETOOL \ DIALOG \ DICT \ DMAGENT \ DYNAMICROOT \ EE \ EFI \ ELFTOOLCHAIN_BOOTSTRAP \ EXAMPLES \ FDT \ FILE \ FINGER \ FLOPPY \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ FTP \ GAMES \ GH_BC \ GNU_DIFF \ GOOGLETEST \ GPIO \ HAST \ HTML \ HYPERV \ ICONV \ INET \ INET6 \ INETD \ IPFILTER \ IPFW \ ISCSI \ JAIL \ KDUMP \ KVM \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ LLVM_ASSERTIONS \ LLVM_COV \ LLVM_CXXFILT \ LOADER_GELI \ LOADER_LUA \ LOADER_OFW \ LOADER_UBOOT \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ MAIL \ MAILWRAPPER \ MAKE \ MLX5TOOL \ NDIS \ NETCAT \ NETGRAPH \ NLS_CATALOGS \ NS_CACHING \ NTP \ NVME \ OFED \ OPENSSL \ PAM \ PF \ PKGBOOTSTRAP \ PMC \ PORTSNAP \ PPP \ QUOTAS \ RADIUS_SUPPORT \ RBOOTD \ RESCUE \ ROUTED \ SENDMAIL \ SERVICESDB \ SETUID_LOGIN \ SHARED_TOOLCHAIN \ SHAREDOCS \ SOURCELESS \ SOURCELESS_HOST \ SOURCELESS_UCODE \ STATS \ SYSCONS \ SYSTEM_COMPILER \ SYSTEM_LINKER \ TALK \ TCP_WRAPPERS \ TCSH \ TELNET \ TEXTPROC \ TFTP \ UNBOUND \ USB \ UTMPX \ VI \ VT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ BEARSSL \ BHYVE_SNAPSHOT \ CLANG_EXTRAS \ CLANG_FORMAT \ DETECT_TZ_CHANGES \ DTRACE_TESTS \ EXPERIMENTAL \ HESIOD \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_BINUTILS \ MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ ZONEINFO_LEAPSECONDS_SUPPORT \ # LEFT/RIGHT. Left options which default to "yes" unless their corresponding # RIGHT option is disabled. __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ LLVM_TARGET_ALL/CLANG \ LOADER_VERIEXEC/BEARSSL \ LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # .for var in \ BLACKLIST \ BZIP2 \ INET \ INET6 \ KERBEROS \ KVM \ NETGRAPH \ PAM \ TESTS \ WIRELESS __DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var} .endfor # # Default behaviour of some options depends on the architecture. Unfortunately # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want # to allow defaults for some things like clang to vary by target architecture. # Additional, per-target behavior should be rarely added only after much # gnashing of teeth and grinding of gears. # .if defined(TARGET_ARCH) __T=${TARGET_ARCH} .else __T=${MACHINE_ARCH} .endif # All supported backends for LLVM_TARGET_XXX __LLVM_TARGETS= \ aarch64 \ arm \ powerpc \ riscv \ x86 __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/:C/mips.*/mips/ .for __llt in ${__LLVM_TARGETS} # Default enable the given TARGET's LLVM_TARGET support .if ${__T:${__LLVM_TARGET_FILT}} == ${__llt} __DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu} # aarch64 needs arm for -m32 support. .elif ${__T} == "aarch64" && ${__llt:Marm*} != "" __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL. .else __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif .endfor __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS .include .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLDB .else __DEFAULT_NO_OPTIONS+=LLDB .endif # LIB32 is supported on amd64, mips64, and powerpc64 .if (${__T} == "amd64" || ${__T:Mmips64*} || ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=LIB32 .else BROKEN_OPTIONS+=LIB32 .endif # Only doing soft float API stuff on armv6 and armv7 .if ${__T} != "armv6" && ${__T} != "armv7" BROKEN_OPTIONS+=LIBSOFT .endif .if ${__T:Mmips*} # GOOGLETEST cannot currently be compiled on mips due to external circumstances. # Notably, the freebsd-gcc port isn't linking in libgcc so we end up trying ot # link to a hidden symbol. LLVM would successfully link this in, but some of # the mips variants are broken under LLVM until LLVM 10. GOOGLETEST should be # marked no longer broken with the switch to LLVM. BROKEN_OPTIONS+=GOOGLETEST SSP .endif # EFI doesn't exist on mips or powerpc. .if ${__T:Mmips*} || ${__T:Mpowerpc*} BROKEN_OPTIONS+=EFI .endif # 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*} == "" +# UBOOT is only for arm, and big-endian powerpc +.if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le" BROKEN_OPTIONS+=LOADER_UBOOT .endif # 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:Mpowerpc*} BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif # Kernel TLS is enabled by default on amd64 and aarch64 .if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS .else __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS .endif .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE .endif .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ ${__T} != "powerpc64" BROKEN_OPTIONS+=CXGBETOOL BROKEN_OPTIONS+=MLX5TOOL .endif # HyperV is currently x86-only .if ${__T} != "amd64" && ${__T} != "i386" BROKEN_OPTIONS+=HYPERV .endif # NVME is only aarch64, x86 and powerpc64* .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ ${__T:Mpowerpc64*} == "" BROKEN_OPTIONS+=NVME .endif .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != "" __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP .endif .include # # Force some options off if their dependencies are off. # Order is somewhat important. # .if ${MK_CAPSICUM} == "no" MK_CASPER:= no .endif .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no .endif .if ${MK_CDDL} == "no" MK_ZFS:= no MK_LOADER_ZFS:= no MK_CTF:= no .endif .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no .endif .if ${MK_CXX} == "no" MK_CLANG:= no MK_GOOGLETEST:= no MK_OFED:= no MK_OPENMP:= no MK_PMC:= no MK_TESTS:= no .endif .if ${MK_DIALOG} == "no" MK_BSDINSTALL:= no .endif .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no MK_DMAGENT:= no .endif .if ${MK_NETGRAPH} == "no" MK_ATM:= no MK_BLUETOOTH:= no .endif .if ${MK_NLS} == "no" MK_NLS_CATALOGS:= no .endif .if ${MK_OPENSSL} == "no" MK_DMAGENT:= no MK_OPENSSH:= no MK_OPENSSL_KTLS:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_ZFS:= no .endif .if ${MK_LDNS} == "no" MK_LDNS_UTILS:= no MK_UNBOUND:= no .endif .if ${MK_PF} == "no" MK_AUTHPF:= no .endif .if ${MK_OFED} == "no" MK_OFED_EXTRA:= no .endif .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif .if ${MK_TESTS_SUPPORT} == "no" MK_GOOGLETEST:= no .endif .if ${MK_ZONEINFO} == "no" MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no .endif .if ${MK_CROSS_COMPILER} == "no" MK_CLANG_BOOTSTRAP:= no MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_LLD_BOOTSTRAP:= no .endif .if ${MK_TOOLCHAIN} == "no" MK_CLANG:= no MK_INCLUDES:= no MK_LLD:= no MK_LLDB:= no MK_LLVM_BINUTILS:= no .endif .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FORMAT:= no MK_CLANG_FULL:= no MK_LLVM_COV:= no .endif .if ${MK_ASAN} == "yes" # In order to get sensible backtraces from ASAN we have to install # llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version. MK_LLVM_BINUTILS:= yes .endif .if ${MK_LLVM_BINUTILS} == "yes" # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be # enabled if MK_LLVM_BINUTILS is set. MK_LLVM_CXXFILT:= yes .endif .if ${MK_LOADER_VERIEXEC} == "no" MK_LOADER_VERIEXEC_PASS_MANIFEST := no .endif # # MK_* options whose default value depends on another option. # .for vv in \ GSSAPI/KERBEROS \ MAN_UTILS/MAN .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) MK_${vv:H}:= no .else MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor # # Set defaults for the MK_*_SUPPORT variables. # .endif # !target(____) diff --git a/stand/Makefile b/stand/Makefile index c5918a6539eb..7ac848f4076a 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -1,86 +1,91 @@ # $FreeBSD$ .include # For amd64 we have to build 32 and 64 bit versions of things. For # others we don't. LIB32LIST is a list of libraries, which if # included, need to be built 32-bit as well. .if ${MACHINE_ARCH} == "amd64" LIB32LIST=libsa .if ${MK_FORTH} != "no" LIB32LIST+= ficl .endif .if ${MK_LOADER_LUA} != "no" LIB32LIST+= liblua .endif .endif S.yes+= libsa S.${MK_LOADER_OFW}+= libofw S.${MK_FDT}+= fdt S.${MK_FORTH}+= ficl S.${MK_FORTH}+= forth S.${MK_LOADER_LUA}+= liblua S.${MK_LOADER_LUA}+= lua S.yes+= defaults S.yes+= fonts S.yes+= images S.yes+= man .if ${MK_FORTH} != "no" INTERP_DEPENDS+= forth .endif .if ${MK_LOADER_LUA} != "no" INTERP_DEPENDS+= lua .endif .include S.${MK_EFI}+= efi S.${MK_LOADER_UBOOT}+= uboot .if defined(LIB32LIST) LIB32DEPENDS= ${LIB32LIST:S/$/32/} .endif .if exists(${.CURDIR}/${MACHINE}/.) S.yes+= ${MACHINE} SUBDIR_DEPEND_${MACHINE}+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_${MACHINE}+= fdt .endif .if ${MK_LOADER_UBOOT} != "no" SUBDIR_DEPEND_${MACHINE}+= uboot .endif .if ${MK_LOADER_OFW} != "no" SUBDIR_DEPEND_${MACHINE}+= libofw .endif .endif # Build the actual subdir list from S.yes, adding in the 32-bit # variant if necessary. .for _x in ${S.yes} SUBDIR+=${_x} .if defined(LIB32LIST) && ${LIB32LIST:M${_x}} SUBDIR+=${_x}32 .endif .if ${_x} != "libsa" SUBDIR_DEPEND_${_x}+= libsa SUBDIR_DEPEND_${_x}32+= libsa32 .endif .endfor # Remaining dependencies SUBDIR_DEPEND_forth+= ficl SUBDIR_DEPEND_lua+= liblua SUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_efi+= fdt .endif +SUBDIR_DEPEND_uboot+= ${INTERP_DEPENDS} +.if ${MK_FDT} != "no" +SUBDIR_DEPEND_uboot+= fdt +.endif + SUBDIR_PARALLEL= yes .include diff --git a/stand/arm/Makefile b/stand/arm/Makefile deleted file mode 100644 index 7ff21abcc9b8..000000000000 --- a/stand/arm/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -NO_OBJ=t - -SUBDIR= uboot - -.include diff --git a/stand/arm/Makefile.inc b/stand/arm/Makefile.inc deleted file mode 100644 index 265f86d1ed55..000000000000 --- a/stand/arm/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" diff --git a/stand/arm/uboot/Makefile b/stand/arm/uboot/Makefile deleted file mode 100644 index f99282aa6e5a..000000000000 --- a/stand/arm/uboot/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# $FreeBSD$ - -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no - -.include - -FILES+= ubldr ubldr.bin - -NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} -INSTALLFLAGS= -b -WARNS?= 1 -# Address at which ubldr will be loaded. -# This varies for different boards and SOCs. -UBLDR_LOADADDR?= 0x1000000 - -# Architecture-specific loader code -SRCS= start.S conf.c self_reloc.c vers.c - -.if ${COMPILER_TYPE} == "gcc" -CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized -.endif - -HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt - -# Always add MI sources -.include "${BOOTSRC}/loader.mk" - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} -LDFLAGS+= -Wl,-znotext - -# Pull in common loader code -.include "${BOOTSRC}/uboot.mk" - -CFLAGS+= -fPIC - -DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} - -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -ldscript.abs: - echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} - -ldscript.pie: - echo "UBLDR_LOADADDR = 0;" >${.TARGET} - -ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} - ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ - -o ${.TARGET} ${OBJS} ${LDADD} - -ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} - ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ - -o ${.TARGET} ${OBJS} ${LDADD} - -ubldr.bin: ubldr.pie - ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} - -CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.include diff --git a/stand/arm/uboot/version b/stand/arm/uboot/version deleted file mode 100644 index ec46b388b281..000000000000 --- a/stand/arm/uboot/version +++ /dev/null @@ -1,10 +0,0 @@ -$FreeBSD$ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - -1.3: Remove NAND FS support. -1.2: Extended with NAND FS support. -1.1: Flattened Device Tree blob support. -1.0: Added storage support. Booting from HDD, USB, etc. is now possible. -0.5: Initial U-Boot/arm version (netbooting only). diff --git a/stand/powerpc/Makefile b/stand/powerpc/Makefile index a16d3933ff7e..b5d11dd6cf57 100644 --- a/stand/powerpc/Makefile +++ b/stand/powerpc/Makefile @@ -1,17 +1,13 @@ # $FreeBSD$ NO_OBJ=t .include SUBDIR.yes= boot1.chrp ofw -.if "${MACHINE_ARCH}" != "powerpc64le" -SUBDIR.${MK_FDT}+= uboot -.endif - .if "${MACHINE_ARCH}" == "powerpc64" SUBDIR.${MK_FDT}+= kboot .endif .include diff --git a/stand/powerpc/uboot/Makefile b/stand/powerpc/uboot/Makefile deleted file mode 100644 index b0635104e454..000000000000 --- a/stand/powerpc/uboot/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# $FreeBSD$ - -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no - -.include - -BINDIR= /boot/uboot -PROG= ubldr -NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} -INSTALLFLAGS= -b - -# Architecture-specific loader code -SRCS= start.S conf.c vers.c ppc64_elf_freebsd.c -SRCS+= ucmpdi2.c - -# Always add MI sources -.include "${BOOTSRC}/loader.mk" -.PATH: ${SYSDIR}/libkern - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc - -.include "${BOOTSRC}/uboot.mk" - -DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} - -MK_PIE= no - -.include diff --git a/stand/powerpc/uboot/version b/stand/powerpc/uboot/version deleted file mode 100644 index 21556cff70e0..000000000000 --- a/stand/powerpc/uboot/version +++ /dev/null @@ -1,11 +0,0 @@ -$FreeBSD$ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - -1.1: Flattened Device Tree blob support. -1.0: Added storage support. -0.6: Integrated with the new U-Boot API -0.5: Full network functionality. -0.2: Initial U-Boot/PowerPC version derived from the existing - OpenFirmware-based. diff --git a/stand/uboot.mk b/stand/uboot.mk deleted file mode 100644 index 0ff7fb32b07c..000000000000 --- a/stand/uboot.mk +++ /dev/null @@ -1,21 +0,0 @@ -# $FreeBSD$ - -SRCS+= main.c - -.PATH: ${UBOOTSRC}/common - -CFLAGS+= -I${UBOOTSRC}/common - -# U-Boot standalone support library -LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a -CFLAGS+= -I${UBOOTSRC}/lib -CFLAGS+= -I${BOOTOBJ}/uboot/lib -.if ${MACHINE_CPUARCH} == "arm" -SRCS+= metadata.c -.endif - -.include "${BOOTSRC}/fdt.mk" - -.if ${MK_FDT} == "yes" -LIBUBOOT_FDT= ${BOOTOBJ}/uboot/fdt/libuboot_fdt.a -.endif diff --git a/stand/uboot/Makefile b/stand/uboot/Makefile index fde6f9c4e16e..aed2121bd507 100644 --- a/stand/uboot/Makefile +++ b/stand/uboot/Makefile @@ -1,9 +1,81 @@ # $FreeBSD$ +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no +LOADER_DISK_SUPPORT?= yes + .include -SUBDIR.yes= lib +.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" + +.if ${MK_PIE} == "yes" +FILES+= ubldr ubldr.bin +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} +.else +PROG= ubldr +.endif + +NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} +BINDIR= /boot/uboot +INSTALLFLAGS= -b +WARNS?= 1 + +.PATH: ${BOOTSRC}/common +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} + + +.if ${COMPILER_TYPE} == "gcc" +CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized +.endif + +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt + +# Always add MI sources +.include "${BOOTSRC}/loader.mk" + +LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -nostdlib -static -T ${LDSCRIPT} +LDFLAGS+= -Wl,-znotext + +SRCS+= main.c vers.c +SRCS+= copy.c devicename.c elf_freebsd.c glue.c +SRCS+= net.c reboot.c time.c gfx_fb_stub.c +SRCS+= uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c + +CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken +CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib + +CFLAGS+= -I${BOOTSRC}/common +CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.OBJDIR} + +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= metadata.c +.endif + +.include "${BOOTSRC}/fdt.mk" + +CFLAGS+= -fPIC + +# Pick up the bootstrap header for some interface items +CFLAGS+= -I${LDRSRC} + +# libfdt headers +CFLAGS+= -I${FDTSRC} + +.ifdef(BOOT_DISK_DEBUG) +# Make the disk code more talkative +CFLAGS+= -DDISK_DEBUG +.endif -SUBDIR.${MK_FDT}+=fdt +DPADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA} -.include +.include diff --git a/stand/uboot/Makefile.inc b/stand/uboot/Makefile.inc deleted file mode 100644 index 265f86d1ed55..000000000000 --- a/stand/uboot/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" diff --git a/stand/uboot/lib/api_public.h b/stand/uboot/api_public.h similarity index 100% rename from stand/uboot/lib/api_public.h rename to stand/uboot/api_public.h diff --git a/stand/uboot/arch/arm/Makefile.inc b/stand/uboot/arch/arm/Makefile.inc new file mode 100644 index 000000000000..66cb3f1b4dda --- /dev/null +++ b/stand/uboot/arch/arm/Makefile.inc @@ -0,0 +1,25 @@ +# Address at which ubldr will be loaded. +# This varies for different boards and SOCs. +UBLDR_LOADADDR?= 0x1000000 + +SRCS+= start.S conf.c self_reloc.c + +ldscript.abs: + echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} + +ldscript.pie: + echo "UBLDR_LOADADDR = 0;" >${.TARGET} + +ubldr: ${OBJS} ldscript.abs ${LDSCRIPT} ${DPADD} + ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ + -o ${.TARGET} ${OBJS} ${LDADD} + +ubldr.pie: ${OBJS} ldscript.pie ${LDSCRIPT} ${DPADD} + ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ + -o ${.TARGET} ${OBJS} ${LDADD} + +ubldr.bin: ubldr.pie + ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} + +CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin + diff --git a/stand/arm/uboot/conf.c b/stand/uboot/arch/arm/conf.c similarity index 100% rename from stand/arm/uboot/conf.c rename to stand/uboot/arch/arm/conf.c diff --git a/stand/arm/uboot/ldscript.arm b/stand/uboot/arch/arm/ldscript.arm similarity index 100% rename from stand/arm/uboot/ldscript.arm rename to stand/uboot/arch/arm/ldscript.arm diff --git a/stand/arm/uboot/start.S b/stand/uboot/arch/arm/start.S similarity index 100% rename from stand/arm/uboot/start.S rename to stand/uboot/arch/arm/start.S diff --git a/stand/uboot/arch/powerpc/Makefile.inc b/stand/uboot/arch/powerpc/Makefile.inc new file mode 100644 index 000000000000..01c7a0c6ac8c --- /dev/null +++ b/stand/uboot/arch/powerpc/Makefile.inc @@ -0,0 +1,6 @@ + +SRCS+= start.S conf.c ppc64_elf_freebsd.c +.PATH: ${SYSDIR}/libkern +SRCS+= ucmpdi2.c + +MK_PIE= no diff --git a/stand/powerpc/uboot/conf.c b/stand/uboot/arch/powerpc/conf.c similarity index 100% rename from stand/powerpc/uboot/conf.c rename to stand/uboot/arch/powerpc/conf.c diff --git a/stand/powerpc/uboot/ldscript.powerpc b/stand/uboot/arch/powerpc/ldscript.powerpc similarity index 100% rename from stand/powerpc/uboot/ldscript.powerpc rename to stand/uboot/arch/powerpc/ldscript.powerpc diff --git a/stand/powerpc/uboot/ppc64_elf_freebsd.c b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c similarity index 100% rename from stand/powerpc/uboot/ppc64_elf_freebsd.c rename to stand/uboot/arch/powerpc/ppc64_elf_freebsd.c diff --git a/stand/powerpc/uboot/start.S b/stand/uboot/arch/powerpc/start.S similarity index 100% rename from stand/powerpc/uboot/start.S rename to stand/uboot/arch/powerpc/start.S diff --git a/stand/uboot/lib/copy.c b/stand/uboot/copy.c similarity index 100% rename from stand/uboot/lib/copy.c rename to stand/uboot/copy.c diff --git a/stand/uboot/lib/devicename.c b/stand/uboot/devicename.c similarity index 100% rename from stand/uboot/lib/devicename.c rename to stand/uboot/devicename.c diff --git a/stand/uboot/lib/elf_freebsd.c b/stand/uboot/elf_freebsd.c similarity index 100% rename from stand/uboot/lib/elf_freebsd.c rename to stand/uboot/elf_freebsd.c diff --git a/stand/uboot/fdt/Makefile b/stand/uboot/fdt/Makefile deleted file mode 100644 index ef60f8bdb6a9..000000000000 --- a/stand/uboot/fdt/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# $FreeBSD$ - -.include - -.PATH: ${LDRSRC} - -LIB= uboot_fdt -WARNS?= 2 - -SRCS= uboot_fdt.c - -# U-Boot library headers -CFLAGS+= -I${UBOOTSRC}/lib - -# libfdt headers -CFLAGS+= -I${FDTSRC} - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} - -.include diff --git a/stand/uboot/lib/glue.c b/stand/uboot/glue.c similarity index 100% rename from stand/uboot/lib/glue.c rename to stand/uboot/glue.c diff --git a/stand/uboot/lib/glue.h b/stand/uboot/glue.h similarity index 100% rename from stand/uboot/lib/glue.h rename to stand/uboot/glue.h diff --git a/stand/arm/uboot/help.uboot b/stand/uboot/help.uboot similarity index 100% rename from stand/arm/uboot/help.uboot rename to stand/uboot/help.uboot diff --git a/stand/uboot/lib/Makefile b/stand/uboot/lib/Makefile deleted file mode 100644 index e5d35de59ffd..000000000000 --- a/stand/uboot/lib/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $FreeBSD$ - -.include - -.PATH: ${LDRSRC} - -LIB= uboot -WARNS?= 2 - -SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c -SRCS+= module.c net.c reboot.c time.c gfx_fb_stub.c - -CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken -CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib - -.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -SRCS+= disk.c -.endif - -.include "${BOOTSRC}/fdt.mk" - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} - -.ifdef(BOOT_DISK_DEBUG) -# Make the disk code more talkative -CFLAGS+= -DDISK_DEBUG -.endif - -.include diff --git a/stand/uboot/lib/libuboot.h b/stand/uboot/libuboot.h similarity index 100% rename from stand/uboot/lib/libuboot.h rename to stand/uboot/libuboot.h diff --git a/stand/uboot/common/main.c b/stand/uboot/main.c similarity index 100% rename from stand/uboot/common/main.c rename to stand/uboot/main.c diff --git a/stand/uboot/lib/net.c b/stand/uboot/net.c similarity index 100% rename from stand/uboot/lib/net.c rename to stand/uboot/net.c diff --git a/stand/uboot/lib/reboot.c b/stand/uboot/reboot.c similarity index 100% rename from stand/uboot/lib/reboot.c rename to stand/uboot/reboot.c diff --git a/stand/uboot/lib/time.c b/stand/uboot/time.c similarity index 100% rename from stand/uboot/lib/time.c rename to stand/uboot/time.c diff --git a/stand/uboot/lib/console.c b/stand/uboot/uboot_console.c similarity index 100% rename from stand/uboot/lib/console.c rename to stand/uboot/uboot_console.c diff --git a/stand/uboot/lib/disk.c b/stand/uboot/uboot_disk.c similarity index 100% rename from stand/uboot/lib/disk.c rename to stand/uboot/uboot_disk.c diff --git a/stand/uboot/fdt/uboot_fdt.c b/stand/uboot/uboot_fdt.c similarity index 100% rename from stand/uboot/fdt/uboot_fdt.c rename to stand/uboot/uboot_fdt.c diff --git a/stand/uboot/lib/module.c b/stand/uboot/uboot_module.c similarity index 100% rename from stand/uboot/lib/module.c rename to stand/uboot/uboot_module.c diff --git a/stand/uboot/version b/stand/uboot/version new file mode 100644 index 000000000000..630fe00bb777 --- /dev/null +++ b/stand/uboot/version @@ -0,0 +1,6 @@ +$FreeBSD$ + +NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this +file is important. Make sure the current version number is on line 6. + +1.5: Unified ubldr build