diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index 5f1aad2298c0..d89a917bd96f 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -1,1455 +1,1469 @@ .\" Copyright (c) 1999 Jeroen Ruigrok van der Werven .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 24, 2025 +.Dd May 26, 2025 .Dt ELF 5 .Os .Sh NAME .Nm elf .Nd format of ELF executable binary files .Sh SYNOPSIS .In elf.h .Sh DESCRIPTION The header file .In elf.h defines the format of ELF executable binary files. Amongst these files are normal executable files, relocatable object files, core files and shared libraries. .Pp An executable file using the ELF file format consists of an ELF header, followed by a program header table or a section header table, or both. The ELF header is always at offset zero of the file. The program header table and the section header table's offset in the file are defined in the ELF header. The two tables describe the rest of the particularities of the file. .Pp Applications which wish to process ELF binary files for their native architecture only should include .In elf.h in their source code. These applications should need to refer to all the types and structures by their generic names .Dq Elf_xxx and to the macros by .Dq ELF_xxx . Applications written this way can be compiled on any architecture, regardless whether the host is 32-bit or 64-bit. .Pp Should an application need to process ELF files of an unknown architecture then the application needs to include both .In sys/elf32.h and .In sys/elf64.h instead of .In elf.h . Furthermore, all types and structures need to be identified by either .Dq Elf32_xxx or .Dq Elf64_xxx . The macros need to be identified by .Dq ELF32_xxx or .Dq ELF64_xxx . .Pp Whatever the system's architecture is, it will always include .In sys/elf_common.h as well as .In sys/elf_generic.h . .Pp These header files describe the above mentioned headers as C structures and also include structures for dynamic sections, relocation sections and symbol tables. .Pp The following types are being used for 32-bit architectures: .Bd -literal -offset indent Elf32_Addr Unsigned 32-bit program address Elf32_Half Unsigned 16-bit field Elf32_Lword Unsigned 64-bit field Elf32_Off Unsigned 32-bit file offset Elf32_Sword Signed 32-bit field or integer Elf32_Word Unsigned 32-bit field or integer .Ed .Pp For 64-bit architectures we have the following types: .Bd -literal -offset indent Elf64_Addr Unsigned 64-bit program address Elf64_Half Unsigned 16-bit field Elf64_Lword Unsigned 64-bit field Elf64_Off Unsigned 64-bit file offset Elf64_Sword Signed 32-bit field Elf64_Sxword Signed 64-bit field or integer Elf64_Word Unsigned 32-bit field Elf64_Xword Unsigned 64-bit field or integer .Ed .Pp All data structures that the file format defines follow the .Dq natural size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, etc. .Pp The ELF header is described by the type Elf32_Ehdr or Elf64_Ehdr: .Bd -literal -offset indent typedef struct { unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; Elf32_Off e_phoff; Elf32_Off e_shoff; Elf32_Word e_flags; Elf32_Half e_ehsize; Elf32_Half e_phentsize; Elf32_Half e_phnum; Elf32_Half e_shentsize; Elf32_Half e_shnum; Elf32_Half e_shstrndx; } Elf32_Ehdr; .Ed .Bd -literal -offset indent typedef struct { unsigned char e_ident[EI_NIDENT]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; Elf64_Off e_phoff; Elf64_Off e_shoff; Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } Elf64_Ehdr; .Ed .Pp The fields have the following meanings: .Pp .Bl -tag -width "e_phentsize" -compact -offset indent .It Dv e_ident This array of bytes specifies to interpret the file, independent of the processor or the file's remaining contents. Within this array everything is named by macros, which start with the prefix .Sy EI_ and may contain values which start with the prefix .Sy ELF . The following macros are defined: .Pp .Bl -tag -width "EI_ABIVERSION" -compact .It Dv EI_MAG0 The first byte of the magic number. It must be filled with .Sy ELFMAG0 . .It Dv EI_MAG1 The second byte of the magic number. It must be filled with .Sy ELFMAG1 . .It Dv EI_MAG2 The third byte of the magic number. It must be filled with .Sy ELFMAG2 . .It Dv EI_MAG3 The fourth byte of the magic number. It must be filled with .Sy ELFMAG3 . .It Dv EI_CLASS The fifth byte identifies the architecture for this binary: .Pp .Bl -tag -width "ELFCLASSNONE" -compact .It Dv ELFCLASSNONE This class is invalid. .It Dv ELFCLASS32 This defines the 32-bit architecture. It supports machines with files and virtual address spaces up to 4 Gigabytes. .It Dv ELFCLASS64 This defines the 64-bit architecture. .El .It Dv EI_DATA The sixth byte specifies the data encoding of the processor-specific data in the file. Currently these encodings are supported: .Pp .Bl -tag -width "ELFDATA2LSB" -compact .It Dv ELFDATANONE Unknown data format. .It Dv ELFDATA2LSB Two's complement, little-endian. .It Dv ELFDATA2MSB Two's complement, big-endian. .El .It Dv EI_VERSION The version number of the ELF specification: .Pp .Bl -tag -width "EV_CURRENT" -compact .It Dv EV_NONE Invalid version. .It Dv EV_CURRENT Current version. .El .It Dv EI_OSABI This byte identifies the operating system and ABI to which the object is targeted. Some fields in other ELF structures have flags and values that have platform specific meanings; the interpretation of those fields is determined by the value of this byte. The following values are currently defined: .Pp .Bl -tag -width "ELFOSABI_STANDALONE" -compact .It Dv ELFOSABI_SYSV UNIX System V ABI. .It Dv ELFOSABI_HPUX HP-UX operating system ABI. .It Dv ELFOSABI_NETBSD .Nx operating system ABI. .It Dv ELFOSABI_LINUX GNU/Linux operating system ABI. .It Dv ELFOSABI_HURD GNU/Hurd operating system ABI. .It Dv ELFOSABI_86OPEN 86Open Common IA32 ABI. .It Dv ELFOSABI_SOLARIS Solaris operating system ABI. .It Dv ELFOSABI_MONTEREY Monterey project ABI. .It Dv ELFOSABI_IRIX IRIX operating system ABI. .It Dv ELFOSABI_FREEBSD .Fx operating system ABI. .It Dv ELFOSABI_TRU64 TRU64 UNIX operating system ABI. .It Dv ELFOSABI_ARM ARM architecture ABI. .It Dv ELFOSABI_STANDALONE Standalone (embedded) ABI. .El .It Dv EI_ABIVERSION This byte identifies the version of the ABI to which the object is targeted. This field is used to distinguish among incompatible versions of an ABI. The interpretation of this version number is dependent on the ABI identified by the EI_OSABI field. Applications conforming to this specification use the value 0. .It Dv EI_PAD Start of padding. These bytes are reserved and set to zero. Programs which read them should ignore them. The value for EI_PAD will change in the future if currently unused bytes are given meanings. .It Dv EI_BRAND Start of architecture identification. .It Dv EI_NIDENT The size of the e_ident array. .El .Pp .It Dv e_type This member of the structure identifies the object file type: .Pp .Bl -tag -width "ET_NONE" -compact .It Dv ET_NONE An unknown type. .It Dv ET_REL A relocatable file. .It Dv ET_EXEC An executable file. .It Dv ET_DYN A shared object. .It Dv ET_CORE A core file. .El .Pp .It Dv e_machine This member specifies the required architecture for an individual file: .Pp .Bl -tag -width "EM_MIPS_RS4_BE" -compact .It Dv EM_NONE An unknown machine. .It Dv EM_M32 AT&T WE 32100. .It Dv EM_SPARC Sun Microsystems SPARC. .It Dv EM_386 Intel 80386. .It Dv EM_68K Motorola 68000. .It Dv EM_88K Motorola 88000. .It Dv EM_486 Intel 80486. .It Dv EM_860 Intel 80860. .It Dv EM_MIPS MIPS RS3000 (big-endian only). .It Dv EM_MIPS_RS4_BE MIPS RS4000 (big-endian only). .It Dv EM_SPARC64 SPARC v9 64-bit unofficial. .It Dv EM_PARISC HPPA. .It Dv EM_PPC PowerPC. .It Dv EM_ALPHA Compaq [DEC] Alpha. .El .Pp .It Dv e_version This member identifies the file version: .Pp .Bl -tag -width "EV_CURRENT" -compact .It Dv EV_NONE Invalid version .It Dv EV_CURRENT Current version .El .It Dv e_entry This member gives the virtual address to which the system first transfers control, thus starting the process. If the file has no associated entry point, this member holds zero. .It Dv e_phoff This member holds the program header table's file offset in bytes. If the file has no program header table, this member holds zero. .It Dv e_shoff This member holds the section header table's file offset in bytes. If the file has no section header table this member holds zero. .It Dv e_flags This member holds processor-specific flags associated with the file. Flag names take the form EF_`machine_flag'. Currently no flags have been defined. .It Dv e_ehsize This member holds the ELF header's size in bytes. .It Dv e_phentsize This member holds the size in bytes of one entry in the file's program header table; all entries are the same size. .It Dv e_phnum This member holds the number of entries in the program header table. If the file is using extended program header numbering, then the .Sy e_phnum member will contain the value .Dv PN_XNUM and the actual number of program header table entries will be stored in the .Sy sh_info member of the section header at index .Dv SHN_UNDEF . The product of .Sy e_phentsize and the number of program header table entries gives the program header table's size in bytes. If a file has no program header, .Sy e_phnum holds the value zero. .It Dv e_shentsize This member holds a sections header's size in bytes. A section header is one entry in the section header table; all entries are the same size. .It Dv e_shnum This member holds the number of entries in the section header table. If the file is using extended section numbering, then the .Sy e_shnum member will be zero and the actual section number will be stored in the .Sy sh_size member of the section header at index .Dv SHN_UNDEF . If a file has no section header table, both the .Sy e_shnum and the .Sy e_shoff fields of the ELF header will be zero. The product of .Sy e_shentsize and the number of sections in the file gives the section header table's size in bytes. .It Dv e_shstrndx This member holds the section header table index of the entry associated with the section name string table. If extended section numbering is being used, this field will hold the value .Sy SHN_XINDEX , and the actual section header table index will be present in the .Sy sh_link field of the section header entry at index .Dv SHN_UNDEF . If the file has no section name string table, this member holds the value .Sy SHN_UNDEF . .El .Pp An executable or shared object file's program header table is an array of structures, each describing a segment or other information the system needs to prepare the program for execution. An object file .Em segment contains one or more .Em sections . Program headers are meaningful only for executable and shared object files. A file specifies its own program header size with the ELF header's .Sy e_phentsize and .Sy e_phnum members. As with the Elf executable header, the program header also has different versions depending on the architecture: .Bd -literal -offset indent typedef struct { Elf32_Word p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; Elf32_Word p_filesz; Elf32_Word p_memsz; Elf32_Word p_flags; Elf32_Word p_align; } Elf32_Phdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word p_type; Elf64_Word p_flags; Elf64_Off p_offset; Elf64_Addr p_vaddr; Elf64_Addr p_paddr; Elf64_Xword p_filesz; Elf64_Xword p_memsz; Elf64_Xword p_align; } Elf64_Phdr; .Ed .Pp The main difference between the 32-bit and the 64-bit program header lies only in the location of a .Sy p_flags member in the total struct. .Pp .Bl -tag -width "p_offset" -compact -offset indent .It Dv p_type This member of the Phdr struct tells what kind of segment this array element describes or how to interpret the array element's information. .Pp .Bl -tag -width "PT_DYNAMIC" -compact .It Dv PT_NULL The array element is unused and the other members' values are undefined. This lets the program header have ignored entries. .It Dv PT_LOAD The array element specifies a loadable segment, described by .Sy p_filesz and .Sy p_memsz . The bytes from the file are mapped to the beginning of the memory segment. If the segment's memory size .Pq Sy p_memsz is larger than the file size .Pq Sy p_filesz , the .Dq extra bytes are defined to hold the value 0 and to follow the segment's initialized area. The file size may not be larger than the memory size. Loadable segment entries in the program header table appear in ascending order, sorted on the .Sy p_vaddr member. .It Dv PT_DYNAMIC The array element specifies dynamic linking information. .It Dv PT_INTERP The array element specifies the location and size of a null-terminated path name to invoke as an interpreter. This segment type is meaningful only for executable files (though it may occur for shared objects). However it may not occur more than once in a file. If it is present it must precede any loadable segment entry. .It Dv PT_NOTE The array element specifies the location and size for auxiliary information. .It Dv PT_SHLIB This segment type is reserved but has unspecified semantics. Programs that contain an array element of this type do not conform to the ABI. .It Dv PT_PHDR The array element, if present, specifies the location and size of the program header table itself, both in the file and in the memory image of the program. This segment type may not occur more than once in a file. Moreover, it may only occur if the program header table is part of the memory image of the program. If it is present it must precede any loadable segment entry. .It Dv PT_LOPROC This value up to and including .Sy PT_HIPROC are reserved for processor-specific semantics. .It Dv PT_HIPROC This value down to and including .Sy PT_LOPROC are reserved for processor-specific semantics. .El .Pp .It Dv p_offset This member holds the offset from the beginning of the file at which the first byte of the segment resides. .It Dv p_vaddr This member holds the virtual address at which the first byte of the segment resides in memory. .It Dv p_paddr On systems for which physical addressing is relevant, this member is reserved for the segment's physical address. Under .Bx this member is not used and must be zero. .It Dv p_filesz This member holds the number of bytes in the file image of the segment. It may be zero. .It Dv p_memsz This member holds the number of bytes in the memory image of the segment. It may be zero. .It Dv p_flags This member holds flags relevant to the segment: .Pp .Bl -tag -width "PF_X" -compact .It Dv PF_X An executable segment. .It Dv PF_W A writable segment. .It Dv PF_R A readable segment. .El .Pp A text segment commonly has the flags .Sy PF_X and .Sy PF_R . A data segment commonly has .Sy PF_X , .Sy PF_W and .Sy PF_R . .It Dv p_align This member holds the value to which the segments are aligned in memory and in the file. Loadable process segments must have congruent values for .Sy p_vaddr and .Sy p_offset , modulo the page size. Values of zero and one mean no alignment is required. Otherwise, .Sy p_align should be a positive, integral power of two, and .Sy p_vaddr should equal .Sy p_offset , modulo .Sy p_align . .El .Pp An file's section header table lets one locate all the file's sections. The section header table is an array of Elf32_Shdr or Elf64_Shdr structures. The ELF header's .Sy e_shoff member gives the byte offset from the beginning of the file to the section header table. .Sy e_shnum holds the number of entries the section header table contains. .Sy e_shentsize holds the size in bytes of each entry. .Pp A section header table index is a subscript into this array. Some section header table indices are reserved. An object file does not have sections for these special indices: .Pp .Bl -tag -width "SHN_LORESERVE" -compact .It Dv SHN_UNDEF This value marks an undefined, missing, irrelevant, or otherwise meaningless section reference. For example, a symbol .Dq defined relative to section number .Sy SHN_UNDEF is an undefined symbol. .It Dv SHN_LORESERVE This value specifies the lower bound of the range of reserved indices. .It Dv SHN_LOPROC This value up to and including .Sy SHN_HIPROC are reserved for processor-specific semantics. .It Dv SHN_HIPROC This value down to and including .Sy SHN_LOPROC are reserved for processor-specific semantics. .It Dv SHN_ABS This value specifies absolute values for the corresponding reference. For example, symbols defined relative to section number .Sy SHN_ABS have absolute values and are not affected by relocation. .It Dv SHN_COMMON Symbols defined relative to this section are common symbols, such as FORTRAN COMMON or unallocated C external variables. .It Dv SHN_HIRESERVE This value specifies the upper bound of the range of reserved indices. The system reserves indices between .Sy SHN_LORESERVE and .Sy SHN_HIRESERVE , inclusive. The section header table does not contain entries for the reserved indices. .El .Pp The section header has the following structure: .Bd -literal -offset indent typedef struct { Elf32_Word sh_name; Elf32_Word sh_type; Elf32_Word sh_flags; Elf32_Addr sh_addr; Elf32_Off sh_offset; Elf32_Word sh_size; Elf32_Word sh_link; Elf32_Word sh_info; Elf32_Word sh_addralign; Elf32_Word sh_entsize; } Elf32_Shdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word sh_name; Elf64_Word sh_type; Elf64_Xword sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; Elf64_Xword sh_size; Elf64_Word sh_link; Elf64_Word sh_info; Elf64_Xword sh_addralign; Elf64_Xword sh_entsize; } Elf64_Shdr; .Ed .Pp .Bl -tag -width "sh_addralign" -compact .It Dv sh_name This member specifies the name of the section. Its value is an index into the section header string table section, giving the location of a null-terminated string. .It Dv sh_type This member categorizes the section's contents and semantics. .Pp .Bl -tag -width "SHT_PROGBITS" -compact .It Dv SHT_NULL This value marks the section header as inactive. It does not have an associated section. Other members of the section header have undefined values. .It Dv SHT_PROGBITS The section holds information defined by the program, whose format and meaning are determined solely by the program. .It Dv SHT_SYMTAB This section holds a symbol table. Typically, .Sy SHT_SYMTAB provides symbols for link editing, though it may also be used for dynamic linking. As a complete symbol table, it may contain many symbols unnecessary for dynamic linking. An object file can also contain a .Sy SHN_DYNSYM section. .It Dv SHT_STRTAB This section holds a string table. An object file may have multiple string table sections. .It Dv SHT_RELA This section holds relocation entries with explicit addends, such as type .Sy Elf32_Rela for the 32-bit class of object files. An object may have multiple relocation sections. .It Dv SHT_HASH This section holds a symbol hash table. All object participating in dynamic linking must contain a symbol hash table. An object file may have only one hash table. .It Dv SHT_DYNAMIC This section holds information for dynamic linking. An object file may have only one dynamic section. .It Dv SHT_NOTE This section holds information that marks the file in some way. .It Dv SHT_NOBITS A section of this type occupies no space in the file but otherwise resembles .Sy SHN_PROGBITS . Although this section contains no bytes, the .Sy sh_offset member contains the conceptual file offset. .It Dv SHT_REL This section holds relocation offsets without explicit addends, such as type .Sy Elf32_Rel for the 32-bit class of object files. An object file may have multiple relocation sections. .It Dv SHT_SHLIB This section is reserved but has unspecified semantics. .It Dv SHT_DYNSYM This section holds a minimal set of dynamic linking symbols. An object file can also contain a .Sy SHN_SYMTAB section. .It Dv SHT_LOPROC This value up to and including .Sy SHT_HIPROC are reserved for processor-specific semantics. .It Dv SHT_HIPROC This value down to and including .Sy SHT_LOPROC are reserved for processor-specific semantics. .It Dv SHT_LOUSER This value specifies the lower bound of the range of indices reserved for application programs. .It Dv SHT_HIUSER This value specifies the upper bound of the range of indices reserved for application programs. Section types between .Sy SHT_LOUSER and .Sy SHT_HIUSER may be used by the application, without conflicting with current or future system-defined section types. .El .Pp .It Dv sh_flags Sections support one-bit flags that describe miscellaneous attributes. If a flag bit is set in .Sy sh_flags , the attribute is .Dq on for the section. Otherwise, the attribute is .Dq off or does not apply. Undefined attributes are set to zero. .Pp .Bl -tag -width "SHF_EXECINSTR" -compact .It Dv SHF_WRITE This section contains data that should be writable during process execution. .It Dv SHF_ALLOC The section occupies memory during process execution. Some control sections do not reside in the memory image of an object file. This attribute is off for those sections. .It Dv SHF_EXECINSTR The section contains executable machine instructions. .It Dv SHF_MASKPROC All bits included in this mask are reserved for processor-specific semantics. .It Dv SHF_COMPRESSED The section data is compressed. .El .Pp .It Dv sh_addr If the section will appear in the memory image of a process, this member holds the address at which the section's first byte should reside. Otherwise, the member contains zero. .It Dv sh_offset This member's value holds the byte offset from the beginning of the file to the first byte in the section. One section type, .Sy SHT_NOBITS , occupies no space in the file, and its .Sy sh_offset member locates the conceptual placement in the file. .It Dv sh_size This member holds the section's size in bytes. Unless the section type is .Sy SHT_NOBITS , the section occupies .Sy sh_size bytes in the file. A section of type .Sy SHT_NOBITS may have a non-zero size, but it occupies no space in the file. .It Dv sh_link This member holds a section header table index link, whose interpretation depends on the section type. .It Dv sh_info This member holds extra information, whose interpretation depends on the section type. .It Dv sh_addralign Some sections have address alignment constraints. If a section holds a doubleword, the system must ensure doubleword alignment for the entire section. That is, the value of .Sy sh_addr must be congruent to zero, modulo the value of .Sy sh_addralign . Only zero and positive integral powers of two are allowed. Values of zero or one mean the section has no alignment constraints. .It Dv sh_entsize Some sections hold a table of fixed-sized entries, such as a symbol table. For such a section, this member gives the size in bytes for each entry. This member contains zero if the section does not hold a table of fixed-size entries. .El .Pp Various sections hold program and control information: .Bl -tag -width ".shstrtab" -compact .It .bss (Block Started by Symbol) This section holds uninitialized data that contributes to the program's memory image. By definition, the system initializes the data with zeros when the program begins to run. This section is of type .Sy SHT_NOBITS . The attributes types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .comment This section holds version control information. This section is of type .Sy SHT_PROGBITS . No attribute types are used. +.It .ctors +This legacy section holds pointers to initialization routines, +executed before calling the main program entry point. +This section is of type +.Sy SHT_PROGBITS . +The attributes used are +.Sy SHF_ALLOC . .It .data This section holds initialized data that contribute to the program's memory image. This section is of type .Sy SHT_PROGBITS . The attribute types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .data1 This section holds initialized data that contribute to the program's memory image. This section is of type .Sy SHT_PROGBITS . The attribute types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .debug This section holds information for symbolic debugging. The contents are unspecified. This section is of type .Sy SHT_PROGBITS . No attribute types are used. +.It .dtors +This legacy section holds pointers to finalization routines, +executed when the program exits normally. +This section is of type +.Sy SHT_PROGBITS . +The attributes used are +.Sy SHF_ALLOC . .It .dynamic This section holds dynamic linking information. The section's attributes will include the .Sy SHF_ALLOC bit. Whether the .Sy SHF_WRITE bit is set is processor-specific. This section is of type .Sy SHT_DYNAMIC . See the attributes above. .It .dynstr This section holds strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries. This section is of type .Sy SHT_STRTAB . The attribute type used is .Sy SHF_ALLOC . .It .dynsym This section holds the dynamic linking symbol table. This section is of type .Sy SHT_DYNSYM . The attribute used is .Sy SHF_ALLOC . .It .fini This legacy section holds executable instructions that contribute to the process termination code. When a program exits normally the system arranges to execute the code in this section. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .fini_array This section holds pointers to finalization routines. When a program exits normally .Xr rtld 1 executes the code referenced by this section. This section is of type .Sy SHT_FINI_ARRAY . The attributes used are .Sy SHF_ALLOC . Refer to .Dv NT_FREEBSD_NOINIT_TAG .Pq below for a description of how initialization and finalization code is invoked. .It .got This section holds the global offset table. This section is of type .Sy SHT_PROGBITS . The attributes are processor-specific. .It .hash This section holds a symbol hash table. This section is of type .Sy SHT_HASH . The attribute used is .Sy SHF_ALLOC . .It .init This legacy section holds executable instructions that contribute to the process initialization code. When a program starts to run the system arranges to execute the code in this section before calling the main program entry point. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .init_array This section holds pointers to initialization routines. When a program starts to run .Xr rtld 1 executes the code referenced by this section before calling the program entry point. This section is of type .Sy SHT_INIT_ARRAY . The attributes used are .Sy SHF_ALLOC . Refer to .Dv NT_FREEBSD_NOINIT_TAG .Pq below for a description of how initialization and finalization code is invoked. .It .interp This section holds the pathname of a program interpreter. If the file has a loadable segment that includes the section, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise, that bit will be off. This section is of type .Sy SHT_PROGBITS . .It .line This section holds line number information for symbolic debugging, which describes the correspondence between the program source and the machine code. The contents are unspecified. This section is of type .Sy SHT_PROGBITS . No attribute types are used. .It .note This section holds information in the .Dq Note Section format described below. This section is of type .Sy SHT_NOTE . No attribute types are used. .It .plt This section holds the procedure linkage table. This section is of type .Sy SHT_PROGBITS . The attributes are processor-specific. .It .relNAME This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. By convention, .Dq NAME is supplied by the section to which the relocations apply. Thus a relocation section for .Sy .text normally would have the name .Sy .rel.text . This section is of type .Sy SHT_REL . .It .relaNAME This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. By convention, .Dq NAME is supplied by the section to which the relocations apply. Thus a relocation section for .Sy .text normally would have the name .Sy .rela.text . This section is of type .Sy SHT_RELA . .It .rodata This section holds read-only data that typically contributes to a non-writable segment in the process image. This section is of type .Sy SHT_PROGBITS . The attribute used is .Sy SHF_ALLOC . .It .rodata1 This section holds read-only data that typically contributes to a non-writable segment in the process image. This section is of type .Sy SHT_PROGBITS . The attribute used is .Sy SHF_ALLOC . .It .shstrtab This section holds section names. This section is of type .Sy SHT_STRTAB . No attribute types are used. .It .strtab This section holds strings, most commonly the strings that represent the names associated with symbol table entries. If the file has a loadable segment that includes the symbol string table, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. This section is of type .Sy SHT_STRTAB . .It .symtab This section holds a symbol table. If the file has a loadable segment that includes the symbol table, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. This section is of type .Sy SHT_SYMTAB . .It .text This section holds the .Dq text , or executable instructions, of a program. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .jcr This section holds information about Java classes that must be registered. It is obsolete and binaries created for .Fx 15 or later do not process it. .It .eh_frame This section holds information used for C++ exception-handling. .El .Pp A section with the .Dv SHF_COMPRESSED flag set contains a compressed copy of the section data. Compressed section data begins with an .Vt Elf64_Chdr or .Vt Elf32_Chdr structure which encodes the compression algorithm and some characteristics of the uncompressed data. .Bd -literal -offset indent typedef struct { Elf32_Word ch_type; Elf32_Word ch_size; Elf32_Word ch_addralign; } Elf32_Chdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word ch_type; Elf64_Word ch_reserved; Elf64_Xword ch_size; Elf64_Xword ch_addralign; } Elf64_Chdr; .Ed .Pp .Bl -tag -width "ch_addralign" -compact .It Dv ch_type The compression algorithm used. A value of .Dv ELFCOMPRESS_ZLIB indicates that the data is compressed using .Xr zlib 3 . A value of .Dv ELFCOMPRESS_ZSTD indicates that the data is compressed using Zstandard. .It Dv ch_size The size, in bytes, of the uncompressed section data. This corresponds to the .Sy sh_size field of a section header containing uncompressed data. .It Dv ch_addralign The address alignment of the uncompressed section data. This corresponds to the .Sy sh_addralign field of a section header containing uncompressed data. .El .Pp String table sections hold null-terminated character sequences, commonly called strings. The object file uses these strings to represent symbol and section names. One references a string as an index into the string table section. The first byte, which is index zero, is defined to hold a null character. Similarly, a string table's last byte is defined to hold a null character, ensuring null termination for all strings. .Pp An object file's symbol table holds information needed to locate and relocate a program's symbolic definitions and references. A symbol table index is a subscript into this array. .Bd -literal -offset indent typedef struct { Elf32_Word st_name; Elf32_Addr st_value; Elf32_Word st_size; unsigned char st_info; unsigned char st_other; Elf32_Half st_shndx; } Elf32_Sym; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } Elf64_Sym; .Ed .Pp .Bl -tag -width "st_value" -compact .It Dv st_name This member holds an index into the object file's symbol string table, which holds character representations of the symbol names. If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table has no name. .It Dv st_value This member gives the value of the associated symbol. .It Dv st_size Many symbols have associated sizes. This member holds zero if the symbol has no size or an unknown size. .It Dv st_info This member specifies the symbol's type and binding attributes: .Pp .Bl -tag -width "STT_SECTION" -compact .It Dv STT_NOTYPE The symbol's type is not defined. .It Dv STT_OBJECT The symbol is associated with a data object. .It Dv STT_FUNC The symbol is associated with a function or other executable code. .It Dv STT_SECTION The symbol is associated with a section. Symbol table entries of this type exist primarily for relocation and normally have .Sy STB_LOCAL bindings. .It Dv STT_FILE By convention the symbol's name gives the name of the source file associated with the object file. A file symbol has .Sy STB_LOCAL bindings, its section index is .Sy SHN_ABS , and it precedes the other .Sy STB_LOCAL symbols of the file, if it is present. .It Dv STT_LOPROC This value up to and including .Sy STT_HIPROC are reserved for processor-specific semantics. .It Dv STT_HIPROC This value down to and including .Sy STT_LOPROC are reserved for processor-specific semantics. .El .Pp .Bl -tag -width "STB_GLOBAL" -compact .It Dv STB_LOCAL Local symbols are not visible outside the object file containing their definition. Local symbols of the same name may exist in multiple file without interfering with each other. .It Dv STB_GLOBAL Global symbols are visible to all object files being combined. One file's definition of a global symbol will satisfy another file's undefined reference to the same symbol. .It Dv STB_WEAK Weak symbols resemble global symbols, but their definitions have lower precedence. .It Dv STB_LOPROC This value up to and including .Sy STB_HIPROC are reserved for processor-specific semantics. .It Dv STB_HIPROC This value down to and including .Sy STB_LOPROC are reserved for processor-specific semantics. .Pp There are macros for packing and unpacking the binding and type fields: .Pp .Bl -tag -width "ELF32_ST_INFO(bind, type)" -compact .It Xo .Fn ELF32_ST_BIND info .Xc or .Fn ELF64_ST_BIND info extract a binding from an st_info value. .It Xo .Fn ELF64_ST_TYPE info .Xc or .Fn ELF32_ST_TYPE info extract a type from an st_info value. .It Xo .Fn ELF32_ST_INFO bind type .Xc or .Fn ELF64_ST_INFO bind type convert a binding and a type into an st_info value. .El .El .Pp .It Dv st_other This member currently holds zero and has no defined meaning. .It Dv st_shndx Every symbol table entry is .Dq defined in relation to some section. This member holds the relevant section header table index. .El .Pp Relocation is the process of connecting symbolic references with symbolic definitions. Relocatable files must have information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process' program image. Relocation entries are these data. .Pp Relocation structures that do not need an addend: .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; Elf32_Word r_info; } Elf32_Rel; .Ed .Bd -literal -offset indent typedef struct { Elf64_Addr r_offset; Elf64_Xword r_info; } Elf64_Rel; .Ed .Pp Relocation structures that need an addend: .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; Elf32_Word r_info; Elf32_Sword r_addend; } Elf32_Rela; .Ed .Bd -literal -offset indent typedef struct { Elf64_Addr r_offset; Elf64_Xword r_info; Elf64_Sxword r_addend; } Elf64_Rela; .Ed .Pp .Bl -tag -width "r_offset" -compact .It Dv r_offset This member gives the location at which to apply the relocation action. For a relocatable file, the value is the byte offset from the beginning of the section to the storage unit affected by the relocation. For an executable file or shared object, the value is the virtual address of the storage unit affected by the relocation. .It Dv r_info This member gives both the symbol table index with respect to which the relocation must be made and the type of relocation to apply. Relocation types are processor-specific. When the text refers to a relocation entry's relocation type or symbol table index, it means the result of applying .Sy ELF_[32|64]_R_TYPE or .Sy ELF[32|64]_R_SYM , respectively to the entry's .Sy r_info member. .It Dv r_addend This member specifies a constant addend used to compute the value to be stored into the relocatable field. .El .Ss Note Section ELF note sections consist of entries with the following format: .Bl -column -offset indent "namesz" "32 bits" "Null-terminated originator name" .Sy Field Ta Sy Size Ta Sy Description .It Va namesz Ta 32 bits Ta Size of "name" .It Va descsz Ta 32 bits Ta Size of "desc" .It Va type Ta 32 bits Ta OS-dependent note type .It Va name Ta Va namesz Ta Null-terminated originator name .It Va desc Ta Va descsz Ta OS-dependent note data .El .Pp The .Va name and .Va desc fields are padded to ensure 4-byte alignment. .Va namesz and .Va descsz specify the unpadded length. .Pp .Fx defines the following ELF note types .Po with corresponding interpretation of .Va desc Pc : .Bl -tag -width 4n .It Dv NT_FREEBSD_ABI_TAG Pq Value: 1 Indicates the OS ABI version in a form of a 32-bit integer containing expected ABI version .Po i.e., .Dv __FreeBSD_version Pc . .It Dv NT_FREEBSD_NOINIT_TAG Pq Value: 2 Indicates that the C startup does not call initialization routines, and thus .Xr rtld 1 must do so. .Va desc is ignored. .It Dv NT_FREEBSD_ARCH_TAG Pq Value: 3 Contains the MACHINE_ARCH that the executable was built for. .It Dv NT_FREEBSD_FEATURE_CTL Pq Value: 4 Contains a bitmask of mitigations and features to enable: .Bl -tag -width 4n .It NT_FREEBSD_FCTL_ASLR_DISABLE Pq Value: 0x01 Request that address randomization (ASLR) not be performed. See .Xr security 7 . .It NT_FREEBSD_FCTL_PROTMAX_DISABLE Pq Value: 0x02 Request that .Xr mmap 2 calls not set PROT_MAX to the initial value of the .Fa prot argument. .It NT_FREEBSD_FCTL_STKGAP_DISABLE Pq Value: 0x04 Disable stack gap. .It NT_FREEBSD_FCTL_WXNEEDED Pq Value: 0x08 Indicate that the binary requires mappings that are simultaneously writeable and executable. .It NT_FREEBSD_FCTL_LA48 Pq Value: 0x10 Request 48-bit linear address space on amd64. .It NT_FREEBSD_FCTL_LA57 Pq Value: 0x40 Accept 57-bit linear address space on amd64. .El .El .Sh SEE ALSO .Xr as 1 , .Xr gdb 1 Pq Pa ports/devel/gdb , .Xr ld 1 , .Xr objdump 1 , .Xr readelf 1 , .Xr execve 2 , .Xr zlib 3 , .Xr ar 5 , .Xr core 5 .Rs .%A Hewlett Packard .%B Elf-64 Object File Format .Re .Rs .%A Santa Cruz Operation .%B System V Application Binary Interface .Re .Rs .%A Unix System Laboratories .%T Object Files .%B "Executable and Linking Format (ELF)" .Re .Sh HISTORY The ELF header files made their appearance in .Fx 2.2.6 . ELF in itself first appeared in .At V . The ELF format is an adopted standard. .Sh AUTHORS This manual page was written by .An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org with inspiration from BSDi's .Bsx .Nm manpage. diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ba88b995e51d..d52f0a170203 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,1963 +1,1963 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd May 9, 2025 +.Dd May 26, 2025 .Dt SRC.CONF 5 .Os .Sh NAME .Nm src.conf .Nd "source build options" .Sh DESCRIPTION The .Nm file contains variables that control what components will be generated during the build process of the .Fx source tree; see .Xr build 7 . .Pp The .Nm file uses the standard makefile syntax. However, .Nm should not specify any dependencies to .Xr make 1 . Instead, .Nm is to set .Xr make 1 variables that control the aspects of how the system builds. .Pp The default location of .Nm is .Pa /etc/src.conf , though an alternative location can be specified in the .Xr make 1 variable .Va SRCCONF . Overriding the location of .Nm may be necessary if the system-wide settings are not suitable for a particular build. For instance, setting .Va SRCCONF to .Pa /dev/null effectively resets all build controls to their defaults. .Pp The only purpose of .Nm is to control the compilation of the .Fx source code, which is usually located in .Pa /usr/src . As a rule, the system administrator creates .Nm when the values of certain control variables need to be changed from their defaults. .Pp In addition, control variables can be specified for a particular build via the .Fl D option of .Xr make 1 or in its environment; see .Xr environ 7 . .Pp The environment of .Xr make 1 for the build can be controlled via the .Va SRC_ENV_CONF variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are .Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE , and .Va MAKEOBJDIRPREFIX as they are environment-only variables. .Pp The values of .Va WITH_ and .Va WITHOUT_ variables are ignored regardless of their setting; even if they would be set to .Dq Li FALSE or .Dq Li NO . The presence of an option causes it to be honored by .Xr make 1 . .Pp This list provides a name and short description for variables that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT Do not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI Do not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_APM Do not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITH_ASAN Build the base system with Address Sanitizer (ASan) to detect memory corruption bugs such as buffer overflows or use-after-free. Requires that Clang be used as the base system compiler and that the runtime support library is available. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITH_LLVM_BINUTILS .It .Va WITH_LLVM_CXXFILT .El .It Va WITHOUT_ASSERT_DEBUG Compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT Do not build .Xr at 1 and related utilities. .It Va WITHOUT_AUDIT Do not build audit support into system programs. .It Va WITHOUT_AUTHPF Do not build .Xr authpf 8 . .It Va WITHOUT_AUTOFS Do not build .Xr autofs 4 related programs, libraries, and kernel modules. .It Va WITHOUT_AUTO_OBJ Disable automatic creation of objdirs. This is enabled by default if the wanted OBJDIR is writable by the current user. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_BEARSSL Build the BearSSL library. .Pp BearSSL is a tiny SSL library suitable for embedded environments. For details see .Lk https://www.BearSSL.org/ .Pp This library is currently only used to perform signature verification and related operations for Verified Exec and .Xr loader 8 . .Pp Due to size constraints in the BIOS environment on x86, one may need to set .Va LOADERSIZE larger than the default 500000, although often loader is under the 500k limit even with this option. Setting .Va LOADERSIZE larger than 500000 may cause .Xr pxeboot 8 to be too large to work. Careful testing of the loader in the target environment when built with a larger limit to establish safe limits is critical because different BIOS environments reserve differing amounts of the low 640k space, making a precise limit for everybody impossible. .Pp See also .Va WITH_LOADER_PXEBOOT for other considerations. When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_LOADER_EFI_SECUREBOOT (unless .Va WITHOUT_LOADER_EFI_SECUREBOOT is set explicitly) .It Va WITH_LOADER_VERIEXEC (unless .Va WITHOUT_LOADER_VERIEXEC is set explicitly) .It Va WITH_LOADER_VERIEXEC_VECTX (unless .Va WITHOUT_LOADER_VERIEXEC_VECTX is set explicitly) .It Va WITH_VERIEXEC (unless .Va WITHOUT_VERIEXEC is set explicitly) .El .It Va WITHOUT_BHYVE Do not build or install .Xr bhyve 8 , associated utilities, and examples. .Pp This option only affects amd64/amd64 and arm64/aarch64. .It Va WITH_BHYVE_SNAPSHOT Include support for save and restore (snapshots) in .Xr bhyve 8 and .Xr bhyvectl 8 . .Pp This option only affects amd64/amd64. .It Va WITH_BIND_NOW Build all binaries with the .Dv DF_BIND_NOW flag set to indicate that the run-time loader should perform all relocation processing at process startup rather than on demand. The combination of the .Va BIND_NOW and .Va RELRO options provide "full" Relocation Read-Only (RELRO) support. With full RELRO the entire GOT is made read-only after performing relocation at startup, avoiding GOT overwrite attacks. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 and .Xr blacklistctl 8 . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BLACKLIST_SUPPORT (unless .Va WITH_BLACKLIST_SUPPORT is set explicitly) .El .It Va WITHOUT_BLACKLIST_SUPPORT Build some programs without .Xr libblacklist 3 support, like .Xr fingerd 8 , .Xr ftpd 8 , and .Xr sshd 8 . .It Va WITHOUT_BLUETOOTH Do not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BOOT Do not build the boot blocks and loader. .It Va WITHOUT_BOOTPARAMD Do not build or install .Xr bootparamd 8 . .It Va WITHOUT_BOOTPD Do not build or install .Xr bootpd 8 . .It Va WITH_BRANCH_PROTECTION Build with branch protection enabled. On arm64 enable the use of pointer authentication and branch target identification instructions on arm64. These can be used to help mitigate some exploit techniques. .It Va WITHOUT_BSDINSTALL Do not build .Xr bsdinstall 8 , .Xr sade 8 , and related programs. .It Va WITHOUT_BSD_CPIO Do not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITHOUT_BSNMP Do not build or install .Xr bsnmpd 1 and related libraries and data files. .It Va WITHOUT_BZIP2 Do not build contributed bzip2 software as a part of the base system. .Bf -symbolic The option has no effect yet. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BZIP2_SUPPORT (unless .Va WITH_BZIP2_SUPPORT is set explicitly) .El .It Va WITHOUT_BZIP2_SUPPORT Build some programs without optional bzip2 support. .It Va WITHOUT_CALENDAR Do not build .Xr calendar 1 . .It Va WITHOUT_CAROOT Do not add the trusted certificates from the Mozilla NSS bundle to base. .It Va WITHOUT_CASPER This option has no effect. .It Va WITH_CCACHE_BUILD Use .Xr ccache 1 for the build. No configuration is required except to install the .Sy devel/ccache package. When using with .Xr distcc 1 , set .Sy CCACHE_PREFIX=/usr/local/bin/distcc . The default cache directory of .Pa $HOME/.ccache will be used, which can be overridden by setting .Sy CCACHE_DIR . The .Sy CCACHE_COMPILERCHECK option defaults to .Sy content when using the in-tree bootstrap compiler, and .Sy mtime when using an external compiler. The .Sy CCACHE_CPP2 option is used for Clang but not GCC. .Pp Sharing a cache between multiple work directories requires using a layout similar to .Pa /some/prefix/src .Pa /some/prefix/obj and an environment such as: .Bd -literal -offset indent CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' .Ed .Pp See .Xr ccache 1 for more configuration options. .It Va WITHOUT_CCD Do not build .Xr geom_ccd 4 and related utilities. .It Va WITHOUT_CDDL Do not build code licensed under Sun's CDDL. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CTF .It .Va WITHOUT_DTRACE .It .Va WITHOUT_LOADER_ZFS .It .Va WITHOUT_ZFS .It .Va WITHOUT_ZFS_TESTS .El .It Va WITHOUT_CLANG Do not build the Clang C/C++ compiler during the regular phase of the build. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_LLVM_TARGET_AARCH64 (unless .Va WITH_LLVM_TARGET_AARCH64 is set explicitly) .It Va WITHOUT_LLVM_TARGET_ALL (unless .Va WITH_LLVM_TARGET_ALL is set explicitly) .It Va WITHOUT_LLVM_TARGET_ARM (unless .Va WITH_LLVM_TARGET_ARM is set explicitly) .It Va WITHOUT_LLVM_TARGET_POWERPC (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) .It Va WITHOUT_LLVM_TARGET_RISCV (unless .Va WITH_LLVM_TARGET_RISCV is set explicitly) .El .It Va WITHOUT_CLANG_BOOTSTRAP Do not build the Clang C/C++ compiler during the bootstrap phase of the build. To be able to build the system, either gcc or clang bootstrap must be enabled unless an alternate compiler is provided via XCC. .It Va WITH_CLANG_EXTRAS Build additional clang and llvm tools, such as bugpoint and clang-format. .It Va WITH_CLANG_FORMAT Build clang-format. .It Va WITHOUT_CLANG_FULL Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .It Va WITH_CLEAN Clean before building world and/or kernel. .It Va WITHOUT_CPP Do not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER Do not build any cross compiler in the cross-tools stage of buildworld. When compiling a different version of .Fx than what is installed on the system, provide an alternate compiler with XCC to ensure success. When compiling with an identical version of .Fx to the host, this option may be safely used. This option may also be safe when the host version of .Fx is close to the sources being built, but all bets are off if there have been any changes to the toolchain between the versions. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_BOOTSTRAP .It .Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP .It .Va WITHOUT_LLD_BOOTSTRAP .El .It Va WITHOUT_CRYPT Do not build any crypto code. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_LOADER_ZFS .It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL .It .Va WITHOUT_OPENSSL_KTLS .It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS .It .Va WITHOUT_ZFS_TESTS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .El .It Va WITH_CTF Compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CUSE Do not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL Do not build .Xr cxgbetool 8 .Pp This is a default setting on arm/armv7, powerpc/powerpc and riscv/riscv64. .It Va WITH_CXGBETOOL Build .Xr cxgbetool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_DEBUG_FILES Avoid building or installing standalone debug files for each executable binary and shared library. .It Va WITH_DETECT_TZ_CHANGES Make the time handling code detect changes to the timezone files. .It Va WITH_DIALOG Do build .Xr dialog 1 , .Xr dialog 3 , .Xr dpv 1 , and .Xr dpv 3 . .It Va WITHOUT_DICT Do not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD This is an alternate build system. For details see https://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. Build commands can be seen from the top-level with: .Dl make show-valid-targets The build is driven by dirdeps.mk using .Va DIRDEPS stored in Makefile.depend files found in each directory. .Pp The build can be started from anywhere, and behaves the same. The initial instance of .Xr make 1 recursively reads .Va DIRDEPS from .Pa Makefile.depend , computing a graph of tree dependencies from the current origin. Setting .Va NO_DIRDEPS skips checking dirdep dependencies and will only build in the current and child directories. .Va NO_DIRDEPS_BELOW skips building any dirdeps and only build the current directory. .Pp This also utilizes the .Va WITH_META_MODE logic for incremental builds. .Pp The build hides commands executed unless .Va NO_SILENT is defined. .Pp Note that there is currently no mass install feature for this. This build is designed for producing packages, that can then be installed on a target system. .Pp The implementation in .Fx is incomplete. Completion would require leaf directories for building each kernel and package so that their dependencies can be tracked. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITH_INSTALL_AS_USER .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_META_ERROR_TARGET (unless .Va WITHOUT_META_ERROR_TARGET is set explicitly) .It Va WITH_META_MODE (unless .Va WITHOUT_META_MODE is set explicitly) .It Va WITH_STAGING (unless .Va WITHOUT_STAGING is set explicitly) .It Va WITH_STAGING_MAN (unless .Va WITHOUT_STAGING_MAN is set explicitly) .It Va WITH_STAGING_PROG (unless .Va WITHOUT_STAGING_PROG is set explicitly) .It Va WITH_SYSROOT (unless .Va WITHOUT_SYSROOT is set explicitly) .El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_DIRDEPS_CACHE Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_DISK_IMAGE_TOOLS_BOOTSTRAP Build .Xr etdump 1 , .Xr makefs 8 and .Xr mkimg 1 as bootstrap tools. .It Va WITHOUT_DMAGENT Do not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS Do not install compressed system documentation. Only the uncompressed version will be installed. .It Va WITHOUT_DTRACE Do not build DTrace framework kernel modules, libraries, and user commands. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CTF .El .It Va WITH_DTRACE_ASAN Compile userspace DTrace code (libdtrace, dtrace(1), lockstat(1), plockstat(1)) with address and undefined behavior sanitizers. Requires that Clang be used as the base system compiler and that the runtime support library is available. .It Va WITH_DTRACE_TESTS Build and install the DTrace test suite in .Pa /usr/tests/cddl/usr.sbin/dtrace . This test suite is considered experimental on architectures other than amd64/amd64 and running it may cause system instability. .It Va WITHOUT_DYNAMICROOT Set this if you do not want to link .Pa /bin and .Pa /sbin dynamically. .It Va WITHOUT_EE Do not build and install .Xr edit 1 , .Xr ee 1 , and related programs. .It Va WITHOUT_EFI Set not to build .Xr efivar 3 and .Xr efivar 8 . .Pp This is a default setting on i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_EFI Build .Xr efivar 3 and .Xr efivar 8 . .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64 and riscv/riscv64. .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP Do not build ELF Tool Chain tools (addr2line, nm, size, strings and strip) as part of the bootstrap process. .Bf -symbolic An alternate bootstrap tool chain must be provided. .Ef .It Va WITHOUT_EXAMPLES Avoid installing examples to .Pa /usr/share/examples/ . .It Va WITH_EXPERIMENTAL Include experimental features in the build. .It Va WITHOUT_FDT Do not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp This is a default setting on amd64/amd64 and i386/i386. .It Va WITH_FDT Build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp This is a default setting on arm/armv7, arm64/aarch64, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITHOUT_FILE Do not build .Xr file 1 and related programs. .It Va WITHOUT_FINGER Do not build or install .Xr finger 1 and .Xr fingerd 8 . .It Va WITHOUT_FLOPPY Do not build or install programs for operating floppy disk driver. .It Va WITHOUT_FORMAT_EXTENSIONS Do not enable .Fl fformat-extensions when compiling the kernel. Also disables all format checking. .It Va WITHOUT_FORTH Build bootloaders without Forth support. .It Va WITHOUT_FP_LIBC Build .Nm libc without floating-point support. .It Va WITHOUT_FREEBSD_UPDATE Do not build .Xr freebsd-update 8 . .It Va WITHOUT_FTP Do not build or install .Xr ftp 1 and .Xr ftpd 8 . .It Va WITHOUT_GAMES Do not build games. .It Va WITHOUT_GNU_DIFF Do not build GNU .Xr diff3 1 ; build BSD .Xr diff3 1 instead. .It Va WITHOUT_GOOGLETEST Neither build nor install .Lb libgmock , .Lb libgtest , and dependent tests. .It Va WITHOUT_GPIO Do not build .Xr gpioctl 8 as part of the base system. .It Va WITHOUT_GSSAPI Do not build libgssapi. .It Va WITHOUT_HAST Do not build .Xr hastd 8 and related utilities. .It Va WITH_HESIOD Build Hesiod support. .It Va WITHOUT_HTML Do not build HTML docs. .It Va WITHOUT_HYPERV Do not build or install HyperV utilities. .Pp This is a default setting on arm/armv7, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_HYPERV Build or install HyperV utilities. .Pp This is a default setting on amd64/amd64, arm64/aarch64 and i386/i386. .It Va WITHOUT_ICONV Do not build iconv as part of libc. .It Va WITHOUT_INCLUDES Do not install header files. This option used to be spelled .Va NO_INCS . .Bf -symbolic The option does not work for build targets. .Ef .It Va WITHOUT_INET Do not build programs and libraries related to IPv4 networking. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_INET_SUPPORT .El .It Va WITHOUT_INET6 Do not build programs and libraries related to IPv6 networking. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_INET6_SUPPORT .El .It Va WITHOUT_INET6_SUPPORT Build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INETD Do not build .Xr inetd 8 . .It Va WITHOUT_INET_SUPPORT Build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INSTALLLIB Set this to not install optional libraries. For example, when creating a .Xr nanobsd 8 image. .Bf -symbolic The option does not work for build targets. .Ef .It Va WITH_INSTALL_AS_USER Make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the .Xr make 1 command. The user still must set the .Va DESTDIR variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER Do not build IP Filter package. .It Va WITHOUT_IPFW Do not build IPFW tools. .It Va WITHOUT_IPSEC_SUPPORT Do not build the kernel with .Xr ipsec 4 support. This option is needed for .Xr ipsec 4 and .Xr tcpmd5 4 . .It Va WITHOUT_ISCSI Do not build .Xr iscsid 8 and related utilities. .It Va WITHOUT_JAIL Do not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_JEMALLOC_LG_VADDR_WIDE Disallow programs to use more than 48 address bits on amd64. Incompatible with LA57 mode. Enabling this option might result in a slight reduction in memory consumption for jemalloc metadata, but also requires disabling LA57 (if hardware supports it). .It Va WITHOUT_KDUMP Do not build .Xr kdump 1 and .Xr truss 1 . .It Va WITHOUT_KERBEROS Set this to not build Kerberos 5 (KTH Heimdal). When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .It Va WITHOUT_KERBEROS_SUPPORT (unless .Va WITH_KERBEROS_SUPPORT is set explicitly) .El .It Va WITHOUT_KERBEROS_SUPPORT Build some programs without Kerberos support, like .Xr ssh 1 , .Xr telnet 1 , and .Xr sshd 8 . .It Va WITH_KERNEL_BIN Generate and install kernel.bin from kernel as part of the normal build and install processes for the kernel. Available only on arm and arm64. Usually this will be added to the kernel config file with: makeoptions WITH_KERNEL_BIN=1 though it can also be used on the command line. .It Va WITH_KERNEL_RETPOLINE Enable the "retpoline" mitigation for CVE-2017-5715 in the kernel build. .It Va WITHOUT_KERNEL_SYMBOLS Do not install standalone kernel debug symbol files. This option has no effect at build time. .It Va WITHOUT_KVM Do not build the .Nm libkvm library as a part of the base system. .Bf -symbolic The option has no effect yet. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_KVM_SUPPORT (unless .Va WITH_KVM_SUPPORT is set explicitly) .El .It Va WITHOUT_KVM_SUPPORT Build some programs without optional .Nm libkvm support. .It Va WITHOUT_LDNS Setting this variable will prevent the LDNS library from being built. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_UNBOUND .El .It Va WITHOUT_LDNS_UTILS Setting this variable will prevent building the LDNS utilities .Xr drill 1 and .Xr host 1 . .It Va WITHOUT_LEGACY_CONSOLE Do not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 1 and .Xr vidcontrol 1 . .It Va WITHOUT_LIB32 On 64-bit platforms, do not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. .Pp This is a default setting on arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LIB32 On 64-bit platforms, build the 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. .Pp This is a default setting on amd64/amd64, arm64/aarch64 and powerpc/powerpc64. .It Va WITHOUT_LLD Do not build LLVM's lld linker. .It Va WITHOUT_LLDB Do not build the LLDB debugger. .Pp This is a default setting on arm/armv7 and riscv/riscv64. .It Va WITH_LLDB Build the LLDB debugger. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LLD_BOOTSTRAP Do not build the LLD linker during the bootstrap phase of the build. To be able to build the system an alternate linker must be provided via XLD. .It Va WITHOUT_LLVM_ASSERTIONS Disable debugging assertions in LLVM. .It Va WITHOUT_LLVM_BINUTILS Install ELF Tool Chain's binary utilities instead of LLVM's. This includes .Xr addr2line 1 , .Xr ar 1 , .Xr nm 1 , .Xr objcopy 1 , .Xr ranlib 1 , .Xr readelf 1 , .Xr size 1 , and .Xr strip 1 . Regardless of this setting, LLVM tools are used for .Xr c++filt 1 and .Xr objdump 1 . .Xr strings 1 is always provided by ELF Tool Chain. .It Va WITHOUT_LLVM_COV Do not build the .Xr llvm-cov 1 tool. .It Va WITHOUT_LLVM_CXXFILT Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt. .It Va WITH_LLVM_FULL_DEBUGINFO Generate full debug information for LLVM libraries and tools, which uses more disk space and build resources, but allows for easier debugging. .It Va WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_ALL Only build the required LLVM target support. This option is preferred to specific target support options. When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_LLVM_TARGET_AARCH64 (unless .Va WITH_LLVM_TARGET_AARCH64 is set explicitly) .It Va WITHOUT_LLVM_TARGET_ARM (unless .Va WITH_LLVM_TARGET_ARM is set explicitly) .It Va WITHOUT_LLVM_TARGET_POWERPC (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) .It Va WITHOUT_LLVM_TARGET_RISCV (unless .Va WITH_LLVM_TARGET_RISCV is set explicitly) .El .It Va WITHOUT_LLVM_TARGET_ARM Do not build LLVM target support for ARM. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITH_LLVM_TARGET_BPF Build LLVM target support for BPF. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITH_LLVM_TARGET_MIPS Build LLVM target support for MIPS. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_POWERPC Do not build LLVM target support for PowerPC. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_RISCV Do not build LLVM target support for RISC-V. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_X86 Do not build LLVM target support for X86. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LOADER_BIOS_TEXTONLY Include graphics, font and video mode support in the i386 and amd64 BIOS boot loader. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 with support for verification based on certificates obtained from UEFI. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_GELI Build GELI bootloader support. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITHOUT_LOADER_IA32 Do not build the 32-bit UEFI loader. .Pp This is a default setting on arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_IA32 Build the 32-bit UEFI loader. .Pp This is a default setting on amd64/amd64. .It Va WITHOUT_LOADER_KBOOT Do not build kboot, a linuxboot environment loader .Pp This is a default setting on arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_KBOOT Build kboot, a linuxboot environment loader .Pp This is a default setting on amd64/amd64, arm64/aarch64 and powerpc/powerpc64. .It Va WITHOUT_LOADER_LUA Do not build LUA bindings for the boot loader. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_LUA Build LUA bindings for the boot loader. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_LOADER_OFW Build openfirmware bootloader components. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LOADER_PXEBOOT Do not build pxeboot on i386/amd64. When the pxeboot is too large, or unneeded, it may be disabled with this option. See .Va WITH_LOADER_PXEBOOT for how to adjust the defaults when you need both a larger .Pa /boot/loader and .Pa /boot/pxeboot .Pp This option only has an effect on x86. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_UBOOT Build ubldr. .Pp This is a default setting on arm/armv7, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_LOADER_VERBOSE Build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. Use with care. .It Va WITH_LOADER_VERIEXEC Enable building .Xr loader 8 with support for verification similar to Verified Exec. .Pp Depends on .Va WITH_BEARSSL . May require a larger .Va LOADERSIZE . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_LOADER_EFI_SECUREBOOT (unless .Va WITHOUT_LOADER_EFI_SECUREBOOT is set explicitly) .It Va WITH_LOADER_VERIEXEC_VECTX (unless .Va WITHOUT_LOADER_VERIEXEC_VECTX is set explicitly) .El .It Va WITH_LOADER_VERIEXEC_PASS_MANIFEST Enable building .Xr loader 8 with support to pass a verified manifest to the kernel. The kernel has to be built with a module to parse the manifest. .Pp Depends on .Va WITH_LOADER_VERIEXEC . .It Va WITH_LOADER_VERIEXEC_VECTX Enable building .Xr loader 8 with support for hashing and verifying kernel and modules as a side effect of loading. .Pp Depends on .Va WITH_LOADER_VERIEXEC . .It Va WITHOUT_LOADER_ZFS Do not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES Do not build localization files; see .Xr locale 1 . .It Va WITHOUT_LOCATE Do not build .Xr locate 1 and related programs. .It Va WITHOUT_LPR Do not build .Xr lpr 1 and related programs. .It Va WITHOUT_LS_COLORS Build .Xr ls 1 without support for colors to distinguish file types. .It Va WITHOUT_MACHDEP_OPTIMIZATIONS Prefer machine-independent non-assembler code in libc and libm. .It Va WITHOUT_MAIL Do not build any mail support (MUA or MTA). When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_MAILWRAPPER .It .Va WITHOUT_SENDMAIL .El .It Va WITHOUT_MAILWRAPPER Do not build the .Xr mailwrapper 8 MTA selector. .It Va WITHOUT_MAKE Do not install .Xr make 1 and related support files. .It Va WITHOUT_MAKE_CHECK_USE_SANDBOX Do not execute .Dq Li "make check" in limited sandbox mode. This option should be paired with .Va WITH_INSTALL_AS_USER if executed as an unprivileged user. See .Xr tests 7 for more details. .It Va WITH_MALLOC_PRODUCTION Disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_MAN_UTILS (unless .Va WITH_MAN_UTILS is set explicitly) .El .It Va WITHOUT_MANCOMPRESS Do not install compressed man pages. Only the uncompressed versions will be installed. .It Va WITHOUT_MANSPLITPKG Do not split man pages into their own packages during make package. .It Va WITHOUT_MAN_UTILS Do not build utilities for manual pages, .Xr apropos 1 , .Xr makewhatis 1 , .Xr man 1 , .Xr whatis 1 , .Xr manctl 8 , and related support files. .It Va WITH_META_ERROR_TARGET Enable the META_MODE .ERROR target. .Pp This target will copy the meta file of a failed target to .Va ERROR_LOGDIR (default is .Ql ${SRCTOP:H}/error ) to help with failure analysis. Depends on .Va WITH_META_MODE . This default when .Va WITH_DIRDEPS_BUILD is set. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_META_MODE Create .Xr make 1 meta files when building, which can provide a reliable incremental build when using .Xr filemon 4 . The meta file is created in OBJDIR as .Pa target.meta . These meta files track the command that was executed, its output, and the current directory. The .Xr filemon 4 module is required unless .Va NO_FILEMON is defined. When the module is loaded, any files used by the commands executed are tracked as dependencies for the target in its meta file. The target is considered out-of-date and rebuilt if any of these conditions are true compared to the last build: .Bl -bullet -compact .It The command to execute changes. .It The current working directory changes. .It The target's meta file is missing. .It The target's meta file is missing filemon data when filemon is loaded and a previous run did not have it loaded. .It [requires .Xr filemon 4 ] Files read, executed or linked to are newer than the target. .It [requires .Xr filemon 4 ] Files read, written, executed or linked are missing. .El The meta files can also be useful for debugging. .Pp The build hides commands that are executed unless .Va NO_SILENT is defined. Errors cause .Xr make 1 to show some of its environment for further debugging. .Pp The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed to .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_MLX5TOOL Do not build .Xr mlx5tool 8 .Pp This is a default setting on arm/armv7, powerpc/powerpc and riscv/riscv64. .It Va WITH_MLX5TOOL Build .Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_NETCAT Do not build .Xr nc 1 utility. .It Va WITHOUT_NETGRAPH Do not build applications to support .Xr netgraph 4 . When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_BLUETOOTH .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_NETGRAPH_SUPPORT (unless .Va WITH_NETGRAPH_SUPPORT is set explicitly) .El .It Va WITHOUT_NETGRAPH_SUPPORT Build libraries, programs, and kernel modules without netgraph support. .It Va WITHOUT_NETLINK Do not build .Xr genl 1 utility. .It Va WITHOUT_NETLINK_SUPPORT Make libraries and programs use rtsock and .Xr sysctl 3 interfaces instead of .Xr snl 3 . .It Va WITHOUT_NIS Do not build .Xr NIS 8 support and related programs. If set, you might need to adopt your .Xr nsswitch.conf 5 and remove .Sq nis entries. .It Va WITHOUT_NLS Do not build NLS catalogs. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_NLS_CATALOGS .El .It Va WITHOUT_NLS_CATALOGS Do not build NLS catalog support for .Xr csh 1 . .It Va WITHOUT_NS_CACHING Disable name caching in the .Pa nsswitch subsystem. The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. .It Va WITHOUT_NTP Do not build .Xr ntpd 8 and related programs. .It Va WITHOUT_NUAGEINIT Do not install the limited cloud init support scripts. .It Va WITHOUT_OFED Do not build the .Dq "OpenFabrics Enterprise Distribution" InfiniBand software stack, including kernel modules and userspace libraries. .Pp This is a default setting on arm/armv7. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_OFED_EXTRA .El .It Va WITH_OFED Build the .Dq "OpenFabrics Enterprise Distribution" InfiniBand software stack, including kernel modules and userspace libraries. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_OFED_EXTRA Build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, mostly examples. .It Va WITH_OPENLDAP Enable building LDAP support for kerberos using an openldap client from ports. .It Va WITHOUT_OPENMP Do not build LLVM's OpenMP runtime. .Pp This is a default setting on arm/armv7 and powerpc/powerpc. .It Va WITH_OPENMP Build LLVM's OpenMP runtime. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITHOUT_OPENSSH Do not build OpenSSH. .It Va WITHOUT_OPENSSL Do not build OpenSSL. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_LOADER_ZFS .It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL_KTLS .It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS .It .Va WITHOUT_ZFS_TESTS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .El .It Va WITHOUT_OPENSSL_KTLS Do not include kernel TLS support in OpenSSL. .Pp This is a default setting on arm/armv7, i386/i386, powerpc/powerpc and riscv/riscv64. .It Va WITH_OPENSSL_KTLS Include kernel TLS support in OpenSSL. .Pp This is a default setting on amd64/amd64, arm64/aarch64, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_PAM Do not build PAM library and modules. .Bf -symbolic This option is deprecated and does nothing. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_PAM_SUPPORT (unless .Va WITH_PAM_SUPPORT is set explicitly) .El .It Va WITHOUT_PAM_SUPPORT Build some programs without PAM support, particularly .Xr ftpd 8 and .Xr ppp 8 . .It Va WITHOUT_PF Do not build PF firewall package. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_AUTHPF .El .It Va WITHOUT_PIE Do not build dynamically linked binaries as Position-Independent Executable (PIE). .Pp This is a default setting on arm/armv7, i386/i386 and powerpc/powerpc. .It Va WITH_PIE Build dynamically linked binaries as Position-Independent Executable (PIE). .Pp This is a default setting on amd64/amd64, arm64/aarch64, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITHOUT_PKGBOOTSTRAP Do not build .Xr pkg 7 bootstrap tool. .It Va WITHOUT_PMC Do not build .Xr pmccontrol 8 and related programs. .It Va WITHOUT_PPP Do not build .Xr ppp 8 and related programs. .It Va WITHOUT_PTHREADS_ASSERTIONS Disable debugging assertions in pthreads library. .It Va WITHOUT_QUOTAS Do not build .Xr quota 1 and related programs. .It Va WITHOUT_RADIUS_SUPPORT Do not build radius support into various applications, like .Xr pam_radius 8 and .Xr ppp 8 . .It Va WITH_RATELIMIT Build the system with rate limit support. .Pp This makes .Dv SO_MAX_PACING_RATE effective in .Xr getsockopt 2 , and .Ar txrlimit support in .Xr ifconfig 8 , by proxy. .It Va WITHOUT_RBOOTD Do not build or install .Xr rbootd 8 . .It Va WITHOUT_RELRO Do not apply the Relocation Read-Only (RELRO) vulnerability mitigation. See also the .Va BIND_NOW option. .It Va WITH_REPRODUCIBLE_BUILD Exclude build metadata (such as the build time, user, or host) from the kernel, boot loaders, and uname output, so that builds produce bit-for-bit identical output. .It Va WITHOUT_RESCUE Do not build .Xr rescue 8 . .It Va WITH_RETPOLINE Build the base system with the retpoline speculative execution vulnerability mitigation for CVE-2017-5715. .It Va WITHOUT_ROUTED Do not build .Xr routed 8 utility. .It Va WITH_RPCBIND_WARMSTART_SUPPORT Build .Xr rpcbind 8 with warmstart support. .It Va WITHOUT_SCTP_SUPPORT Disable support in the kernel for the .Xr sctp 4 Stream Control Transmission Protocol loadable kernel module. .It Va WITHOUT_SENDMAIL Do not build .Xr sendmail 8 and related programs. .It Va WITHOUT_SERVICESDB Do not install .Pa /var/db/services.db . .It Va WITHOUT_SETUID_LOGIN Set this to disable the installation of .Xr login 1 as a set-user-ID root program. .It Va WITHOUT_SHAREDOCS Do not build the .Bx 4.4 legacy docs. .It Va WITH_SORT_THREADS Enable threads in .Xr sort 1 . .It Va WITHOUT_SOURCELESS Do not build kernel modules that include sourceless code (either microcode or native code for host CPU). When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_SOURCELESS_HOST .It .Va WITHOUT_SOURCELESS_UCODE .El .It Va WITHOUT_SOURCELESS_HOST Do not build kernel modules that include sourceless native code for host CPU. .It Va WITHOUT_SOURCELESS_UCODE Do not build kernel modules that include sourceless microcode. .It Va WITHOUT_SPLIT_KERNEL_DEBUG Do not build standalone kernel debug files. Debug data (if enabled by the kernel configuration file) will be included in the kernel and modules. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_KERNEL_SYMBOLS .El .It Va WITHOUT_SSP Do not build world with stack smashing protection. See .Xr mitigations 7 for more information. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to .Va DESTDIR with some extra meta data to ensure dependencies can be tracked. Depends on .Va WITH_DIRDEPS_BUILD . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_STAGING_MAN (unless .Va WITHOUT_STAGING_MAN is set explicitly) .It Va WITH_STAGING_PROG (unless .Va WITHOUT_STAGING_PROG is set explicitly) .El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_STAGING_MAN Enable staging of man pages to stage tree. .It Va WITH_STAGING_PROG Enable staging of PROGs to stage tree. .It Va WITH_STALE_STAGED Check staged files are not stale. .It Va WITHOUT_STATS Neither build nor install .Lb libstats and dependent binaries. .It Va WITHOUT_SYSCONS Do not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. .It Va WITH_SYSROOT Enable use of sysroot during build. Depends on .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_SYSTEM_COMPILER Do not opportunistically skip building a cross-compiler during the bootstrap phase of the build. Normally, if the currently installed compiler matches the planned bootstrap compiler type and revision, then it will not be built. This does not prevent a compiler from being built for installation though, only for building one for the build itself. The .Va WITHOUT_CLANG option controls that. .It Va WITHOUT_SYSTEM_LINKER Do not opportunistically skip building a cross-linker during the bootstrap phase of the build. Normally, if the currently installed linker matches the planned bootstrap linker type and revision, then it will not be built. This does not prevent a linker from being built for installation though, only for building one for the build itself. The .Va WITHOUT_LLD option controls that. .Pp This option is only relevant when .Va WITH_LLD_BOOTSTRAP is set. .It Va WITHOUT_TALK Do not build or install .Xr talk 1 and .Xr talkd 8 . .It Va WITHOUT_TCP_WRAPPERS Do not build or install .Xr tcpd 8 , and related utilities. .It Va WITHOUT_TCSH Do not build and install .Pa /bin/csh (which is .Xr tcsh 1 ) . .It Va WITHOUT_TELNET Do not build .Xr telnet 1 and related programs. .It Va WITHOUT_TESTS Do not build nor install the .Fx Test Suite in .Pa /usr/tests/ . See .Xr tests 7 for more details. This also disables the build of all test-related dependencies, including ATF. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DTRACE_TESTS .It .Va WITHOUT_ZFS_TESTS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GOOGLETEST (unless .Va WITH_GOOGLETEST is set explicitly) .It Va WITHOUT_TESTS_SUPPORT (unless .Va WITH_TESTS_SUPPORT is set explicitly) .El .It Va WITHOUT_TESTS_SUPPORT Disable the build of all test-related dependencies, including ATF. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_GOOGLETEST .El .It Va WITHOUT_TEXTPROC Do not build programs used for text processing. .It Va WITHOUT_TFTP Do not build or install .Xr tftp 1 and .Xr tftpd 8 . .It Va WITHOUT_TOOLCHAIN Do not install programs used for program development, compilers, debuggers etc. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG .It .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLD .It .Va WITHOUT_LLDB .It .Va WITHOUT_LLVM_COV .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_LLVM_BINUTILS (unless .Va WITH_LLVM_BINUTILS is set explicitly) .El .It Va WITH_UBSAN Build the base system with Undefined Behavior Sanitizer (UBSan) to detect various kinds of undefined behavior at runtime. Requires that Clang be used as the base system compiler and that the runtime support library is available .It Va WITHOUT_UNBOUND Do not build .Xr unbound 8 and related programs. .It Va WITH_UNDEFINED_VERSION Link libraries with --undefined-version which permits version maps to contain symbols that are not present in the library. If this is necessary to build a particular configuration, a bug is present and the configuration should be reported. .It Va WITHOUT_UNIFIED_OBJDIR Use the historical object directory format for .Xr build 7 targets. For native-builds and builds done directly in sub-directories the format of .Pa ${MAKEOBJDIRPREFIX}/${.CURDIR} is used, while for cross-builds .Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}/${.CURDIR} is used. .Pp This option is transitional and will be removed in a future version of .Fx , at which time .Va WITH_UNIFIED_OBJDIR will be enabled permanently. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_USB Do not build USB-related programs and libraries. .It Va WITHOUT_USB_GADGET_EXAMPLES Do not build USB gadget kernel modules. .It Va WITHOUT_UTMPX Do not build user accounting tools such as .Xr last 1 , .Xr users 1 , .Xr who 1 , .Xr ac 8 , .Xr lastlogin 8 and .Xr utx 8 . .It Va WITH_VERIEXEC Enable building .Xr veriexec 8 which loads the contents of verified manifests into the kernel for use by .Xr mac_veriexec 4 .Pp Depends on .Va WITH_BEARSSL . .It Va WITHOUT_VI Do not build and install vi, view, ex and related programs. .It Va WITHOUT_VT Do not build .Xr vt 4 support files (fonts and keymaps). .It Va WITHOUT_WARNS Set this to not add warning flags to the compiler invocations. Useful as a temporary workaround when code enters the tree which triggers warnings in environments that differ from the original developer. .It Va WITHOUT_WERROR Set this to not treat compiler warnings as errors. Useful as a temporary workaround when working on fixing compiler warnings. When set, warnings are still printed in the build log but do not fail the build. .It Va WITHOUT_WIRELESS Do not build programs used for 802.11 wireless networks; especially .Xr wpa_supplicant 8 and .Xr hostapd 8 . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_WIRELESS_SUPPORT (unless .Va WITH_WIRELESS_SUPPORT is set explicitly) .El .It Va WITHOUT_WIRELESS_SUPPORT Build libraries, programs, and kernel modules without 802.11 wireless support. .It Va WITHOUT_WPA_SUPPLICANT_EAPOL Build .Xr wpa_supplicant 8 without support for the IEEE 802.1X protocol and without support for EAP-PEAP, EAP-TLS, EAP-LEAP, and EAP-TTLS protocols (usable only via 802.1X). .It Va WITH_ZEROREGS Build the basesystem with code to zero caller-used register contents on function return. This prevents leaking temporary values for side channel attacks. Additionally this reduces the number of usable ROP gadgets for attackers. .It Va WITHOUT_ZFS Do not build the ZFS file system kernel module, libraries such as .Xr libbe 3 , and user commands such as .Xr zpool 8 or .Xr zfs 8 . Also disable ZFS support in utilities and libraries which implement ZFS-specific functionality. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_ZFS_TESTS .El .It Va WITHOUT_ZFS_TESTS Do not build and install the legacy ZFS test suite. .It Va WITHOUT_ZONEINFO Do not build the timezone database. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT .El .It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT Build leapsecond information in to the timezone database. This option violates .St -p1003.1 and all other applicable standards, and is known to cause unexpected issues with date/time handling in many applications and programming languages. .El .Pp The following options accept a single value from a list of valid values. .Bl -tag -width indent .It Va INIT_ALL Control default initialization of stack variables in C and C++ code. Options other than .Li none require the Clang compiler or GCC 12.0 or later. The default value is .Li none . Valid values are: .Bl -tag -width indent .It Li none Do not initialize stack variables (standard C/C++ behavior). .It Li pattern Build the base system or kernel with stack variables initialized to .Pq compiler defined debugging patterns on function entry. .It Li zero Build the base system or kernel with stack variables initialized to zero on function entry. This value is converted to .Li none for amd64 kernel builds due to incompatability with ifunc memset. .El .It Va LIBC_MALLOC Specify the .Xr malloc 3 implementation used by libc. The default value is .Li jemalloc . Valid values are: .Bl -tag -width indent .It Li jemalloc .El .Pp Other implementations are expected in the future in both .Fx and downstream consumers. .El .Sh FILES .Bl -tag -compact -width Pa .It Pa /etc/src.conf .It Pa /etc/src-env.conf .It Pa /usr/share/mk/bsd.own.mk .El .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , .Xr build 7 , .Xr ports 7 .Sh HISTORY The .Nm file appeared in .Fx 7.0 . .Sh AUTHORS This manual page was autogenerated by .An tools/build/options/makeman .