Browse Source

Merge remote-tracking branch 'upstream/master' into hardened/current/master

Conflicts:
	share/man/man5/src.conf.5 (unresolved)
	sys/compat/cloudabi64/cloudabi64_module.c (unresolved)
	sys/vm/vm_map.c (unresolved)
hardened/current/master
Shawn Webb 6 months ago
parent
commit
c81e2da144
Signed by: Shawn Webb <shawn.webb@hardenedbsd.org> GPG Key ID: FF2E67A277F8E1FA
100 changed files with 3531 additions and 1100 deletions
  1. +18
    -3
      Makefile.inc1
  2. +13
    -0
      UPDATING
  3. +1
    -1
      cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  4. +14
    -43
      cddl/contrib/opensolaris/cmd/zpool/zpool.8
  5. +1
    -1
      contrib/bsnmp/lib/snmpclient.c
  6. +1
    -3
      contrib/bsnmp/snmpd/trans_inet.c
  7. +2
    -0
      contrib/elftoolchain/readelf/readelf.c
  8. +1
    -1
      crypto/openssh/monitor.c
  9. +2
    -0
      etc/mtree/BSD.root.dist
  10. +6
    -0
      lib/clang/libclang/Makefile
  11. +11
    -0
      lib/clang/libllvm/Makefile
  12. +0
    -1
      lib/clang/libllvmminimal/Makefile
  13. +1
    -1
      lib/geom/part/gpart.8
  14. +1
    -0
      libexec/Makefile
  15. +38
    -0
      libexec/flua/Makefile
  16. +73
    -0
      libexec/flua/linit_flua.c
  17. +795
    -0
      libexec/flua/luaconf.h
  18. +82
    -0
      libexec/flua/modules/lfs.c
  19. +0
    -0
      libexec/flua/modules/lfs.h
  20. +30
    -21
      libexec/flua/modules/lposix.c
  21. +11
    -0
      libexec/flua/modules/lposix.h
  22. +87
    -53
      share/man/man5/src.conf.5
  23. +2
    -0
      share/man/man7/hier.7
  24. +1
    -1
      share/mk/bsd.opts.mk
  25. +13
    -0
      share/mk/bsd.own.mk
  26. +45
    -0
      share/mk/src.lua.mk
  27. +1
    -1
      share/mk/src.opts.mk
  28. +1
    -0
      stand/defs.mk
  29. +4
    -1
      stand/liblua/Makefile
  30. +1
    -1
      stand/loader.mk
  31. +5
    -4
      sys/amd64/amd64/exception.S
  32. +3
    -1
      sys/amd64/amd64/machdep.c
  33. +7
    -13
      sys/amd64/amd64/mp_machdep.c
  34. +1
    -0
      sys/amd64/conf/GENERIC-NODEBUG
  35. +4
    -2
      sys/amd64/linux/Makefile
  36. +42
    -23
      sys/amd64/linux/linux_sysvec.c
  37. +4
    -2
      sys/amd64/linux32/Makefile
  38. +41
    -23
      sys/amd64/linux32/linux32_sysvec.c
  39. +10
    -11
      sys/arm/broadcom/bcm2835/bcm2835_dma.c
  40. +1
    -1
      sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
  41. +3
    -3
      sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  42. +140
    -151
      sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
  43. +263
    -0
      sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
  44. +27
    -31
      sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
  45. +1
    -0
      sys/arm/broadcom/bcm2835/files.bcm283x
  46. +1
    -1
      sys/arm/conf/GENERIC-NODEBUG
  47. +2
    -2
      sys/arm64/arm64/machdep.c
  48. +218
    -11
      sys/arm64/arm64/pmap.c
  49. +1
    -0
      sys/arm64/conf/GENERIC-NODEBUG
  50. +1
    -1
      sys/arm64/include/bus.h
  51. +4
    -2
      sys/arm64/linux/Makefile
  52. +45
    -24
      sys/arm64/linux/linux_sysvec.c
  53. +23
    -17
      sys/cam/scsi/scsi_all.c
  54. +5
    -3
      sys/compat/cloudabi32/Makefile
  55. +4
    -4
      sys/compat/cloudabi32/cloudabi32_module.c
  56. +1
    -1
      sys/compat/cloudabi32/cloudabi32_util.h
  57. +5
    -3
      sys/compat/cloudabi64/Makefile
  58. +8
    -2
      sys/compat/cloudabi64/cloudabi64_module.c
  59. +1
    -1
      sys/compat/cloudabi64/cloudabi64_util.h
  60. +4
    -2
      sys/compat/freebsd32/Makefile
  61. +41
    -21
      sys/compat/freebsd32/freebsd32_misc.c
  62. +3
    -3
      sys/compat/freebsd32/freebsd32_proto.h
  63. +4
    -4
      sys/compat/freebsd32/freebsd32_systrace_args.c
  64. +2
    -1
      sys/compat/freebsd32/freebsd32_util.h
  65. +2
    -0
      sys/compat/linux/linux_file.c
  66. +1
    -0
      sys/conf/files.arm64
  67. +4
    -11
      sys/dev/hwpmc/hwpmc_core.c
  68. +1
    -0
      sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  69. +9
    -0
      sys/dev/ioat/ioat.c
  70. +1
    -0
      sys/dev/ioat/ioat.h
  71. +6
    -0
      sys/dev/ntb/ntb_hw/ntb_hw_plx.c
  72. +7
    -7
      sys/dev/random/ivy.c
  73. +8
    -8
      sys/fs/devfs/devfs_vnops.c
  74. +1
    -2
      sys/fs/tmpfs/tmpfs_subr.c
  75. +1
    -1
      sys/i386/conf/GENERIC-NODEBUG
  76. +4
    -2
      sys/i386/linux/Makefile
  77. +44
    -24
      sys/i386/linux/linux_sysvec.c
  78. +4
    -2
      sys/kern/Makefile
  79. +4
    -2
      sys/kern/imgact_elf.c
  80. +47
    -22
      sys/kern/kern_exec.c
  81. +754
    -0
      sys/kern/subr_csan.c
  82. +4
    -4
      sys/kern/systrace_args.c
  83. +0
    -5
      sys/kern/sysv_shm.c
  84. +0
    -5
      sys/kern/uipc_shm.c
  85. +1
    -6
      sys/kern/vfs_cache.c
  86. +35
    -91
      sys/kern/vfs_subr.c
  87. +1
    -1
      sys/kern/vfs_syscalls.c
  88. +2
    -1
      sys/net/netmap_user.h
  89. +20
    -6
      sys/netinet/ip_mroute.c
  90. +1
    -1
      sys/netinet6/icmp6.c
  91. +1
    -2
      sys/netinet6/in6.c
  92. +12
    -1
      sys/netinet6/mld6.c
  93. +1
    -1
      sys/netinet6/mld6_var.h
  94. +11
    -13
      sys/netinet6/nd6.c
  95. +352
    -367
      sys/netinet6/nd6_rtr.c
  96. +3
    -9
      sys/powerpc/aim/mmu_oea64.c
  97. +1
    -1
      sys/powerpc/booke/pmap.c
  98. +1
    -1
      sys/powerpc/conf/GENERIC-NODEBUG
  99. +1
    -0
      sys/powerpc/conf/GENERIC64-NODEBUG
  100. +5
    -4
      sys/security/mac/mac_process.c

+ 18
- 3
Makefile.inc1 View File

@@ -289,9 +289,9 @@ WANT_LINKER_TYPE=
.if !defined(WANT_LINKER_FREEBSD_VERSION) && !make(showconfig) && \
!make(test-system-compiler)
.if ${WANT_LINKER_TYPE} == "lld"
WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/lld/Common/Version.inc
WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/VCSVersion.inc
WANT_LINKER_FREEBSD_VERSION!= \
awk '$$2 == "LLD_REVISION_STRING" {gsub(/"/, "", $$3); print $$3}' \
awk '$$2 == "LLD_REVISION" {gsub(/"/, "", $$3); print $$3}' \
${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown
WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc
WANT_LINKER_VERSION!= \
@@ -1500,6 +1500,11 @@ makeman: .PHONY
${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \
${.CURDIR}/share/man/man5/src.conf.5

.if make(sysent)
.include <src.lua.mk>
.endif

_sysent_PATH= ${WORLDTMP}/legacy/usr/libexec:/usr/libexec:${PATH}
_sysent_dirs= sys/kern
_sysent_dirs+= sys/compat/freebsd32
_sysent_dirs+= sys/compat/cloudabi32 \
@@ -1510,7 +1515,9 @@ _sysent_dirs+= sys/amd64/linux \
sys/i386/linux
sysent: .PHONY
.for _dir in ${_sysent_dirs}
${_+_}${MAKE} -C ${.CURDIR}/${_dir} sysent
@echo "${MAKE} -C ${.CURDIR}/${_dir} sysent"
${_+_}@env PATH=${_sysent_PATH} LUA=${LUA_CMD} \
${MAKE} -C ${.CURDIR}/${_dir} sysent
.endfor

#
@@ -2169,6 +2176,13 @@ ${_bt}-lib/libelf: ${_bt_m4_depend}
${_bt}-lib/libdwarf: ${_bt_m4_depend}
.endif

# flua is required to regenerate syscall files. It first appeared during the
# 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
# branches.
.if ${BOOTSTRAPPING} < 1300059
_flua= libexec/flua
.endif

# r245440 mtree -N support added
# r313404 requires sha384.h for libnetbsd, added to libmd in r292782
.if ${BOOTSTRAPPING} < 1100093
@@ -2391,6 +2405,7 @@ bootstrap-tools: ${_bt}-links .PHONY
usr.bin/xinstall \
${_gensnmptree} \
usr.sbin/config \
${_flua} \
${_crunchide} \
${_crunchgen} \
${_nmtree} \

+ 13
- 0
UPDATING View File

@@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)

20191120:
The amd(8) automount daemon has been disabled by default, and will be
removed in the future. As of FreeBSD 10.1 the autofs(5) is available
for automounting.

20191120:
Defining the long deprecated NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB,
NO_MAN, NO_PROFILE, and NO_WARNS variables is now an error. Update
your Makefiles and scripts to define MK_<var>=no instead as required.

One exception to this is that program or library Makefiles should
define MAN to empty rather than setting MK_MAN=no.

20191107:
The nctgpio and wbwd drivers have been moved to the superio bus.
If you have one of these drivers in a kernel configuration, then

+ 1
- 1
cddl/contrib/opensolaris/cmd/dtrace/dtrace.c View File

@@ -681,7 +681,7 @@ anon_prog(const dtrace_cmd_t *dcp, dof_hdr_t *dof, int n)
dfatal("failed to create DOF image for '%s'", dcp->dc_name);

p = (uchar_t *)dof;
q = p + dof->dofh_loadsz;
q = p + dof->dofh_filesz;

#ifdef __FreeBSD__
/*

+ 14
- 43
cddl/contrib/opensolaris/cmd/zpool/zpool.8 View File

@@ -829,13 +829,13 @@ When a pool is determined to be active it cannot be imported, even with the
option.
This property is intended to be used in failover configurations
where multiple hosts have access to a pool on shared storage.
.sp
.Pp
Multihost provides protection on import only.
It does not protect against an
individual device being used in multiple pools, regardless of the type of vdev.
See the discussion under
.Sy zpool create.
.sp
.Pp
When this property is on, periodic writes to storage occur to show the pool is
in use.
See
@@ -896,10 +896,6 @@ Displays the configuration that would be used without actually adding the
.Ar vdev Ns s.
The actual pool creation can still fail due to insufficient privileges or device
sharing.
.Pp
Do not add a disk that is currently configured as a quorum device to a zpool.
After a disk is in the pool, that disk can then be configured as a quorum
device.
.El
.It Xo
.Nm
@@ -975,9 +971,14 @@ Discards an existing checkpoint from
.Op Ar device
.Xc
.Pp
Clears device errors in a pool. If no arguments are specified, all device
errors within the pool are cleared. If one or more devices is specified, only
those errors associated with the specified device or devices are cleared.
Clears device errors in a pool.
If no arguments are specified, all device errors within the pool are cleared.
If one or more devices is specified, only those errors associated with the
specified device or devices are cleared.
If multihost is enabled, and the pool has been suspended, this will not
resume I/O.
While the pool was suspended, it may have been imported on
another host, and resuming I/O could result in pool damage.
.Bl -tag -width indent
.It Fl F
Initiates recovery mode for an unopenable pool. Attempts to discard the last
@@ -988,22 +989,8 @@ discarded transactions is irretrievably lost.
Used in combination with the
.Fl F
flag. Check whether discarding transactions would make the pool openable, but
<<<<<<<
do not actually discard any transactions.
.El
|||||||
If no arguments are specified, all device errors within the pool are cleared.
If one or more devices is specified, only those errors associated with the
specified device or devices are cleared.
=======
If no arguments are specified, all device errors within the pool are cleared.
If one or more devices is specified, only those errors associated with the
specified device or devices are cleared.
If multihost is enabled, and the pool has been suspended, this will not
resume I/O.
While the pool was suspended, it may have been imported on
another host, and resuming I/O could result in pool damage.
>>>>>>>
.It Xo
.Nm
.Cm create
@@ -1028,15 +1015,6 @@ specification is described in the
.Qq Sx Virtual Devices
section.
.Pp
<<<<<<<
The command verifies that each device specified is accessible and not currently
|||||||
The command verifies that each device specified is accessible and not currently
in use by another subsystem.
There are some uses, such as being currently mounted, or specified as the
dedicated dump device, that prevents a device from ever being used by ZFS.
Other uses, such as having a preexisting UFS file system, can be overridden with
=======
The command attempts to verify that each device specified is accessible and not
currently in use by another subsystem.
However this check is not robust enough
@@ -1054,18 +1032,11 @@ or
do not refer to the same device.
Using the same device in two pools will
result in pool corruption.
.sp
.Pp
There are some uses, such as being currently mounted, or specified as the
dedicated dump device, that prevents a device from ever being used by ZFS.
Other uses, such as having a preexisting UFS file system, can be overridden with
>>>>>>>
in use by another subsystem. There are some uses, such as being currently
mounted, or specified as the dedicated dump device, that prevents a device from
ever being used by
.Tn ZFS
Other uses, such as having a preexisting
.Sy UFS
file system, can be overridden with the
Other uses, such as having a preexisting UFS file system, can be overridden
with the
.Fl f
option.
.Pp
@@ -1720,7 +1691,7 @@ devices in this pool are online and healthy before performing this action.
Removes the specified device from the pool.
This command currently only supports removing hot spares, cache, log
devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
.sp
.Pp
Removing a top-level vdev reduces the total amount of space in the storage pool.
The specified device will be evacuated by copying all allocated space from it to
the other devices in the pool.

+ 1
- 1
contrib/bsnmp/lib/snmpclient.c View File

@@ -480,7 +480,7 @@ table_check_response(struct tabwork *work, const struct snmp_pdu *resp)
if (snmp_client.version == SNMP_V1 &&
resp->error_status == SNMP_ERR_NOSUCHNAME &&
resp->error_index ==
(work->descr->last_change.len == 0) ? 1 : 2)
((work->descr->last_change.len == 0) ? 1 : 2))
/* EOT */
return (0);
/* Error */

+ 1
- 3
contrib/bsnmp/snmpd/trans_inet.c View File

@@ -458,12 +458,10 @@ struct inet_port_params {
static int
ipv4_create(struct inet_port *port, struct inet_port_params *params)
{
uint32_t ip;

if (params->addr_len != 4)
return (SNMP_ERR_INCONS_VALUE);

memcpy(&ip, params->addr, 4);
struct port_sock *sock = calloc(1, sizeof(struct port_sock));
if (sock == NULL)
return (SNMP_ERR_GENERR);
@@ -477,8 +475,8 @@ ipv4_create(struct inet_port *port, struct inet_port_params *params)

sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = htonl(ip);
sin->sin_port = htons(params->port);
memcpy(&sin->sin_addr, params->addr, 4); /* network byte order */

sock->port = port;


+ 2
- 0
contrib/elftoolchain/readelf/readelf.c View File

@@ -1180,6 +1180,8 @@ note_type_freebsd_core(unsigned int nt)
case 15: return "NT_PROCSTAT_PSSTRINGS";
case 16: return "NT_PROCSTAT_AUXV";
case 17: return "NT_PTLWPINFO";
case 0x100: return "NT_PPC_VMX (ppc Altivec registers)";
case 0x102: return "NT_PPC_VSX (ppc VSX registers)";
case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)";
case 0x400: return "NT_ARM_VFP (arm VFP registers)";
default: return (note_type_unknown(nt));

+ 1
- 1
crypto/openssh/monitor.c View File

@@ -193,7 +193,7 @@ struct mon_table mon_dispatch_proto20[] = {
#endif
{MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign},
#ifdef HAVE_LOGIN_CAP
{MONITOR_REQ_GETPWCLASS, MON_AUTH, mm_answer_login_getpwclass},
{MONITOR_REQ_GETPWCLASS, MON_ISAUTH, mm_answer_login_getpwclass},
#endif
{MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow},
{MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv},

+ 2
- 0
etc/mtree/BSD.root.dist View File

@@ -18,6 +18,8 @@
rockchip tags=package=runtime
..
..
efi
..
firmware
..
lua

+ 6
- 0
lib/clang/libclang/Makefile View File

@@ -20,6 +20,12 @@ CXXFLAGS.Module.cpp+= -fpermissive

SRCDIR= tools/clang/lib

# Explanation of different SRCS variants below:
# SRCS_MIN: always required, even for bootstrap
# SRCS_EXT: required for MK_CLANG_EXTRAS
# SRCS_FUL: required for MK_CLANG_FULL
# SRCS_LDB: required for MK_LLDB

SRCS_FUL+= ARCMigrate/ARCMT.cpp
SRCS_FUL+= ARCMigrate/ARCMTActions.cpp
SRCS_FUL+= ARCMigrate/FileRemapper.cpp

+ 11
- 0
lib/clang/libllvm/Makefile View File

@@ -26,6 +26,17 @@ CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch}

SRCDIR= lib

# Explanation of different SRCS variants below:
# SRCS_MIN: always required, even for bootstrap
# SRCS_MIW: required for world stage (after cross-tools)
# SRCS_EXT: required for MK_CLANG_EXTRAS
# SRCS_EXL: required for MK_CLANG_EXTRAS and MK_LLD
# SRCS_FUL: required for MK_CLANG_FULL
# SRCS_LLD: required for MK_LLD
# SRCS_XDB: required for MK_CLANG_EXTRAS and MK_LLDB
# SRCS_XDL: required for MK_CLANG_EXTRAS, MK_LLD and MK_LLDB
# SRCS_XDW: required for MK_CLANG_EXTRAS and MK_LLDB in world stage

SRCS_MIN+= Analysis/AliasAnalysis.cpp
SRCS_MIN+= Analysis/AliasAnalysisEvaluator.cpp
SRCS_MIN+= Analysis/AliasAnalysisSummary.cpp

+ 0
- 1
lib/clang/libllvmminimal/Makefile View File

@@ -10,7 +10,6 @@ SRCS+= Demangle/ItaniumDemangle.cpp
SRCS+= Support/APFloat.cpp
SRCS+= Support/APInt.cpp
SRCS+= Support/ARMTargetParser.cpp
#SRCS+= Support/Atomic.cpp
SRCS+= Support/CodeGenCoverage.cpp
SRCS+= Support/CommandLine.cpp
SRCS+= Support/ConvertUTF.cpp

+ 1
- 1
lib/geom/part/gpart.8 View File

@@ -704,7 +704,7 @@ for APM,
for GPT, and 0x0904 for VTOC8.
.El
.Pp
Another symbolic names that can be used with
Other symbolic names that can be used with
.Cm gpart
utility are:
.Bl -tag -width ".Cm dragonfly-disklabel64"

+ 1
- 0
libexec/Makefile View File

@@ -8,6 +8,7 @@ SUBDIR= ${_atf} \
${_blacklistd-helper} \
${_comsat} \
${_dma} \
flua \
getty \
${_mail.local} \
${_makewhatis.local} \

+ 38
- 0
libexec/flua/Makefile View File

@@ -0,0 +1,38 @@
#! $FreeBSD$

.include <src.lua.mk>

LUASRC?= ${SRCTOP}/contrib/lua/src
.PATH: ${LUASRC}

PROG= flua
WARNS?= 2
MAN= # No manpage; this is internal.

CWARNFLAGS.gcc+= -Wno-format-nonliteral

LIBADD= m

# Core functions
SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \
lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \
ltm.c lundump.c lvm.c lzio.c

# Library functions; any change to these likely needs an accompanying change
# in our custom linit_flua.c. We use our custom linit.c to make it easier to
# support bootstrap flua that may not have supporting local libraries.
SRCS+= lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c \
lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c

# Entry point
SRCS+= lua.c

# FreeBSD Extensions
.PATH: ${.CURDIR}/modules
SRCS+= linit_flua.c
SRCS+= lfs.c lposix.c

CFLAGS+= -I${.CURDIR} -I${.CURDIR}/modules -I${LUASRC}
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""

.include <bsd.prog.mk>

+ 73
- 0
libexec/flua/linit_flua.c View File

@@ -0,0 +1,73 @@
/* $FreeBSD$ */
/*
** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $
** Initialization of libraries for lua.c and other clients
** See Copyright Notice in lua.h
*/


#define linit_c
#define LUA_LIB

/*
** If you embed Lua in your program and need to open the standard
** libraries, call luaL_openlibs in your program. If you need a
** different set of libraries, copy this file to your project and edit
** it to suit your needs.
**
** You can also *preload* libraries, so that a later 'require' can
** open the library, which is already linked to the application.
** For that, do the following code:
**
** luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE);
** lua_pushcfunction(L, luaopen_modname);
** lua_setfield(L, -2, modname);
** lua_pop(L, 1); // remove PRELOAD table
*/

#include "lprefix.h"


#include <stddef.h>

#include "lua.h"

#include "lualib.h"
#include "lauxlib.h"
#include "lfs.h"
#include "lposix.h"

/*
** these libs are loaded by lua.c and are readily available to any Lua
** program
*/
static const luaL_Reg loadedlibs[] = {
{"_G", luaopen_base},
{LUA_LOADLIBNAME, luaopen_package},
{LUA_COLIBNAME, luaopen_coroutine},
{LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
{LUA_OSLIBNAME, luaopen_os},
{LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math},
{LUA_UTF8LIBNAME, luaopen_utf8},
{LUA_DBLIBNAME, luaopen_debug},
#if defined(LUA_COMPAT_BITLIB)
{LUA_BITLIBNAME, luaopen_bit32},
#endif
/* FreeBSD Extensions */
{"lfs", luaopen_lfs},
{"posix.unistd", luaopen_posix_unistd},
{NULL, NULL}
};


LUALIB_API void luaL_openlibs (lua_State *L) {
const luaL_Reg *lib;
/* "require" functions from 'loadedlibs' and set results to global table */
for (lib = loadedlibs; lib->func; lib++) {
luaL_requiref(L, lib->name, lib->func, 1);
lua_pop(L, 1); /* remove lib */
}
}


+ 795
- 0
libexec/flua/luaconf.h View File

@@ -0,0 +1,795 @@
/* $FreeBSD$ */
/*
** $Id: luaconf.h,v 1.259.1.1 2017/04/19 17:29:57 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/


#ifndef luaconf_h
#define luaconf_h

#include <limits.h>
#include <stddef.h>


/*
** ===================================================================
** Search for "@@" to find all configurable definitions.
** ===================================================================
*/


/*
** {====================================================================
** System Configuration: macros to adapt (if needed) Lua to some
** particular platform, for instance compiling it with 32-bit numbers or
** restricting it to C89.
** =====================================================================
*/

/*
@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
** can also define LUA_32BITS in the make file, but changing here you
** ensure that all software connected to Lua will be compiled with the
** same configuration.
*/
/* #define LUA_32BITS */


/*
@@ LUA_USE_C89 controls the use of non-ISO-C89 features.
** Define it if you want Lua to avoid the use of a few C99 features
** or Windows-specific features on Windows.
*/
/* #define LUA_USE_C89 */


/*
** By default, Lua on Windows use (some) specific Windows features
*/
#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE)
#define LUA_USE_WINDOWS /* enable goodies for regular Windows */
#endif


#if defined(LUA_USE_WINDOWS)
#define LUA_DL_DLL /* enable support for DLL */
#define LUA_USE_C89 /* broadly, Windows is C89 */
#endif


#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
#endif


#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* MacOS does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
#endif

/* Local modifications: need io.popen */
#ifdef __FreeBSD__
#define LUA_USE_POSIX
#endif

/*
@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
** C89 ('long' and 'double'); Windows always has '__int64', so it does
** not need to use this case.
*/
#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
#define LUA_C89_NUMBERS
#endif



/*
@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'.
*/
/* avoid undefined shifts */
#if ((INT_MAX >> 15) >> 15) >= 1
#define LUAI_BITSINT 32
#else
/* 'int' always must have at least 16 bits */
#define LUAI_BITSINT 16
#endif


/*
@@ LUA_INT_TYPE defines the type for Lua integers.
@@ LUA_FLOAT_TYPE defines the type for Lua floats.
** Lua should work fine with any mix of these options (if supported
** by your C compiler). The usual configurations are 64-bit integers
** and 'double' (the default), 32-bit integers and 'float' (for
** restricted platforms), and 'long'/'double' (for C compilers not
** compliant with C99, which may not have support for 'long long').
*/

/* predefined options for LUA_INT_TYPE */
#define LUA_INT_INT 1
#define LUA_INT_LONG 2
#define LUA_INT_LONGLONG 3

/* predefined options for LUA_FLOAT_TYPE */
#define LUA_FLOAT_FLOAT 1
#define LUA_FLOAT_DOUBLE 2
#define LUA_FLOAT_LONGDOUBLE 3

#if defined(LUA_32BITS) /* { */
/*
** 32-bit integers and 'float'
*/
#if LUAI_BITSINT >= 32 /* use 'int' if big enough */
#define LUA_INT_TYPE LUA_INT_INT
#else /* otherwise use 'long' */
#define LUA_INT_TYPE LUA_INT_LONG
#endif
#define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT

#elif defined(LUA_C89_NUMBERS) /* }{ */
/*
** largest types available for C89 ('long' and 'double')
*/
#define LUA_INT_TYPE LUA_INT_LONG
#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE

#endif /* } */


/*
** default configuration for 64-bit Lua ('long long' and 'double')
*/
#if !defined(LUA_INT_TYPE)
#define LUA_INT_TYPE LUA_INT_LONGLONG
#endif

#if !defined(LUA_FLOAT_TYPE)
#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE
#endif

/* }================================================================== */




/*
** {==================================================================
** Configuration for Paths.
** ===================================================================
*/

/*
** LUA_PATH_SEP is the character that separates templates in a path.
** LUA_PATH_MARK is the string that marks the substitution points in a
** template.
** LUA_EXEC_DIR in a Windows path is replaced by the executable's
** directory.
*/
#define LUA_PATH_SEP ";"
#define LUA_PATH_MARK "?"
#define LUA_EXEC_DIR "!"


/*
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
** Lua libraries.
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
** C libraries.
** CHANGE them if your machine has a non-conventional directory
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#if defined(_WIN32) /* { */
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
#define LUA_LDIR "!\\lua\\"
#define LUA_CDIR "!\\"
#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \
LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
".\\?.lua;" ".\\?\\init.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.dll;" \
LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
LUA_CDIR"loadall.dll;" ".\\?.dll"

#else /* }{ */

#define LUA_ROOT "/usr/local/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
"./?.lua;" "./?/init.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
#endif /* } */


/*
@@ LUA_DIRSEP is the directory separator (for submodules).
** CHANGE it if your machine does not use "/" as the directory separator
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
#define LUA_DIRSEP "\\"
#else
#define LUA_DIRSEP "/"
#endif

/* }================================================================== */


/*
** {==================================================================
** Marks for exported symbols in the C code
** ===================================================================
*/

/*
@@ LUA_API is a mark for all core API functions.
@@ LUALIB_API is a mark for all auxiliary library functions.
@@ LUAMOD_API is a mark for all standard library opening functions.
** CHANGE them if you need to define those functions in some special way.
** For instance, if you want to create one Windows DLL with the core and
** the libraries, you may want to use the following definition (define
** LUA_BUILD_AS_DLL to get it).
*/
#if defined(LUA_BUILD_AS_DLL) /* { */

#if defined(LUA_CORE) || defined(LUA_LIB) /* { */
#define LUA_API __declspec(dllexport)
#else /* }{ */
#define LUA_API __declspec(dllimport)
#endif /* } */

#else /* }{ */

#define LUA_API extern

#endif /* } */


/* more often than not the libs go together with the core */
#define LUALIB_API LUA_API
#define LUAMOD_API LUALIB_API


/*
@@ LUAI_FUNC is a mark for all extern functions that are not to be
** exported to outside modules.
@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
** that are not to be exported to outside modules (LUAI_DDEF for
** definitions and LUAI_DDEC for declarations).
** CHANGE them if you need to mark them in some special way. Elf/gcc
** (versions 3.2 and later) mark them as "hidden" to optimize access
** when Lua is compiled as a shared library. Not all elf targets support
** this attribute. Unfortunately, gcc does not offer a way to check
** whether the target offers that support, and those without support
** give a warning about it. To avoid these warnings, change to the
** default definition.
*/
#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__) /* { */
#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
#else /* }{ */
#define LUAI_FUNC extern
#endif /* } */

#define LUAI_DDEC LUAI_FUNC
#define LUAI_DDEF /* empty */

/* }================================================================== */


/*
** {==================================================================
** Compatibility with previous versions
** ===================================================================
*/

/*
@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2.
@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1.
** You can define it to get all options, or change specific options
** to fit your specific needs.
*/
#if defined(LUA_COMPAT_5_2) /* { */

/*
@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated
** functions in the mathematical library.
*/
#define LUA_COMPAT_MATHLIB

/*
@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'.
*/
#define LUA_COMPAT_BITLIB

/*
@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod.
*/
#define LUA_COMPAT_IPAIRS

/*
@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
** luaL_checkint, luaL_checklong, etc.)
*/
#define LUA_COMPAT_APIINTCASTS

#endif /* } */


#if defined(LUA_COMPAT_5_1) /* { */

/* Incompatibilities from 5.2 -> 5.3 */
#define LUA_COMPAT_MATHLIB
#define LUA_COMPAT_APIINTCASTS

/*
@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
** You can replace it with 'table.unpack'.
*/
#define LUA_COMPAT_UNPACK

/*
@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'.
** You can replace it with 'package.searchers'.
*/
#define LUA_COMPAT_LOADERS

/*
@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
** You can call your C function directly (with light C functions).
*/
#define lua_cpcall(L,f,u) \
(lua_pushcfunction(L, (f)), \
lua_pushlightuserdata(L,(u)), \
lua_pcall(L,1,0,0))


/*
@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library.
** You can rewrite 'log10(x)' as 'log(x, 10)'.
*/
#define LUA_COMPAT_LOG10

/*
@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base
** library. You can rewrite 'loadstring(s)' as 'load(s)'.
*/
#define LUA_COMPAT_LOADSTRING

/*
@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library.
*/
#define LUA_COMPAT_MAXN

/*
@@ The following macros supply trivial compatibility for some
** changes in the API. The macros themselves document how to
** change your code to avoid using them.
*/
#define lua_strlen(L,i) lua_rawlen(L, (i))

#define lua_objlen(L,i) lua_rawlen(L, (i))

#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT)

/*
@@ LUA_COMPAT_MODULE controls compatibility with previous
** module functions 'module' (Lua) and 'luaL_register' (C).
*/
#define LUA_COMPAT_MODULE

#endif /* } */


/*
@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a
@@ a float mark ('.0').
** This macro is not on by default even in compatibility mode,
** because this is not really an incompatibility.
*/
/* #define LUA_COMPAT_FLOATSTRING */

/* }================================================================== */



/*
** {==================================================================
** Configuration for Numbers.
** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_*
** satisfy your needs.
** ===================================================================
*/

/*
@@ LUA_NUMBER is the floating-point type used by Lua.
@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
@@ over a floating number.
@@ l_mathlim(x) corrects limit name 'x' to the proper float type
** by prefixing it with one of FLT/DBL/LDBL.
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
@@ LUA_NUMBER_FMT is the format for writing floats.
@@ lua_number2str converts a float to a string.
@@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
@@ l_floor takes the floor of a float.
@@ lua_str2number converts a decimal numeric string to a number.
*/


/* The following definitions are good for most cases here */

#define l_floor(x) (l_mathop(floor)(x))

#define lua_number2str(s,sz,n) \
l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n))

/*
@@ lua_numbertointeger converts a float number to an integer, or
** returns 0 if float is not within the range of a lua_Integer.
** (The range comparisons are tricky because of rounding. The tests
** here assume a two-complement representation, where MININTEGER always
** has an exact representation as a float; MAXINTEGER may not have one,
** and therefore its conversion to float may have an ill-defined value.)
*/
#define lua_numbertointeger(n,p) \
((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \
(n) < -(LUA_NUMBER)(LUA_MININTEGER) && \
(*(p) = (LUA_INTEGER)(n), 1))


/* now the variable definitions */

#if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */

#define LUA_NUMBER float

#define l_mathlim(n) (FLT_##n)

#define LUAI_UACNUMBER double

#define LUA_NUMBER_FRMLEN ""
#define LUA_NUMBER_FMT "%.7g"

#define l_mathop(op) op##f

#define lua_str2number(s,p) strtof((s), (p))


#elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */

#define LUA_NUMBER long double

#define l_mathlim(n) (LDBL_##n)

#define LUAI_UACNUMBER long double

#define LUA_NUMBER_FRMLEN "L"
#define LUA_NUMBER_FMT "%.19Lg"

#define l_mathop(op) op##l

#define lua_str2number(s,p) strtold((s), (p))

#elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */

#define LUA_NUMBER double

#define l_mathlim(n) (DBL_##n)

#define LUAI_UACNUMBER double

#define LUA_NUMBER_FRMLEN ""
#define LUA_NUMBER_FMT "%.14g"

#define l_mathop(op) op

#define lua_str2number(s,p) strtod((s), (p))

#else /* }{ */

#error "numeric float type not defined"

#endif /* } */



/*
@@ LUA_INTEGER is the integer type used by Lua.
**
@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
**
@@ LUAI_UACINT is the result of a 'default argument promotion'
@@ over a lUA_INTEGER.
@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
@@ LUA_INTEGER_FMT is the format for writing integers.
@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
@@ lua_integer2str converts an integer to a string.
*/


/* The following definitions are good for most cases here */

#define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d"

#define LUAI_UACINT LUA_INTEGER

#define lua_integer2str(s,sz,n) \
l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n))

/*
** use LUAI_UACINT here to avoid problems with promotions (which
** can turn a comparison between unsigneds into a signed comparison)
*/
#define LUA_UNSIGNED unsigned LUAI_UACINT


/* now the variable definitions */

#if LUA_INT_TYPE == LUA_INT_INT /* { int */

#define LUA_INTEGER int
#define LUA_INTEGER_FRMLEN ""

#define LUA_MAXINTEGER INT_MAX
#define LUA_MININTEGER INT_MIN

#elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */

#define LUA_INTEGER long
#define LUA_INTEGER_FRMLEN "l"

#define LUA_MAXINTEGER LONG_MAX
#define LUA_MININTEGER LONG_MIN

#elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */

/* use presence of macro LLONG_MAX as proxy for C99 compliance */
#if defined(LLONG_MAX) /* { */
/* use ISO C99 stuff */

#define LUA_INTEGER long long
#define LUA_INTEGER_FRMLEN "ll"

#define LUA_MAXINTEGER LLONG_MAX
#define LUA_MININTEGER LLONG_MIN

#elif defined(LUA_USE_WINDOWS) /* }{ */
/* in Windows, can use specific Windows types */

#define LUA_INTEGER __int64
#define LUA_INTEGER_FRMLEN "I64"

#define LUA_MAXINTEGER _I64_MAX
#define LUA_MININTEGER _I64_MIN

#else /* }{ */

#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"

#endif /* } */

#else /* }{ */

#error "numeric integer type not defined"

#endif /* } */

/* }================================================================== */


/*
** {==================================================================
** Dependencies with C99 and other C details
** ===================================================================
*/

/*
@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89.
** (All uses in Lua have only one format item.)
*/
#if !defined(LUA_USE_C89)
#define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i)
#else
#define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i))
#endif


/*
@@ lua_strx2number converts an hexadecimal numeric string to a number.
** In C99, 'strtod' does that conversion. Otherwise, you can
** leave 'lua_strx2number' undefined and Lua will provide its own
** implementation.
*/
#if !defined(LUA_USE_C89)
#define lua_strx2number(s,p) lua_str2number(s,p)
#endif


/*
@@ lua_pointer2str converts a pointer to a readable string in a
** non-specified way.
*/
#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p)


/*
@@ lua_number2strx converts a float to an hexadecimal numeric string.
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
** provide its own implementation.
*/
#if !defined(LUA_USE_C89)
#define lua_number2strx(L,b,sz,f,n) \
((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n)))
#endif


/*
** 'strtof' and 'opf' variants for math functions are not valid in
** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the
** availability of these variants. ('math.h' is already included in
** all files that use these macros.)
*/
#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
#undef l_mathop /* variants not available */
#undef lua_str2number
#define l_mathop(op) (lua_Number)op /* no variant */
#define lua_str2number(s,p) ((lua_Number)strtod((s), (p)))
#endif


/*
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
** functions. It must be a numerical type; Lua will use 'intptr_t' if
** available, otherwise it will use 'ptrdiff_t' (the nearest thing to
** 'intptr_t' in C89)
*/
#define LUA_KCONTEXT ptrdiff_t

#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
__STDC_VERSION__ >= 199901L
#include <stdint.h>
#if defined(INTPTR_MAX) /* even in C99 this type is optional */
#undef LUA_KCONTEXT
#define LUA_KCONTEXT intptr_t
#endif
#endif


/*
@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point).
** Change that if you do not want to use C locales. (Code using this
** macro must include header 'locale.h'.)
*/
#if !defined(lua_getlocaledecpoint)
#define lua_getlocaledecpoint() (localeconv()->decimal_point[0])
#endif

/* }================================================================== */


/*
** {==================================================================
** Language Variations
** =====================================================================
*/

/*
@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some
** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from
** numbers to strings. Define LUA_NOCVTS2N to turn off automatic
** coercion from strings to numbers.
*/
/* #define LUA_NOCVTN2S */
/* #define LUA_NOCVTS2N */


/*
@@ LUA_USE_APICHECK turns on several consistency checks on the C API.
** Define it as a help when debugging C code.
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(l,e) assert(e)
#endif

/* }================================================================== */


/*
** {==================================================================
** Macros that affect the API and must be stable (that is, must be the
** same when you compile Lua and when you compile code that links to
** Lua). You probably do not want/need to change them.
** =====================================================================
*/

/*
@@ LUAI_MAXSTACK limits the size of the Lua stack.
** CHANGE it if you need a different limit. This limit is arbitrary;
** its only purpose is to stop Lua from consuming unlimited stack
** space (and to reserve some numbers for pseudo-indices).
*/
#if LUAI_BITSINT >= 32
#define LUAI_MAXSTACK 1000000
#else
#define LUAI_MAXSTACK 15000
#endif


/*
@@ LUA_EXTRASPACE defines the size of a raw memory area associated with
** a Lua state with very fast access.
** CHANGE it if you need a different size.
*/
#define LUA_EXTRASPACE (sizeof(void *))


/*
@@ LUA_IDSIZE gives the maximum size for the description of the source
@@ of a function in debug information.
** CHANGE it if you want a different size.
*/
#define LUA_IDSIZE 60


/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
** CHANGE it if it uses too much C-stack space. (For long double,
** 'string.format("%.99f", -1e4932)' needs 5034 bytes, so a
** smaller buffer would force a memory allocation for each call to
** 'string.format'.)
*/
#if LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE
#define LUAL_BUFFERSIZE 8192
#else
#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer)))
#endif

/* }================================================================== */


/*
@@ LUA_QL describes how error messages quote program elements.
** Lua does not use these macros anymore; they are here for
** compatibility only.
*/
#define LUA_QL(x) "'" x "'"
#define LUA_QS LUA_QL("%s")




/* =================================================================== */

/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
*/





#endif


stand/liblua/lfs.c → libexec/flua/modules/lfs.c View File

@@ -52,12 +52,24 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef _STANDALONE
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#endif

#include <lua.h>
#include "lauxlib.h"
#include "lfs.h"

#ifdef _STANDALONE
#include "lstd.h"
#include "lutils.h"
#include "bootstrap.h"
#endif

#ifndef nitems
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
@@ -120,7 +132,11 @@ lua_dir_iter_next(lua_State *L)
dp = *dpp;
luaL_argcheck(L, dp != NULL, 1, "closed directory");

#ifdef _STANDALONE
entry = readdirfd(dp->fd);
#else
entry = readdir(dp);
#endif
if (entry == NULL) {
closedir(dp);
*dpp = NULL;
@@ -325,10 +341,76 @@ lua_attributes(lua_State *L)
return 1;
}

#ifndef _STANDALONE
#define lfs_mkdir_impl(path) (mkdir((path), \
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | \
S_IROTH | S_IXOTH))

static int
lua_mkdir(lua_State *L)
{
const char *path;
int error, serrno;

path = luaL_checkstring(L, 1);
if (path == NULL) {
lua_pushnil(L);
lua_pushfstring(L, "cannot convert first argument to string");
lua_pushinteger(L, EINVAL);
return 3;
}

error = lfs_mkdir_impl(path);
if (error == -1) {
/* Save it; unclear what other libc functions may be invoked */
serrno = errno;
lua_pushnil(L);
lua_pushfstring(L, strerror(serrno));
lua_pushinteger(L, serrno);
return 3;
}

lua_pushboolean(L, 1);
return 1;
}

static int
lua_rmdir(lua_State *L)
{
const char *path;
int error, serrno;

path = luaL_checkstring(L, 1);
if (path == NULL) {
lua_pushnil(L);
lua_pushfstring(L, "cannot convert first argument to string");
lua_pushinteger(L, EINVAL);
return 3;
}

error = rmdir(path);
if (error == -1) {
/* Save it; unclear what other libc functions may be invoked */
serrno = errno;
lua_pushnil(L);
lua_pushfstring(L, strerror(serrno));
lua_pushinteger(L, serrno);
return 3;
}

lua_pushboolean(L, 1);
return 1;
}
#endif

#define REG_SIMPLE(n) { #n, lua_ ## n }
static const struct luaL_Reg fslib[] = {
REG_SIMPLE(attributes),
REG_SIMPLE(dir),
#ifndef _STANDALONE
REG_SIMPLE(mkdir),
REG_SIMPLE(rmdir),
#endif
{ NULL, NULL },
};
#undef REG_SIMPLE

stand/liblua/lfs.h → libexec/flua/modules/lfs.h View File


usr.bin/unifdef/unifdef.h → libexec/flua/modules/lposix.c View File

@@ -1,7 +1,5 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2012 - 2013 Tony Finch <dot@dotat.at>
* Copyright (c) 2019 Kyle Evans <kevans@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,31 +22,42 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/

#include <sys/stat.h>
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include <ctype.h>
#include <err.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

/* portability stubs */
#include <lua.h>
#include "lauxlib.h"
#include "lposix.h"

/*
* Minimal implementation of luaposix needed for internal FreeBSD bits.
*/

static int
lua_getpid(lua_State *L)
{
int n;

#define fbinmode(fp) (fp)
n = lua_gettop(L);
luaL_argcheck(L, n == 0, 1, "too many arguments");
lua_pushinteger(L, getpid());
return 1;
}

#define replace(old,new) rename(old,new)
#define REG_SIMPLE(n) { #n, lua_ ## n }
static const struct luaL_Reg unistdlib[] = {
REG_SIMPLE(getpid),
{ NULL, NULL },
};
#undef REG_SIMPLE

static FILE *
mktempmode(char *tmp, int mode)
int
luaopen_posix_unistd(lua_State *L)
{
int fd = mkstemp(tmp);
if (fd < 0) return (NULL);
fchmod(fd, mode & (S_IRWXU|S_IRWXG|S_IRWXO));
return (fdopen(fd, "wb"));
luaL_newlib(L, unistdlib);
return 1;
}

+ 11
- 0
libexec/flua/modules/lposix.h View File

@@ -0,0 +1,11 @@
/*-
*
* This file is in the public domain.
*/
/* $FreeBSD$ */

#pragma once

#include <lua.h>

int luaopen_posix_unistd(lua_State *L);

+ 87
- 53
share/man/man5/src.conf.5 View File

@@ -1,6 +1,10 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.\" $FreeBSD$
<<<<<<< HEAD
.Dd October 25, 2019
=======
.Dd November 20, 2019
>>>>>>> upstream/master
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -100,8 +104,8 @@ Set to not build
.Xr acpiconf 8 ,
.Xr acpidump 8
and related programs.
.It Va WITHOUT_AMD
Set to not build
.It Va WITH_AMD
Set to build
.Xr amd 8 ,
and related programs.
.It Va WITHOUT_APM
@@ -197,7 +201,7 @@ as part
of the normal system build.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITHOUT_BINUTILS_BOOTSTRAP
Set to not build binutils (as, ld, and objdump)
as part of the bootstrap process.
@@ -213,7 +217,7 @@ Set build binutils (as, ld, and objdump)
as part of the bootstrap process.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITHOUT_BLACKLIST
Set this if you do not want to build
.Xr blacklistd 8
@@ -268,7 +272,7 @@ and
.Pa crtend.o .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_BSD_GREP
Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
.It Va WITHOUT_BSNMP
@@ -375,7 +379,7 @@ amd64/amd64 and arm64/aarch64.
Set to not build the Clang C/C++ compiler during the regular phase of the build.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
When set, it enforces these options:
.Pp
.Bl -item -compact
@@ -412,6 +416,10 @@ is set explicitly)
(unless
.Va WITH_LLVM_TARGET_POWERPC
is set explicitly)
.It Va WITHOUT_LLVM_TARGET_RISCV
(unless
.Va WITH_LLVM_TARGET_RISCV
is set explicitly)
.It Va WITHOUT_LLVM_TARGET_SPARC
(unless
.Va WITH_LLVM_TARGET_SPARC
@@ -425,7 +433,7 @@ is set explicitly)
Set to build the Clang C/C++ compiler during the normal phase of the build.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_CLANG_BOOTSTRAP
Set to not build the Clang C/C++ compiler during the bootstrap phase of
the build.
@@ -438,7 +446,7 @@ riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32,
Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITH_CLANG_EXTRAS
Set to build additional clang and llvm tools, such as bugpoint and
clang-format.
@@ -450,13 +458,13 @@ Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
the Clang C/C++ compiler.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
.It Va WITH_CLANG_FULL
Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
Clang C/C++ compiler.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_CLANG_IS_CC
Set to install the GCC compiler as
.Pa /usr/bin/cc ,
@@ -474,7 +482,7 @@ and
.Pa /usr/bin/cpp .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITHOUT_CPP
Set to not build
.Xr cpp 1 .
@@ -541,7 +549,7 @@ Set to not build
.Xr cxgbetool 8
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_CXGBETOOL
Set to build
.Xr cxgbetool 8
@@ -723,7 +731,7 @@ and
.Xr efivar 8 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
Set to not build ELF Tool Chain tools
(addr2line, nm, size, strings and strip)
@@ -781,7 +789,7 @@ Set to not build games.
Set to not build and install gcc and g++ as part of the normal build process.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64.
.It Va WITH_GCC
Set to build and install gcc and g++.
.Pp
@@ -794,7 +802,7 @@ unless an alternative compiler is provided via
XCC.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64.
.It Va WITH_GCC_BOOTSTRAP
Set to build gcc and g++ as part of the bootstrap process.
.Pp
@@ -815,7 +823,7 @@ Set to build
.Xr gdb 1 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITHOUT_GDB_LIBEXEC
Set to install
.Xr gdb 1
@@ -836,13 +844,13 @@ to be used as a fallback for
if a newer version is not installed.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_GNUCXX
Do not build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where clang is the system compiler.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITH_GNUCXX
Build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where gcc is the system compiler.
@@ -876,7 +884,7 @@ Set to build and install
and dependent tests.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64.
.It Va WITHOUT_GPIO
Set to not build
.Xr gpioctl 8
@@ -886,7 +894,7 @@ Set to build the BSD licensed version of the device tree compiler rather
than the GPLed one from elinux.org.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITH_GPL_DTC
Set to build the GPL'd version of the device tree compiler from elinux.org,
instead of the BSD licensed one.
@@ -921,7 +929,7 @@ Set to build and install httpd
Set to not build or install HyperV utilities.
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITH_HYPERV
Set to build or install HyperV utilities.
.Pp
@@ -1070,6 +1078,9 @@ and
On 64-bit platforms, set to build 32-bit library set and a
.Nm ld-elf32.so.1
runtime linker.
.Pp
This is a default setting on
arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64.
.It Va WITHOUT_LIBCPLUSPLUS
Set to avoid building libcxxrt and libc++.
.It Va WITHOUT_LIBPTHREAD
@@ -1097,17 +1108,17 @@ library.
Set to not build LLVM's lld linker.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
.It Va WITH_LLD
Set to build LLVM's lld linker.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLDB
Set to not build the LLDB debugger.
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITH_LLDB
Set to build the LLDB debugger.
.Pp
@@ -1120,6 +1131,7 @@ To be able to build the system, either Binutils or LLD bootstrap must be
enabled unless an alternate linker is provided via XLD.
.Pp
This is a default setting on
<<<<<<< HEAD
arm/arm, arm/armv6, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
When set, it enforces these options:
.Pp
@@ -1129,16 +1141,20 @@ When set, it enforces these options:
.It
.Va WITHOUT_RETPOLINE
.El
=======
riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
>>>>>>> upstream/master
.It Va WITH_LLD_BOOTSTRAP
Set to build the LLD linker during the bootstrap phase of the build,
and use it during buildworld and buildkernel.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITHOUT_LLD_IS_LD
Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.
.Pp
This is a default setting on
<<<<<<< HEAD
arm/arm, arm/armv6, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
When set, it enforces these options:
.Pp
@@ -1148,35 +1164,38 @@ When set, it enforces these options:
.It
.Va WITHOUT_RETPOLINE
.El
=======
riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
>>>>>>> upstream/master
.It Va WITH_LLD_IS_LD
Set to use LLVM's LLD as the system linker, instead of GNU binutils ld.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
.It Va WITHOUT_LLVM_COV
Set to not build the
.Xr llvm-cov 1
tool.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
.It Va WITH_LLVM_COV
Set to build the
.Xr llvm-cov 1
tool.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_LIBUNWIND
Set to use GCC's stack unwinder (instead of LLVM's libunwind).
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7 and sparc64/sparc64.
sparc64/sparc64.
.It Va WITH_LLVM_LIBUNWIND
Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder).
.Pp
This is a default setting on
amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_AARCH64
Set to not build LLVM target support for AArch64.
The
@@ -1184,7 +1203,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_AARCH64
Set to build LLVM target support for AArch64.
The
@@ -1192,13 +1211,13 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_ALL
Set to only build the required LLVM target support.
This option is preferred to specific target support options.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
When set, these options are also in effect:
.Pp
.Bl -inset -compact
@@ -1218,6 +1237,10 @@ is set explicitly)
(unless
.Va WITH_LLVM_TARGET_POWERPC
is set explicitly)
.It Va WITHOUT_LLVM_TARGET_RISCV
(unless
.Va WITH_LLVM_TARGET_RISCV
is set explicitly)
.It Va WITHOUT_LLVM_TARGET_SPARC
(unless
.Va WITH_LLVM_TARGET_SPARC
@@ -1229,7 +1252,7 @@ This option is always applied to the bootstrap compiler for buildworld when
LLVM is used.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_ARM
Set to not build LLVM target support for ARM.
The
@@ -1237,7 +1260,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
riscv/riscv64 and sparc64/sparc64.
sparc64/sparc64.
.It Va WITH_LLVM_TARGET_ARM
Set to build LLVM target support for ARM.
The
@@ -1245,7 +1268,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_LLVM_TARGET_BPF
Set to build LLVM target support for BPF.
The
@@ -1258,7 +1281,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_MIPS
Set to build LLVM target support for MIPS.
The
@@ -1266,7 +1289,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_POWERPC
Set to not build LLVM target support for PowerPC.
The
@@ -1274,7 +1297,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_POWERPC
Set to build LLVM target support for PowerPC.
The
@@ -1282,12 +1305,23 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_RISCV
Set to not build LLVM target support for RISC-V.
The
.Va LLVM_TARGET_ALL
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_RISCV
Set to build LLVM target support for RISC-V.
The
.Va LLVM_TARGET_ALL
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_SPARC
Set to not build LLVM target support for SPARC.
The
@@ -1295,7 +1329,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_SPARC
Set to build LLVM target support for SPARC.
The
@@ -1303,7 +1337,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LLVM_TARGET_X86
Set to not build LLVM target support for X86.
The
@@ -1311,7 +1345,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
arm/armv6 and sparc64/sparc64.
.It Va WITH_LLVM_TARGET_X86
Set to build LLVM target support for X86.
The
@@ -1319,7 +1353,7 @@ The
option should be used rather than this in most cases.
.Pp
This is a default setting on
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_LOADER_EFI_SECUREBOOT
Enable building
.Xr loader 8
@@ -1340,7 +1374,7 @@ sparc64/sparc64.
Set to build GELI bootloader support.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LOADER_LUA
Set to not build LUA bindings for the boot loader.
.Pp
@@ -1350,12 +1384,12 @@ sparc64/sparc64.
Set to build LUA bindings for the boot loader.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITHOUT_LOADER_OFW
Disable building of openfirmware bootloader components.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_LOADER_OFW
Set to build openfirmware bootloader components.
.Pp
@@ -1370,7 +1404,7 @@ amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64.
Set to build ubldr.
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_LOADER_VERBOSE
Set to build with extra verbose debugging in the loader.
May explode already nearly too large loader over the limit.
@@ -1530,7 +1564,7 @@ Set to not build
.Xr mlx5tool 8
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
.It Va WITH_MLX5TOOL
Set to build
.Xr mlx5tool 8
@@ -1601,7 +1635,7 @@ and related programs.
Set to not build nvme related tools and kernel modules.
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITH_NVME
Set to build nvme related tools and kernel modules.

@@ -1622,7 +1656,7 @@ Enable building openldap support for kerberos.
Set to not build LLVM's OpenMP runtime.
.Pp
This is a default setting on
arm/arm, arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
.It Va WITH_OPENMP
Set to build LLVM's OpenMP runtime.
.Pp
@@ -1704,7 +1738,7 @@ Set to build profiled libraries for use with
.Xr gprof 8 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64.
.It Va WITHOUT_QUOTAS
Set to not build
.Xr quota 1
@@ -1816,7 +1850,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf,
Set to build world with propolice stack smashing protection.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64.
amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64.
.It Va WITH_STAGING
Enable staging of files to a stage tree.
This can be best thought of as auto-install to

+ 2
- 0
share/man/man7/hier.7 View File

@@ -53,6 +53,8 @@ Compiled flattened device tree (FDT) files; see
.Xr fdt 4
and
.Xr dtc 1
.It Pa efi/
Mount point for EFI System Partition (ESP) on UEFI systems.
.It Pa firmware/
loadable kernel modules containing binary firmware for hardware that needs
firmware downloaded to it to function

+ 1
- 1
share/mk/bsd.opts.mk View File

@@ -96,7 +96,7 @@ __DEFAULT_DEPENDENT_OPTIONS = \
PROFILE \
WARNS
.if defined(NO_${var})
.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
.error "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
MK_${var}:=no
.endif
.endfor

+ 13
- 0
share/mk/bsd.own.mk View File

@@ -56,6 +56,15 @@
# KMODMODE KLD mode. [${BINMODE}]
#
#
# EFIDIR Base path for the UEFI ESP [/boot/efi]
#
# EFIOWN EFIDIR owner. [root]
#
# EFIGRP EFIDIR group. [wheel]
#
# EFIMODE EFIDIR mode. [555]
#
#
# SHAREDIR Base path for architecture-independent ascii
# text files. [/usr/share]