aboutsummaryrefslogtreecommitdiff
path: root/stand/defs.mk
Commit message (Collapse)AuthorAgeFilesLines
* [PowerPC64LE] Set up powerpc.powerpc64le architectureBrandon Bergren2020-09-221-4/+4
| | | | | | | | | | | | | | | | | | This is the initial set up for PowerPC64LE. The current plan is for this arch to remain experimental for FreeBSD 13. This started as a weekend learning project for me and kinda snowballed from there. (More to follow momentarily.) Reviewed by: imp (earlier version), emaste Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26399 Notes: svn path=/head/; revision=366032
* [PowerPC] Remove obsolete MK_LOADER_FORCE_LEBrandon Bergren2020-09-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | In D12421, the ability to compile stand/ in little-endian was added, with the intention to extend loader.kboot to run in Petitboot. However, no further work was done, as the kernel then gained self-execution capabilities as Petitboot was taught to load FreeBSD kernels directly. The FreeBSD installer on powerpc64 (on POWER8 and POWER9) uses /boot/etc/kboot.conf instead of loader. As this option does nothing but cause stand/ to be miscompiled and actively causes confusion, remove it. (I have a functioning petitboot loader in my local tree, however, it turned out to be quite inconvient to use due to the current petitboot plugin design so I put it on hold.) Reviewed by: emaste, imp, jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26430 Notes: svn path=/head/; revision=365739
* Add defines for OpenZFS variablesWarner Losh2020-09-011-0/+3
| | | | | | | | | | | OZFS is the top of the OpenZFS tree (aka src/sys/contrib/openzfs). ZFSOSSRC is the path to the OepnZFS sources ZFSOSINC is the path to the OepnZFS includes MFC After: 3 days Notes: svn path=/head/; revision=365026
* Create CFLAGS_EARLY.file for boot loader.Warner Losh2020-08-281-0/+5
| | | | | | | | | | | | | | | | | | Some external code requires a specific set of include paths to work properly since it emulates the typical environment the code is used in. Enable this by creating a CFLAGS_EARLY.file variable that can be used to build this stack. Otherwise the include stack we build for stand programs may get in the way. Code that uses this feature has to tolerate the normal stack of inclues being last on the list (and presumably unused), though. Generally, it it should only be used for the specific include directories. Defines and that sort of thing should be done in the normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for everything in a Makefile. Notes: svn path=/head/; revision=364924
* stand: use portable ln -n instead of ln -hAlex Richardson2020-08-061-1/+1
| | | | | | | | | This fixes the build on Linux Differential Revision: https://reviews.freebsd.org/D24783 Notes: svn path=/head/; revision=363993
* Really fix cleandir after r362973Mitchell Horne2020-07-141-1/+2
| | | | | | | | | | | | | | | | | | I made an attempt to fix this in r362978, but all it really did was confine the issue to the $MACHINE_CPUARCH == "riscv" case. The real problem is that LINKER_FEATURES is not defined here, so bsd.linker.mk needs to be included. This error with cleandir only occurs when META_MODE is disabled, which explains why it was missed by both CI and myself. Note that this effectively reverts r362978. Reported by: mjg Reviewed by: imp, kevans (in IRC) Notes: svn path=/head/; revision=363197
* Fix cleandir target post r362973Mitchell Horne2020-07-061-1/+1
| | | | | | | Reported by: mmacy Notes: svn path=/head/; revision=362978
* RISC-V boot1.efi and loader.efi supportMitchell Horne2020-07-061-3/+10
| | | | | | | | | | | | | | | | | | | | | This implementation doesn't have any major deviations from the other EFI ports. I've copied the boilerplate from arm and arm64. I've tested this with the following boot flows: OpenSBI (M-mode) -> u-boot (S-mode) -> loader.efi -> FreeBSD OpenSBI (M-mode) -> u-boot (S-mode) -> boot1.efi -> loader.efi -> FreeBSD Due to the way that u-boot handles secondary CPUs, OpenSBI >= v0.7 is required, as the HSM extension is needed to bring them up explicitly. Because of this, using BBL as the SBI implementation will not be possible. Additionally, there are a few recent u-boot changes that are required as well, all of which will be present in the upcoming v2020.07 release. Looks good: emaste Differential Revision: https://reviews.freebsd.org/D25135 Notes: svn path=/head/; revision=362973
* Remove tests for obsolete compilers in the build systemEric van Gyzen2020-05-121-4/+0
| | | | | | | | | | | | | | Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Notes: svn path=/head/; revision=360964
* Build the arm64 loader with -ffixed-x18Andrew Turner2020-04-241-1/+1
| | | | | | | | | | | | This stops the compiler from using the x18 register. Some UEFI implementations assume this will be preserved when calling the Boot Services. MFC after: 2 weeks Sponsored by: Innovate UK Notes: svn path=/head/; revision=360247
* [PowerPC] Switch powerpc and powerpcspe to lldBrandon Bergren2020-03-271-4/+0
| | | | | | | | | | | | | | | Now that LLD 10 is out, and required patches have landed, we are now ready to finally switch away from the ancient in-tree ld.bfd. Special thanks to Fangrui Song for many hours of work on getting the 32-bit powerpc lld ready for prime-time. Reviewed by: emaste (earlier revision), jhibbits Relnotes: yes Differential Revision: https://reviews.freebsd.org/D24111 Notes: svn path=/head/; revision=359347
* Move stand/ofw/libofw to stand/libofw.Brandon Bergren2020-01-021-0/+1
| | | | | | | | | | | | | | | Since rS330365, there has been no particular reason for libofw to be in a subdirectory of ofw. Move libofw up a level to make it fit in better with the other top level libraries. Also add a LIBOFWSRC to stand/defs.mk to match what all the other libraries are doing. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23000 Notes: svn path=/head/; revision=356266
* [PowerPC64] Use ld.bfd to build LIB32 and STAND - when using llvmJustin Hibbits2019-12-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is to support ongoing work for replacing "GCC/BFD" by "CLANG/LLD" on target PowerPC64 [1], by proposing a way to specify and/or locate a secondary ld.bfd linker. This is necessary as LLD currently doesn't support PowerPC 32 bits, so we keep using BFD for the 32 bit stuff on PowePC64(LIB32 compatibility and STAND/slof/loader.) - creates LD_BFD variable pointing to ld.bfd - use LD_BFD as linker for LIB32/compat - Default behavior for other platforms aren't changed. [1] https://wiki.freebsd.org/powerpc/llvm-elfv2 Submitted by: alfredo.junior_eldorado.org.br Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20261 Notes: svn path=/head/; revision=356054
* Add flua to the base system, install to /usr/libexecKyle Evans2019-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever extensions we need for base system operations. We currently support a subset of lfs and lposix that are used in the rewrite of makesyscall.sh into lua, added in r354786. flua is intentionally written such that one can install standard lua and some set of lua modules from ports and achieve the same effect. linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added in. This is similar to what we do in stand/. linit.c has been renamed to make it clear that this has flua-specific bits. luaconf has been slightly obfuscated to make extensions more difficult. Part of the problem is that flua is already hard enough to use as a bootstrap tool because it's not in PATH- attempting to do extension loading would require a special bootstrap version of flua with paths changed to protect the innocent. src.lua.mk has been added to make it easy for in-tree stuff to find flua, whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1. Reviewed by: brooks, emaste (both earlier version), imp Differential Revision: https://reviews.freebsd.org/D21893 Notes: svn path=/head/; revision=354833
* stand: consolidate knowledge of lua pathKyle Evans2019-11-021-0/+3
| | | | | | | | | | | | | Multiple places coordinate to 'know' where lua scripts are installed. Knock this down to being formally defined (and overridable) in exactly one spot, defs.mk, and spread the knowledge to loaders and liblua alike. A future commit will expose this to lua as loader.lua_path, so it can build absolute paths to lua scripts as needed. MFC after: 1 week Notes: svn path=/head/; revision=354245
* Add support for hypervisor check on x86Simon J. Gerraty2019-10-241-8/+12
| | | | | | | | | | | | | | Add ficl words for isvirtualized and move ficl inb and outb words to ficl/x86/sysdep.c so can be shared by i386 and amd64 Reviewed by: imp bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22069 Notes: svn path=/head/; revision=354043
* loader: --gc-sections needs sections to work withToomas Soome2019-09-081-0/+1
| | | | | | | | | | --gc-sections is not really useful unless we generate sections with -ffunction-sections -fdata-sections While there, i386/loader would win from --gc-sections too. Notes: svn path=/head/; revision=352032
* loader: use teken teminal emulator for x86 and uefiToomas Soome2019-09-051-0/+7
| | | | | | | | | | | Replace mini cons25 emulator with teken, this does enable us proper console terminal for loader and will make it possible to implement different back end callbacks to draw to screen. At this time we still only "draw" in text mode. Notes: svn path=/head/; revision=351900
* stand: push LIBC_SRC up into defs.mkKyle Evans2019-08-161-0/+1
| | | | | | | | | | | | | | Other parts of stand/ that don't use libsa will need to grab bits from libc shortly. Push LIBC_SRC up to defs.mk in advance of this so that they can use it, and rename it to LIBCSRC to match the convention of the rest of the *SRC variables in this file. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21282 Notes: svn path=/head/; revision=351119
* Move inclusion of src.opts.mk later.Warner Losh2018-12-031-4/+8
| | | | | | | | | | | | | | | src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD depending on the MK_CTF value. We then set MK_CTF to no, which has no real effect. The solution is to set all the MK_foo values before including src.opts.mk. This should stop the cdboot binary from exploding in size for releases built WITH_CTF=yes in src.conf. Sponsored by: Netflix Notes: svn path=/head/; revision=341433
* powerpcspe: Don't crash the loader on ubldr with SPE instructions.Justin Hibbits2018-11-281-0/+5
| | | | | | | | | -msoft-float seems to be insufficient for disabling the SPE on powerpcspe. Force it off with -mno-spe as well. This prevents a crash in ubldr on powerpcspe. Notes: svn path=/head/; revision=341101
* Be a little conservative about when to force size optimizations.Warner Losh2018-09-051-0/+2
| | | | | | | | | | | | Reports have come in that there's issue with powerpc and sparc64 since we've switched to using -Oz / -Os. We don't strictly need them for !x86, so be conservative about when we enable them. Approved by: re@ (gjb) Differential Revision: https://reviews.freebsd.org/D17016 Notes: svn path=/head/; revision=338474
* Enable 'C'-compressed ISA extension.Ruslan Bukin2018-09-031-1/+1
| | | | | | | | | | | | | | | This was disabled recently due to lack of support in KDB disassembler and DTrace FBT provider. Support for 'C'-extension to both of these was added, so we can now enable 'C'-extension. This reduces size of the kernel important for low-end embedded devices, and saves cache footprint for high perfomance machines. Approved by: re (kib) Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=338445
* stand: Flip the default interpreter to LuaKyle Evans2018-08-191-3/+3
| | | | | | | | | | | | | | After years in the making, lualoader is ready to make its debut. Both flavors of loader are still built by default, and may be installed as /boot/loader or /boot/loader.efi as appropriate either by manually creating hard links or using LOADER_DEFAULT_INTERP as documented in build(7). Discussed with: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16795 Notes: svn path=/head/; revision=338050
* stand: Use -Oz/-Os for all loader/stand builds.Warner Losh2018-08-151-1/+6
| | | | | | | | | | | | | | | | | | | | While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader. Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080 Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) Differential Revision: https://reviews.freebsd.org/D16724 Notes: svn path=/head/; revision=337868
* Create a loader for each interpreter for x86 BIOS and all EFIWarner Losh2018-08-141-0/+12
| | | | | | | | | | | | | | | | | | Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks. RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D16705 Notes: svn path=/head/; revision=337806
* Disable 'C'-compressed ISA extension.Ruslan Bukin2018-07-251-1/+1
| | | | | | | | | | | | | | | | It works excellent, but KDB disassembler and DTrace FBT provider for RISC-V do lack support for it. They currently handle 4-byte instructions only, while C-compressed ISA extension introduces 2-byte instructions freely mixing them together. So disable it for now. Reviewed by: markj@ Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16436 Notes: svn path=/head/; revision=336716
* Extend loader(8) geli support to all architectures and all disk-like devices.Ian Lepore2018-07-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This moves the bulk of the geli support from lib386/biosdisk.c into a new geli/gelidev.c which implements a devsw-type device whose dv_strategy() function handles geli decryption. Support for all arches comes from moving the taste-and-attach code to the devopen() function in libsa. After opening any DEVT_DISK device, devopen() calls the new function geli_probe_and_attach(), which will "attach" the geli code to the open_file struct by creating a geli_devdesc instance to replace the disk_devdesc instance in the open_file. That routes all IO for the device through the geli code. A new public geli_add_key() function is added, to allow arch/vendor-specific code to add keys obtained from custom hardware or other sources. With these changes, geli support will be compiled into all variations of loader(8) on all arches because the default is WITH_LOADER_GELI. Relnotes: yes Sponsored by: Microchip Technology Inc Differential Revision: https://reviews.freebsd.org/D15743 Notes: svn path=/head/; revision=336252
* Move ZFS files into libsaWarner Losh2018-07-081-1/+1
| | | | | | | | | | | | | Move the libzfs stuff into libsa. There's no need for it to be a separate library. The separate library adds to the issues of build ordering that we see from time to time. Move the filesystem support into libsa, like all the other filesystem support rather than making zfs the odd-duck out. Discussed with: allanjude@ Notes: svn path=/head/; revision=336084
* stand: move libgeliboot into libsa.Warner Losh2018-06-181-2/+1
| | | | | | | | | Reduce by 1 the number of crazy libraries we need in stand by moving geli into libsa (where architecturally it belonged all along). This just moves things around without any code changes. Notes: svn path=/head/; revision=335321
* Fix build of stand with base gccDimitry Andric2018-05-311-1/+1
| | | | | | | | | | | | | | | | | | | * Make autoboot() a static function in stand/common/boot.c, so it does not shadow local variables in gptboot.c and zfsboot.c. * Remove -Winline from the Makefiles for gptboot, gptzfsboot and zfsboot, as gcc will always fail to inline some functions, and there is nothing we can do about it. * For gcc <= 4.2.1, silence -Wuninitialized for isoboot, as it produces a false positive warning. * Remove deprecated and unnecessary -mcpu=i386 flag from stand/defs.mk, as there is already a -march=i386 flag further in the file. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15628 Notes: svn path=/head/; revision=334432
* Don't add links or cleanfiles for NO_OBJ case, in addition to notWarner Losh2018-03-181-5/+5
| | | | | | | | | | creating them. Move them under the if after the all: target. They are just defines, so it doesn't really matter where we have them. MFC After: 3 days Notes: svn path=/head/; revision=331140
* Add NO_OBJ to those directories that don't make anything.Warner Losh2018-02-261-1/+2
| | | | | | | | | | | For directories that don't many anything, add NO_OBJ=t just before we include bsd.init.mk. This prevents them from creating an OBJ directory. In addition, prevent defs.mk from creating the machine related links in these cases. They aren't needed and break, at least on stable, the read-only src tree build. Notes: svn path=/head/; revision=330004
* Floaty McFloatface is funnier...Warner Losh2018-02-231-1/+1
| | | | | | | Submitted by: emaste@ Notes: svn path=/head/; revision=329860
* Do not include float interfaces when using libsa.Warner Losh2018-02-231-0/+3
| | | | | | | | | | We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. Notes: svn path=/head/; revision=329859
* Eliminate bsd.stand.mk and -fPIC 32-bit intel buildsWarner Losh2018-02-161-3/+12
| | | | | | | | | | | | | OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC for the toolchain to be added (bogusly) when building on amd64. Pull all relevant defs back into defs.mk and delete bsd.stand.mk. This saves about 15-20k on i386 loader and zfsloader which when combined with Lua give us a lot more stack space in those constrained environments. Notes: svn path=/head/; revision=329345
* Add Lua as a scripting langauge to /boot/loaderWarner Losh2018-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | liblua glues the lua run time into the boot loader. It implements all the runtime routines that lua expects. In addition, it has a few standard 'C' headers that nueter various aspects of the LUA build that are too specific to lua to be in libsa. Many refinements from the original code to improve implementation and the number of included lua libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default module path. Numerous cleanups from the original GSoC project, including hacking libsa to allow lua to be built with only one change outside luaconf.h. Add the final bit of lua glue to bring in liblua and plug into the multiple interpreter framework, previously committed. Add LOADER_LUA option, currently off by default. Presently, this is an experimental option. One must opt-in to using this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been lightly tested, so keep a backup copy of your old loader handy. The menu code, coming in the next commit, hasn't been exhaustively tested. A LUA boot loader is 60k larger than a FORTH one, which is 80k larger than a no-interpreter one. Subtle changes in size may tip things past some subtle limit (the binary is ~430k now when built with LUA). A future version may offer coexistance. Bump FreeBSD version to 1200058 to mark the milestone. Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur, Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh reworked it extensively into its current form. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Relnotes: Yes MFC After: 1 month Differential Review: https://reviews.freebsd.org/D14295 Notes: svn path=/head/; revision=329166
* Fix build of userboot.soWarner Losh2018-02-081-1/+3
| | | | | | | | | | Since it's not possible to unset a variable easily, create a new variable 'PIC' to signal that we are creating a shared object that we want to install. defs.mk refains from defining NO_PIC and ITNERALLIB when PIC is defined. This unbreaks userboot.so building. Notes: svn path=/head/; revision=329050
* Centralize several variables.Warner Losh2018-02-021-0/+7
| | | | | | | | | | MK_CTF, MK_SSP, MK_PROFILE, NO_PIC, and INTERNALLIB are always the same, so set them in defs.mk. MAN= is common, so set it here too. This removes a lot of boring repetition from the Makefiles that added almost no value. Notes: svn path=/head/; revision=328769
* Fix ubldr. uboot/lib uses defines for the loader. It's part of theWarner Losh2017-12-291-0/+7
| | | | | | | | | | | loader, but not compile as loader (it's building a library), so we can't just include loader.mk for the defines. Move LOADER_DISK_SUPPORT back to defs.mk for the moment. Sponsored by: Netflix Notes: svn path=/head/; revision=327351
* libficl is only ever used in a loader (never a boot) program. Move itWarner Losh2017-12-181-9/+0
| | | | | | | | | to loader.mk. Sponsored by: Netflix Notes: svn path=/head/; revision=326927
* Move loader help file definitions to being 100% inside of loader.mk.Warner Losh2017-12-181-4/+0
| | | | | | | | | | | | HELP_FILES is a loader only thing, so move it to loader.mk. Only generate the help file if HELP_FILES is defined. Adjust Makefiles to new convention. Fix a few cases where ${.CURDIR}/ was missing resulting in missing bits from the help files. Sponsored by: Netflix Notes: svn path=/head/; revision=326926
* Move loader-only defines to loader.mk from defs.mkWarner Losh2017-12-161-49/+2
| | | | | | | | | Produces the same .o's, verified with md5. Sponsored by: Netflix Notes: svn path=/head/; revision=326914
* Fix a comment to be more accurateWarner Losh2017-12-111-1/+1
| | | | Notes: svn path=/head/; revision=326768
* Stop building with the standard system headers.Warner Losh2017-12-051-0/+6
| | | | | | | | | | | | | | | Building with the standard system headers isn't a perfect match to the stand environment. Instead, copy over the files we know are safe to use and constrain what else is used. We use -nostdinc to achieve this. This also fixes issues with building 32-bit libraries on amd64 sometimes pulling in the wrong cpufunc.h giving an error now that we stop on errors. It will also enable an easier transition to lua boot. Sponsored by: Netflix Notes: svn path=/head/; revision=326593
* Now it's safe to bump WARNS to 1.Warner Losh2017-12-031-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326495
* Fix all warnings related to geli and ZFS support on x86.Warner Losh2017-12-021-0/+2
| | | | | | | | | | | Default WARNS to 0 still, since there's still some warnings on other architectures. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13301 Notes: svn path=/head/; revision=326448
* Cleanup CFALGS usage hereWarner Losh2017-12-021-1/+1
| | | | | | | | | | | Only define the CFLAGS we need. SSP_CFLAGS is now defined globally, no need to define it here. Define -D_STANDALONE globally for src/stand builds. Sponsored by: Netflix Notes: svn path=/head/; revision=326442
* Minor flags cleanupWarner Losh2017-12-021-1/+46
| | | | | | | | | | | | Move kernel includes and libsa includes together at the top of defs.mk Move all machine specific defines from Makefile.inc to their friends in defs.mk. Add comments and remove now useless junk after the move. Sponsored by: Netflix Notes: svn path=/head/; revision=326441
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-141-0/+171
Sponsored by: Netflix Notes: svn path=/head/; revision=325834