tools: update versions and sync with upstream v24.10

This commit is contained in:
coolsnowwolf 2024-12-02 18:53:09 +08:00
parent 17731641e4
commit ff5046fa7c
200 changed files with 5767 additions and 3813 deletions

View File

@ -14,7 +14,9 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE direct
world:
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -e '/usr' -e '/nix/store' -m 1)
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
ifneq ($(OPENWRT_BUILD),1)
@ -38,6 +40,9 @@ else
include tools/Makefile
include toolchain/Makefile
# Include the test suite Makefile if it exists
-include tests/Makefile
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)

View File

@ -5,7 +5,6 @@
config EXPERIMENTAL
bool "Enable experimental features by default"
default n
help
Set this option to build with latest bleeding edge features
which may or may not work as expected.
@ -27,6 +26,14 @@ menu "Global build settings"
directory containing machine readable list of built profiles
and resulting images.
config JSON_CYCLONEDX_SBOM
bool "Create CycloneDX SBOM JSON"
default BUILDBOT
help
Create a JSON files *.bom.cdx.json in the build
directory containing Software Bill Of Materials in CycloneDX
format.
config ALL_NONSHARED
bool "Select all target specific packages by default"
select ALL_KMODS
@ -42,7 +49,6 @@ menu "Global build settings"
config BUILDBOT
bool "Set build defaults for automatic builds (e.g. via buildbot)"
default n
help
This option changes several defaults to be more suitable for
automatic builds. This includes the following changes:
@ -62,6 +68,11 @@ menu "Global build settings"
bool "Enable TLS certificate verification during package download"
default y
config USE_APK
imply PACKAGE_apk-mbedtls
bool "Use APK instead of OPKG to build distribution (BROKEN)"
depends on BROKEN
comment "General build options"
config TESTING_KERNEL
@ -75,10 +86,8 @@ menu "Global build settings"
config DISPLAY_SUPPORT
bool "Show packages that require graphics support (local or remote)"
default n
config BUILD_PATENTED
default n
bool "Compile with support for patented functionality"
help
When this option is disabled, software which provides patented functionality
@ -86,7 +95,6 @@ menu "Global build settings"
functionality, this optional support will get disabled for this package.
config BUILD_NLS
default n
bool "Compile with full language support"
help
When this option is enabled, packages are built with the full versions of
@ -100,7 +108,6 @@ menu "Global build settings"
config CLEAN_IPKG
bool
prompt "Remove ipkg/opkg status data files in final images"
default n
help
This removes all ipkg/opkg status data files from the target directory
before building the root filesystem.
@ -108,14 +115,13 @@ menu "Global build settings"
config IPK_FILES_CHECKSUMS
bool
prompt "Record files checksums in package metadata"
default n
depends on !USE_APK
help
This makes file checksums part of package metadata. It increases size
but provides you with pkg_check command to check for flash corruptions.
config INCLUDE_CONFIG
bool "Include build configuration in firmware" if DEVEL
default n
help
If enabled, buildinfo files will be stored in /etc/build.* of firmware.
@ -149,7 +155,6 @@ menu "Global build settings"
config DEBUG
bool
prompt "Compile packages with debugging info"
default n
help
Adds -g3 to the CFLAGS.
@ -168,6 +173,19 @@ menu "Global build settings"
Adds LTO flags to the CFLAGS and LDFLAGS.
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-lto
config MOLD
depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64)
depends on !GCC_USE_VERSION_11
def_bool $(shell, ./config/check-hostcxx.sh 10 2 12)
config USE_MOLD
bool
prompt "Use the mold linker for all packages"
depends on MOLD
help
Link packages with mold, a modern linker
Packages can opt-out via setting PKG_BUILD_FLAGS:=no-mold
config IPV6
def_bool y
@ -207,17 +225,16 @@ menu "Global build settings"
help
Specifies arguments passed to the strip command when stripping binaries.
config SSTRIP_ARGS
string
prompt "Sstrip arguments"
depends on USE_SSTRIP
default "-z"
config SSTRIP_DISCARD_TRAILING_ZEROES
bool "Strip trailing zero bytes"
depends on USE_SSTRIP && !USE_MOLD
default y
help
Specifies arguments passed to the sstrip command when stripping binaries.
Use sstrip's -z option to discard trailing zero bytes
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
depends on !LINUX_6_6
depends on BROKEN
help
Reduces kernel size by stripping unused kernel exports from the kernel
image. Note that this might make the kernel incompatible with any kernel
@ -279,12 +296,22 @@ menu "Global build settings"
Enable GCC Stack Smashing Protection (SSP) for userspace applications
config PKG_CC_STACKPROTECTOR_NONE
bool "None"
help
No stack smashing protection.
config PKG_CC_STACKPROTECTOR_REGULAR
bool "Regular"
help
Protects functions with vulnerable objects.
This includes functions with buffers larger than 8 bytes or calls to alloca.
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
help
Like Regular, but also protects functions with
local arrays or references to local frame addresses.
config PKG_CC_STACKPROTECTOR_ALL
bool "All"
help
Protects all functions.
endchoice
choice
@ -294,10 +321,18 @@ menu "Global build settings"
Enable GCC Stack-Smashing Protection (SSP) for the kernel
config KERNEL_CC_STACKPROTECTOR_NONE
bool "None"
help
No stack smashing protection.
config KERNEL_CC_STACKPROTECTOR_REGULAR
bool "Regular"
help
Protects functions with vulnerable objects.
This includes functions with buffers larger than 8 bytes or calls to alloca.
config KERNEL_CC_STACKPROTECTOR_STRONG
bool "Strong"
help
Like Regular, but also protects functions with
local arrays or references to local frame addresses.
endchoice
config KERNEL_STACKPROTECTOR

View File

@ -4,11 +4,9 @@
menuconfig DEVEL
bool "Advanced configuration options (for developers)"
default n
config BROKEN
bool "Show broken platforms / packages / devices" if DEVEL
default n
config BINARY_FOLDER
string "Binary folder" if DEVEL
@ -53,7 +51,6 @@ menuconfig DEVEL
config AUTOREMOVE
bool "Automatic removal of build directories" if DEVEL
default n
help
Automatically delete build directories after make target completed.
This allows you to symlink build_dir into a scratch location, e.g. a ramdisk,
@ -61,7 +58,6 @@ menuconfig DEVEL
config BUILD_ALL_HOST_TOOLS
bool "Compile all host tools" if DEVEL
default n
help
Compile all host host tools even if not needed. This is needed to prepare a
universal precompiled host tools archive to use in another buildroot.
@ -84,7 +80,6 @@ menuconfig DEVEL
config CCACHE
bool "Use ccache" if DEVEL
default n
help
Compiler cache; see https://ccache.samba.org/

View File

@ -47,12 +47,12 @@ config KERNEL_MIPS_FP_SUPPORT
config KERNEL_ARM_PMU
bool
default y if TARGET_armvirt
default y if TARGET_armsr_armv8
depends on (arm || aarch64)
config KERNEL_ARM_PMUV3
bool
default y if TARGET_armvirt
default y if TARGET_armsr_armv8
depends on (arm_v7 || aarch64) && LINUX_6_6
config KERNEL_RISCV_PMU
@ -66,7 +66,6 @@ config KERNEL_RISCV_PMU_SBI
config KERNEL_X86_VSYSCALL_EMULATION
bool "Enable vsyscall emulation"
default n
depends on x86_64
help
This enables emulation of the legacy vsyscall page. Disabling
@ -84,14 +83,12 @@ config KERNEL_X86_VSYSCALL_EMULATION
config KERNEL_PERF_EVENTS
bool "Compile the kernel with performance events and counters"
default n
select KERNEL_ARM_PMU if (arm || aarch64)
select KERNEL_ARM_PMUV3 if (arm_v7 || aarch64) && LINUX_6_6
select KERNEL_RISCV_PMU if riscv64
config KERNEL_PROFILING
bool "Compile the kernel with profiling enabled"
default n
select KERNEL_PERF_EVENTS
help
Enable the extended profiling support mechanisms used by profilers such
@ -318,7 +315,6 @@ config KERNEL_KCOV_INSTRUMENT_ALL
config KERNEL_TASKSTATS
bool "Compile the kernel with task resource/io statistics and accounting"
default n
help
Enable the collection and publishing of task/io statistics and
accounting. Enable this option to enable i/o monitoring in system
@ -337,6 +333,25 @@ if KERNEL_TASKSTATS
endif
config KERNEL_PSI
bool "Compile the kernel with pressure stall information tracking"
help
Collect metrics that indicate how overcommitted the CPU, memory,
and IO capacity are in the system.
If you say Y here, the kernel will create /proc/pressure/ with the
pressure statistics files cpu, memory, and io. These will indicate
the share of walltime in which some or all tasks in the system are
delayed due to contention of the respective resource.
In kernels with cgroup support, cgroups (cgroup2 only) will
have cpu.pressure, memory.pressure, and io.pressure files,
which aggregate pressure stalls for the grouped tasks only.
For more details see Documentation/accounting/psi.rst.
Say N if unsure.
config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default y if !SMALL_FLASH
@ -346,37 +361,30 @@ config KERNEL_KALLSYMS
config KERNEL_FTRACE
bool "Compile the kernel with tracing support"
depends on !TARGET_uml
default n
config KERNEL_FTRACE_SYSCALLS
bool "Trace system calls"
depends on KERNEL_FTRACE
default n
config KERNEL_ENABLE_DEFAULT_TRACERS
bool "Trace process context switches and events"
depends on KERNEL_FTRACE
default n
config KERNEL_FUNCTION_TRACER
bool "Function tracer"
depends on KERNEL_FTRACE
default n
config KERNEL_FUNCTION_GRAPH_TRACER
bool "Function graph tracer"
depends on KERNEL_FUNCTION_TRACER
default n
config KERNEL_DYNAMIC_FTRACE
bool "Enable/disable function tracing dynamically"
depends on KERNEL_FUNCTION_TRACER
default n
config KERNEL_FUNCTION_PROFILER
bool "Function profiler"
depends on KERNEL_FUNCTION_TRACER
default n
config KERNEL_IRQSOFF_TRACER
bool "Interrupts-off Latency Tracer"
@ -427,7 +435,6 @@ config KERNEL_HIST_TRIGGERS
config KERNEL_DEBUG_KERNEL
bool
default n
config KERNEL_DEBUG_INFO
bool "Compile the kernel with debug information"
@ -438,7 +445,6 @@ config KERNEL_DEBUG_INFO
config KERNEL_DEBUG_INFO_BTF
bool "Enable additional BTF type information"
default n
depends on !HOST_OS_MACOS
depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
select DWARVES
@ -508,7 +514,6 @@ config KERNEL_DEBUG_LL
config KERNEL_DEBUG_VIRTUAL
bool "Compile the kernel with VM translations debugging"
select KERNEL_DEBUG_KERNEL
default n
help
Enable checks sanity checks to catch invalid uses of
virt_to_phys()/phys_to_virt() against the non-linear address space.
@ -516,7 +521,6 @@ config KERNEL_DEBUG_VIRTUAL
config KERNEL_DYNAMIC_DEBUG
bool "Compile the kernel with dynamic printk"
select KERNEL_DEBUG_FS
default n
help
Compiles debug level messages into the kernel, which would not
otherwise be available at runtime. These messages can then be
@ -528,7 +532,6 @@ config KERNEL_DYNAMIC_DEBUG
config KERNEL_EARLY_PRINTK
bool "Compile the kernel with early printk"
default y if TARGET_bcm53xx
default n
depends on arm
select KERNEL_DEBUG_KERNEL
select KERNEL_DEBUG_LL if arm
@ -539,7 +542,6 @@ config KERNEL_EARLY_PRINTK
config KERNEL_KPROBES
bool "Compile the kernel with kprobes support"
default n
select KERNEL_FTRACE
select KERNEL_PERF_EVENTS
help
@ -556,7 +558,6 @@ config KERNEL_KPROBE_EVENTS
config KERNEL_BPF_EVENTS
bool "Compile the kernel with BPF event support"
default n
select KERNEL_KPROBES
help
Allows to attach BPF programs to kprobe, uprobe and tracepoint events.
@ -592,7 +593,6 @@ config KERNEL_FANOTIFY
config KERNEL_BLK_DEV_BSG
bool "Compile the kernel with SCSI generic v4 support for any block device"
default n
config KERNEL_TRANSPARENT_HUGEPAGE
bool
@ -616,7 +616,6 @@ config KERNEL_HUGETLB_PAGE
bool "Compile the kernel with HugeTLB support"
select KERNEL_TRANSPARENT_HUGEPAGE
select KERNEL_HUGETLBFS
default n
config KERNEL_MAGIC_SYSRQ
bool "Compile the kernel with SysRq support"
@ -641,7 +640,6 @@ config KERNEL_ELF_CORE
config KERNEL_PROVE_LOCKING
bool "Enable kernel lock checking"
select KERNEL_DEBUG_KERNEL
default n
config KERNEL_SOFTLOCKUP_DETECTOR
bool "Compile the kernel with detect Soft Lockups"
@ -764,16 +762,13 @@ config KERNEL_CRASH_DUMP
config USE_RFKILL
bool "Enable rfkill support"
default y if TARGET_rockchip
default RFKILL_SUPPORT
config USE_SPARSE
bool "Enable sparse check during kernel build"
default n
config KERNEL_DEVTMPFS
bool "Compile the kernel with device tmpfs enabled"
default n
help
devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
devices nodes for all registered devices to simplify boot, but leaves more
@ -783,7 +778,6 @@ if KERNEL_DEVTMPFS
config KERNEL_DEVTMPFS_MOUNT
bool "Automatically mount devtmpfs after root filesystem is mounted"
default n
endif
@ -794,17 +788,14 @@ config KERNEL_KEYS
config KERNEL_PERSISTENT_KEYRINGS
bool "Enable kernel persistent keyrings"
depends on KERNEL_KEYS
default n
config KERNEL_KEYS_REQUEST_CACHE
bool "Enable temporary caching of the last request_key() result"
depends on KERNEL_KEYS
default n
config KERNEL_BIG_KEYS
bool "Enable large payload keys on kernel keyrings"
depends on KERNEL_KEYS
default n
#
# CGROUP support symbols
@ -818,7 +809,6 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_DEBUG
bool "Example debug cgroup subsystem"
default n
help
This option enables a simple cgroup subsystem that
exports useful debugging information about the cgroups
@ -829,7 +819,6 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_FREEZER
bool "legacy Freezer cgroup subsystem"
default n
select KERNEL_FREEZER
help
Provides a way to freeze and unfreeze all tasks in a
@ -839,7 +828,6 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_DEVICE
bool "legacy Device controller for cgroups"
default n
help
Provides a cgroup implementing whitelists for devices which
a process in the cgroup can mknod or open.
@ -847,7 +835,6 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_HUGETLB
bool "HugeTLB controller"
default n
select KERNEL_HUGETLB_PAGE
config KERNEL_CGROUP_PIDS
@ -876,7 +863,6 @@ if KERNEL_CGROUPS
config KERNEL_PROC_PID_CPUSET
bool "Include legacy /proc/<pid>/cpuset file"
default n
depends on KERNEL_CPUSETS
config KERNEL_CGROUP_CPUACCT
@ -942,7 +928,6 @@ if KERNEL_CGROUPS
config KERNEL_MEMCG_SWAP_ENABLED
bool "Memory Resource Controller Swap Extension enabled by default"
default n
depends on KERNEL_MEMCG_SWAP
help
Memory Resource Controller Swap Extension comes with its price in
@ -971,7 +956,6 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_PERF
bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
select KERNEL_PERF_EVENTS
default n
help
This option extends the per-cpu mode to restrict monitoring to
threads which belong to the cgroup specified and run on the
@ -1048,7 +1032,6 @@ if KERNEL_CGROUPS
config KERNEL_DEBUG_BLK_CGROUP
bool "Enable Block IO controller debugging"
default n
depends on KERNEL_BLK_CGROUP
help
Enable some debugging help. Currently it exports additional stat
@ -1056,15 +1039,12 @@ if KERNEL_CGROUPS
config KERNEL_NET_CLS_CGROUP
bool "legacy Control Group Classifier"
default n
config KERNEL_CGROUP_NET_CLASSID
bool "legacy Network classid cgroup"
default n
config KERNEL_CGROUP_NET_PRIO
bool "legacy Network priority cgroup"
default n
endif
@ -1226,9 +1206,11 @@ endif
config KERNEL_NET_L3_MASTER_DEV
bool "L3 Master device support"
default y if !SMALL_FLASH
help
This module provides glue between core networking code and device
drivers to support L3 master devices like VRF.
Increases the compressed kernel size by ~4kB (as of Linux 6.6).
config KERNEL_XDP_SOCKETS
bool "XDP sockets support"
@ -1242,7 +1224,6 @@ config KERNEL_PAGE_POOL
config KERNEL_PAGE_POOL_STATS
bool "Page pool stats support"
depends on KERNEL_PAGE_POOL
depends on !(LINUX_5_4||LINUX_5_10)
config KERNEL_MPTCP
bool "Multi-Path TCP support"
@ -1292,14 +1273,20 @@ if KERNEL_IP_PNP
endif
config KERNEL_BTRFS_FS
bool "Compile the kernel with built-in BTRFS support"
help
Say Y here if you want to make the kernel to be able to boot off a
BTRFS partition.
menu "Filesystem ACL and attr support options"
config USE_FS_ACL_ATTR
bool "Use filesystem ACL and attr support by default"
default n
default y if !SMALL_FLASH
help
Make using ACLs (e.g. POSIX ACL, NFSv4 ACL) the default
for kernel and packages, except tmpfs, flash filesystems,
and old NFS. Also enable userspace extended attribute support
for kernel and packages, except old NFS.
Also enable userspace extended attribute support
by default. (OpenWrt already has an expection it will be
present in the kernel).
@ -1320,17 +1307,17 @@ menu "Filesystem ACL and attr support options"
config KERNEL_F2FS_FS_POSIX_ACL
bool "Enable POSIX ACL for F2FS Filesystems"
select KERNEL_FS_POSIX_ACL
default n
default y if USE_FS_ACL_ATTR
config KERNEL_JFFS2_FS_POSIX_ACL
bool "Enable POSIX ACL for JFFS2 Filesystems"
select KERNEL_FS_POSIX_ACL
default n
default y if USE_FS_ACL_ATTR
config KERNEL_TMPFS_POSIX_ACL
bool "Enable POSIX ACL for TMPFS Filesystems"
select KERNEL_FS_POSIX_ACL
default n
default y if USE_FS_ACL_ATTR
config KERNEL_CIFS_ACL
bool "Enable CIFS ACLs"
@ -1353,15 +1340,12 @@ menu "Filesystem ACL and attr support options"
config KERNEL_NFS_V3_ACL_SUPPORT
bool "Enable ACLs for NFSv3"
default n
config KERNEL_NFSD_V2_ACL_SUPPORT
bool "Enable ACLs for NFSDv2"
default n
config KERNEL_NFSD_V3_ACL_SUPPORT
bool "Enable ACLs for NFSDv3"
default n
config KERNEL_REISER_FS_POSIX_ACL
bool "Enable POSIX ACLs for ReiserFS"
@ -1470,12 +1454,30 @@ config KERNEL_LSM
config KERNEL_EXT4_FS_SECURITY
bool "Ext4 Security Labels"
default y if !SMALL_FLASH
config KERNEL_F2FS_FS_SECURITY
bool "F2FS Security Labels"
default y if !SMALL_FLASH
config KERNEL_UBIFS_FS_SECURITY
bool "UBIFS Security Labels"
default y if !SMALL_FLASH
config KERNEL_JFFS2_FS_SECURITY
bool "JFFS2 Security Labels"
default y if !SMALL_FLASH
config KERNEL_WERROR
bool "Compile the kernel with warnings as errors"
help
A kernel build should not cause any compiler warnings, and this
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
to enforce that rule by default. Certain warnings from other tools
such as the linker may be upgraded to errors with this option as
well.
However, if you have a new (or very old) compiler or linker with odd
and unusual warnings, or you have some architecture with problems,
you may need to disable this config option in order to
successfully build the kernel.

12
config/check-hostcxx.sh Executable file
View File

@ -0,0 +1,12 @@
cat << EOF | "$STAGING_DIR_HOST/bin/g++" -c -x c++ -o /dev/null - >/dev/null 2>&1
#if __clang__
#if __clang_major__ < $3
#error "clang too old"
#endif
#else
#if __GNUC__ < $1 || (__GNUC__ == $1 && (__GNUC_MINOR__ < $2))
#error "gcc too old"
#endif
#endif
EOF
[ $? -eq 0 ] && echo y || echo n

View File

@ -23,7 +23,8 @@ AM_TOOL_PATHS:= \
LIBTOOLIZE=$(STAGING_DIR_HOST)/bin/libtoolize \
LIBTOOL=$(STAGING_DIR_HOST)/bin/libtool \
M4=$(STAGING_DIR_HOST)/bin/m4 \
AUTOPOINT=true
AUTOPOINT=true \
GTKDOCIZE=true
# 1: build dir
# 2: remove files

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gettext-full
PKG_VERSION:=0.21.1
PKG_VERSION:=0.22.5
PKG_RELEASE:=1
PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gettext
PKG_HASH:=50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6
PKG_HASH:=fe10c37353213d78a5b83d48af231e005c4da84db5ce88037d88355938259640
PKG_BUILD_DIR:=$(BUILD_DIR)/gettext-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION)
@ -21,12 +21,44 @@ PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-3.0-or-later
PKG_CPE_ID:=cpe:/a:gnu:gettext
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=gettext-full/host
PKG_BUILD_DEPENDS:=gettext-full/host libunistring libxml2
PKG_BUILD_PARALLEL:=0
PKG_FIXUP:=autoreconf
HOST_BUILD_DEPENDS:=gperf/host libiconv-full/host libunistring/host libxml2/host
HOST_BUILD_PARALLEL:=0
PKG_SUBDIRS:= \
$$$$(foreach dir, \
intl \
intl-csharp \
intl-java \
its \
gnulib-lib \
gnulib-local \
lib \
$$$$(SUBDIR_libasprintf) \
libgettextpo \
libgrep \
libtextstyle \
m4 \
misc \
po \
projects \
src \
styles \
gettext-runtime \
gettext-tools \
,$$$$(wildcard $$$$(dir)) )
PKG_MAKEFILES_FAKE:= \
gnulib-local/m4/Makefile \
libtextstyle/gnulib-local/Makefile \
libtextstyle/m4/Makefile \
m4/Makefile
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
@ -38,6 +70,8 @@ define Package/libintl-full
ABI_VERSION:=8
endef
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
TARGET_CFLAGS += $(FPIC)
ifneq ($(HOST_OS),Linux)
TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
@ -55,6 +89,8 @@ CONFIGURE_ARGS += \
--with-included-gettext \
--without-libintl-prefix \
--without-libexpat-prefix \
--with-libunistring-prefix=$(STAGING_DIR)/usr \
--with-libxml2-prefix=$(STAGING_DIR) \
--without-emacs
HOST_CONFIGURE_ARGS += \
@ -64,18 +100,62 @@ HOST_CONFIGURE_ARGS += \
--disable-rpath \
--disable-java \
--disable-openmp \
--disable-curses \
--without-emacs \
--without-libxml2-prefix
--with-libiconv-prefix=$(STAGING_DIR_HOSTPKG) \
--with-libunistring-prefix=$(STAGING_DIR_HOSTPKG) \
--with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
HOST_CONFIGURE_VARS += \
EMACS="no" \
am_cv_lib_iconv=no \
am_cv_func_iconv=no \
ac_cv_header_iconv_h=no \
HOST_CFLAGS += $(HOST_FPIC)
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
$(call Host/Configure/Default)
endef
define Host/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
$(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Build/Bootstrap
( \
cd $(PKG_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(if $(QUILT),,$(call Build/Bootstrap))
endef
define Build/Configure
$(if $(QUILT),$(call Build/Bootstrap))
$(call Build/Configure/Default)
endef
define Build/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
$(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/libintl-full/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/
@ -90,10 +170,14 @@ define Build/InstallDev
endef
define Host/Install
$(call Host/Install/Default)
$(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)')
$(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt
endef
define Build/Install
$(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)')
endef
define Package/libintl-full/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/

View File

@ -1,22 +0,0 @@
--- a/gettext-runtime/Makefile.am
+++ b/gettext-runtime/Makefile.am
@@ -27,7 +27,7 @@ SUBDIR_libasprintf = libasprintf
else
SUBDIR_libasprintf =
endif
-SUBDIRS = doc intl intl-java intl-csharp gnulib-lib $(SUBDIR_libasprintf) src po man m4 tests
+SUBDIRS = intl intl-java intl-csharp gnulib-lib $(SUBDIR_libasprintf) src po m4
EXTRA_DIST = BUGS
--- a/gettext-tools/Makefile.am
+++ b/gettext-tools/Makefile.am
@@ -19,7 +19,7 @@
AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
-SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc
+SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles misc m4
EXTRA_DIST = misc/DISCLAIM
MOSTLYCLEANFILES = core *.stackdump

View File

@ -1,342 +0,0 @@
--- a/gettext-runtime/gnulib-m4/stddef_h.m4
+++ b/gettext-runtime/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
--- a/gettext-runtime/gnulib-m4/stdint.m4
+++ b/gettext-runtime/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/gettext-runtime/gnulib-m4/wchar_h.m4
+++ b/gettext-runtime/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-runtime/gnulib-m4/wchar_t.m4
+++ b/gettext-runtime/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/gnulib-m4/wctype_h.m4
+++ b/gettext-runtime/gnulib-m4/wctype_h.m4
@@ -22,7 +22,7 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-runtime/gnulib-m4/wcwidth.m4
+++ b/gettext-runtime/gnulib-m4/wcwidth.m4
@@ -12,8 +12,8 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_HEADERS_ONCE([wchar.h])
AC_CHECK_FUNCS_ONCE([wcwidth])
--- a/gettext-runtime/gnulib-m4/wint_t.m4
+++ b/gettext-runtime/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/libasprintf/configure.ac
+++ b/gettext-runtime/libasprintf/configure.ac
@@ -76,8 +76,8 @@ dnl Checks for typedefs, structures, and
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_LONG_LONG_INT
-gt_TYPE_WCHAR_T
-gt_TYPE_WINT_T
+gt_TYPE_WCHAR_T_GT
+gt_TYPE_WINT_T_GT
AC_TYPE_MBSTATE_T
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
--- a/gettext-runtime/libasprintf/gnulib-m4/wchar_t.m4
+++ b/gettext-runtime/libasprintf/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/libasprintf/gnulib-m4/wint_t.m4
+++ b/gettext-runtime/libasprintf/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/m4/intl.m4
+++ b/gettext-runtime/m4/intl.m4
@@ -31,8 +31,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gl_VISIBILITY])dnl
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
- AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
- AC_REQUIRE([gt_TYPE_WINT_T])dnl
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])dnl
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])dnl
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gt_TYPE_INTMAX_T])
AC_REQUIRE([gt_PRINTF_POSIX])
--- a/gettext-tools/gnulib-m4/stdint.m4
+++ b/gettext-tools/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/gettext-tools/gnulib-m4/vasnprintf.m4
+++ b/gettext-tools/gnulib-m4/vasnprintf.m4
@@ -32,16 +32,16 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
])
# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
@@ -54,8 +54,8 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
--- a/gettext-tools/gnulib-m4/wchar_h.m4
+++ b/gettext-tools/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-tools/gnulib-m4/wchar_t.m4
+++ b/gettext-tools/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-tools/gnulib-m4/wctype_h.m4
+++ b/gettext-tools/gnulib-m4/wctype_h.m4
@@ -22,7 +22,7 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-tools/gnulib-m4/wcwidth.m4
+++ b/gettext-tools/gnulib-m4/wcwidth.m4
@@ -12,8 +12,8 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_HEADERS_ONCE([wchar.h])
AC_CHECK_FUNCS_ONCE([wcwidth])
--- a/gettext-tools/gnulib-m4/wint_t.m4
+++ b/gettext-tools/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/libtextstyle/gnulib-m4/stdint.m4
+++ b/libtextstyle/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/libtextstyle/gnulib-m4/vasnprintf.m4
+++ b/libtextstyle/gnulib-m4/vasnprintf.m4
@@ -32,16 +32,16 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
])
# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
@@ -54,8 +54,8 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
--- a/libtextstyle/gnulib-m4/wchar_h.m4
+++ b/libtextstyle/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/libtextstyle/gnulib-m4/wchar_t.m4
+++ b/libtextstyle/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/libtextstyle/gnulib-m4/wint_t.m4
+++ b/libtextstyle/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-tools/gnulib-m4/gnulib-comp.m4
+++ b/gettext-tools/gnulib-m4/gnulib-comp.m4
@@ -2218,8 +2218,8 @@ changequote([, ])dnl
AC_REQUIRE([gl_SOCKETLIB])
AC_REQUIRE([gl_SOCKETS])
gl_TYPE_SOCKLEN_T
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
gl_FUNC_STRERROR_R
AS_IF([test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1], [
AC_LIBOBJ([strerror_r])
--- a/libtextstyle/gnulib-m4/stddef_h.m4
+++ b/libtextstyle/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
--- a/gettext-tools/gnulib-m4/stddef_h.m4
+++ b/gettext-tools/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])

View File

@ -1,11 +0,0 @@
--- a/libtextstyle/lib/iconv-ostream.c
+++ b/libtextstyle/lib/iconv-ostream.c
@@ -231,7 +231,7 @@ iconv_ostream__write_mem (iconv_ostream_t stream, const void *data, size_t len)
}
static void
-iconv_ostream__flush (iconv_ostream_t stream)
+iconv_ostream__flush (iconv_ostream_t stream, ostream_flush_scope_t scope)
{
abort ();
}

View File

@ -0,0 +1,31 @@
--- a/libtextstyle/gnulib-local/modules/libxml.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-*** libxml.orig 2018-10-28 14:37:07.007164889 +0100
---- libxml 2019-02-14 22:19:29.994771110 +0100
-***************
-*** 118,124 ****
- fabs
-
- configure.ac:
-! gl_LIBXML
-
- Makefile.am:
- if INCLUDED_LIBXML
---- 118,133 ----
- fabs
-
- configure.ac:
-! # In libtextstyle, we don't want to use an external libxml, because its
-! # dependencies and their dynamic relocations have an impact on the startup
-! # time of a program that is linked with it. As you can see by using
-! # 'readelf -r ... | wc -l' and 'readelf -d ... | grep NEEDED':
-! # - libxml2.so has more than 3300 relocations and depends on libicuuc.
-! # - libicuuc.so has more than 4900 relocations and depends on libstdc++.
-! # - libstdc++.so has more than 4600 relocations.
-! # These are more than 12800 relocations, to perform at program startup.
-! # So, force the use of the included libxml part.
-! gl_LIBXML([yes])
-
- Makefile.am:
- if INCLUDED_LIBXML

View File

@ -1,22 +0,0 @@
--- a/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
+++ b/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
*
* Whether iconv support is available
*/
-#if 1
+#if 0
#define LIBXML_ICONV_ENABLED
#endif
--- a/gnulib-local/lib/libxml/xmlversion.in.h
+++ b/gnulib-local/lib/libxml/xmlversion.in.h
@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
*
* Whether iconv support is available
*/
-#if 1
+#if 0
#define LIBXML_ICONV_ENABLED
#endif

View File

@ -0,0 +1,21 @@
--- a/autogen.sh
+++ b/autogen.sh
@@ -81,6 +81,7 @@ if ! $skip_gnulib; then
getopt-gnu
gettext-h
havelib
+ libunistring-optional
memmove
noreturn
progname
--- a/gettext-runtime/src/Makefile.am
+++ b/gettext-runtime/src/Makefile.am
@@ -43,7 +43,7 @@ envsubst_SOURCES = envsubst.c
# Link dependencies.
# Need @LTLIBICONV@ because striconv.c uses iconv().
-LDADD = ../gnulib-lib/libgrt.a @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD)
+LDADD = ../gnulib-lib/libgrt.a $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD)
# Specify installation directory, for --enable-relocatable.
gettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\"

View File

@ -25,10 +25,14 @@ PKG_LICENSE_FILES:= COPYING \
libuuid/COPYING \
Documentation/licenses/COPYING.BSD-3
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
DISABLE_NLS:=--disable-nls
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/meson.mk
define Package/util-linux/Default
SECTION:=utils
@ -548,69 +552,44 @@ define Package/wipefs/description
libblkid.
endef
MESON_ARGS += \
-Dsystemd=disabled \
-Dtinfo=disabled \
-Dcryptsetup=disabled \
-Dlibutil=disabled \
-Dlibutempter=disabled \
-Dlibpcre2-posix=disabled \
-Dlibuser=disabled \
-Duse-tty-group=false \
-Duse-tls=false \
-Dbuild-python=disabled \
-Dbuild-zramctl=disabled \
-Dbuild-fsck=disabled \
-Dbuild-wipefs=disabled \
-Dbuild-fallocate=disabled \
-Dbuild-setpriv=disabled \
-Dbuild-hardlink=disabled \
-Dbuild-cramfs=disabled \
-Dbuild-bfs=disabled \
-Dbuild-minix=disabled \
-Dbuild-fdformat=disabled \
-Dbuild-lslogins=disabled \
-Dbuild-wdctl=disabled \
-Dbuild-cal=disabled \
-Dbuild-switch_root=disabled \
-Dbuild-pivot_root=disabled \
-Dbuild-lsmem=disabled \
-Dbuild-lsirq=disabled \
-Dbuild-irqtop=disabled \
-Dbuild-chmem=disabled \
-Dbuild-ipcrm=disabled \
-Dbuild-rfkill=disabled \
-Dbuild-tunelp=disabled \
-Dbuild-kill=disabled \
-Dbuild-last=disabled \
-Dbuild-utmpdump=disabled \
-Dbuild-line=disabled \
-Dbuild-mesg=disabled \
-Dbuild-raw=disabled \
-Dbuild-vipw=disabled \
-Dbuild-newgrp=disabled \
-Dbuild-chfn-chsh=disabled \
-Dbuild-login=disabled \
-Dbuild-nologin=disabled \
-Dbuild-sulogin=disabled \
-Dbuild-su=disabled \
-Dbuild-runuser=disabled \
-Dbuild-ul=disabled \
-Dbuild-pg=disabled \
-Dbuild-write=disabled \
-Dbuild-bash-completion=disabled \
-Dbuild-pylibmount=disabled \
-Dreadline=disabled \
-Dmagic=disabled \
-Dncursesw=enabled
CONFIGURE_ARGS += \
--disable-use-tty-group \
--disable-rpath \
--disable-tls \
--disable-su \
--disable-sulogin \
--disable-makeinstall-chown \
--disable-login \
--disable-nologin \
--disable-lslogins \
--disable-runuser \
--disable-chfn-chsh \
--disable-raw \
--without-python \
--without-udev \
--without-readline \
--without-libmagic \
--with-ncursesw
TARGET_CFLAGS += $(FPIC) -std=gnu99
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/blkid.pc $(1)/usr/lib/pkgconfig
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/blkid.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/blkid.pc
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fdisk.pc $(1)/usr/lib/pkgconfig
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/fdisk.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/fdisk.pc
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mount.pc $(1)/usr/lib/pkgconfig
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/mount.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/mount.pc
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/smartcols.pc $(1)/usr/lib/pkgconfig
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/smartcols.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/smartcols.pc
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/uuid.pc $(1)/usr/lib/pkgconfig
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/uuid.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/uuid.pc
$(INSTALL_DIR) $(1)/usr/include/blkid
$(CP) $(PKG_INSTALL_DIR)/usr/include/blkid/blkid.h $(1)/usr/include/blkid
@ -624,37 +603,43 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/include/libsmartcols/libsmartcols.h $(1)/usr/include/libsmartcols
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libblkid.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfdisk.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmount.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libuuid.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmartcols.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libblkid.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libfdisk.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libmount.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libuuid.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libsmartcols.so* $(1)/usr/lib
$(LN) libblkid.so.1 $(1)/usr/lib/libblkid.so
$(LN) libfdisk.so.1 $(1)/usr/lib/libfdisk.so
$(LN) libmount.so.1 $(1)/usr/lib/libmount.so
$(LN) libuuid.so.1 $(1)/usr/lib/libuuid.so
$(LN) libsmartcols.so.1 $(1)/usr/lib/libsmartcols.so
endef
define Package/libfdisk/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfdisk.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libfdisk.so.* $(1)/usr/lib/
endef
define Package/libblkid/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libblkid.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libblkid.so.* $(1)/usr/lib/
endef
define Package/libmount/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmount.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libmount.so.* $(1)/usr/lib/
endef
define Package/libsmartcols/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmartcols.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libsmartcols.so.* $(1)/usr/lib/
endef
define Package/libuuid/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libuuid.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libuuid.so.* $(1)/usr/lib/
endef
define Package/agetty/install

View File

@ -1,34 +0,0 @@
From e25db9169450d3d5fb43656a2eae5c08999310f4 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 16:56:54 -0700
Subject: [PATCH 2/7] meson: don't use run
Fixes cross compilation. run is not needed anyway.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/meson.build
+++ b/meson.build
@@ -577,8 +577,7 @@ int main(void) {
return tzname ? 0 : 1;
}
'''.format(have ? 1 : 0)
-result = cc.run(code, name : 'using tzname[]')
-have = result.compiled() and result.returncode() == 0
+have = cc.compiles(code, name : 'using tzname[]')
conf.set('HAVE_TZNAME', have ? 1 : false)
socket_libs = []
@@ -641,8 +640,7 @@ int main(void) {
return (*__progname != 0);
}
'''
-result = cc.run(code, name : 'using __progname')
-have = result.compiled() and result.returncode() == 0
+have = cc.compiles(code, name : 'using __progname')
conf.set('HAVE___PROGNAME', have ? 1 : false)
build_plymouth_support = get_option('build-plymouth-support')

View File

@ -1,23 +0,0 @@
From 4194bb5b35e9b5f3296bf17b7cabcc5cb1632ba3 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 16:55:15 -0700
Subject: [PATCH 3/7] meson: fix cpu_set_t test
_GNU_SOURCE is needed here.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -379,7 +379,7 @@ endforeach
have = cc.has_header('sched.h')
conf.set10('HAVE_DECL_CPU_ALLOC', have)
# We get -1 if the size cannot be determined
-have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#include <sched.h>') > 0
+have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
have = cc.has_header_symbol('stdlib.h', 'environ')

View File

@ -1,23 +0,0 @@
From 1e9e2b9fe365cc4a0025d44dc0a9c54bfffe9058 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 18:16:17 -0700
Subject: [PATCH 4/7] meson: fix environ search
musl has it defined in unistd.h and hidden behind _GNU_SOURCE.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -382,7 +382,7 @@ conf.set10('HAVE_DECL_CPU_ALLOC', have)
have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
-have = cc.has_header_symbol('stdlib.h', 'environ')
+have = cc.has_header_symbol('unistd.h', 'environ', prefix : '#define _GNU_SOURCE')
conf.set10('HAVE_ENVIRON_DECL', have)
have = cc.has_header_symbol('signal.h', 'sighandler_t')

View File

@ -1,23 +0,0 @@
From 5d7557eb3827664b2b78145373907f2a6994bdf9 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 18:17:52 -0700
Subject: [PATCH 5/7] meson: add _GNU_SOURCE for sighandler_t
musl requires it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -385,7 +385,7 @@ conf.set('HAVE_CPU_SET_T', have_cpu_set_
have = cc.has_header_symbol('unistd.h', 'environ', prefix : '#define _GNU_SOURCE')
conf.set10('HAVE_ENVIRON_DECL', have)
-have = cc.has_header_symbol('signal.h', 'sighandler_t')
+have = cc.has_header_symbol('signal.h', 'sighandler_t', prefix : '#define _GNU_SOURCE')
conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
have = cc.has_header_symbol('string.h', 'strsignal')

View File

@ -1,24 +0,0 @@
From 777652585924034deeba98ae3192f26bc32bb661 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 18:19:53 -0700
Subject: [PATCH 6/7] meson: fix isnan check
musl only has isnan as a macro, not as a function. Handle the former
case.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -622,7 +622,7 @@ rtas_libs = cc.find_library('rtas', requ
conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
math_libs = []
-if not cc.has_function('isnan')
+if not cc.has_header_symbol('math.h', 'isnan')
lib = cc.find_library('m', required : true)
if (cc.has_function('isnan', dependencies : lib) and
cc.has_function('__isnan', dependencies : lib))

View File

@ -1,23 +0,0 @@
From 9a6b2618b46a859388139d1eb18f876886786659 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 19:00:53 -0700
Subject: [PATCH] meson: fix tzname check
tzname is not a type but a variable. sizeof only works on types.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -565,7 +565,7 @@ have = cc.has_member('struct tm', 'tm_zo
prefix : '#include <time.h>')
conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
-have = cc.sizeof('tzname', prefix : '#include <time.h>') > 0
+have = cc.has_header_symbol('time.h', 'tzname')
conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
code = '''

View File

@ -1,18 +0,0 @@
--- a/meson.build
+++ b/meson.build
@@ -299,10 +299,14 @@ conf.set('HAVE_LIBUDEV', lib_udev.found(
lib_crypt = cc.find_library('crypt')
-lib_pam = cc.find_library('pam')
+req_libpam = not (get_option('build-login').disabled() or get_option('build-chfn-chsh').disabled()
+ or get_option('build-su').disabled() or get_option('build-runuser').disabled())
+lib_pam = cc.find_library('pam', required : req_libpam)
if lib_pam.found()
lib_pam_misc = cc.find_library('pam_misc')
lib_pam = [lib_pam, lib_pam_misc]
+else
+ lib_pam_misc = declare_dependency()
endif
lib_cryptsetup = dependency(

View File

@ -1,31 +0,0 @@
From cd23a4336f49ba6a12ade557a09589f2a7c966f4 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Mon, 2 May 2022 16:18:33 -0700
Subject: [PATCH] meson: make libcap-ng dependent on setpriv
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/meson.build
+++ b/meson.build
@@ -334,7 +334,8 @@ have = cc.has_function(
conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
lib_cap_ng = dependency(
- 'libcap-ng')
+ 'libcap-ng',
+ required : get_option('build-setpriv'))
lib_selinux = dependency(
'libselinux',
@@ -1754,7 +1755,7 @@ if opt and not is_disabler(exe)
exes += exe
endif
-opt = not get_option('build-setpriv').disabled()
+opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
exe = executable(
'setpriv',
setpriv_sources,

View File

@ -1,20 +0,0 @@
From e0c1a86bf88b568a7afe8ebaea1b9f84afb892c2 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Wed, 4 May 2022 23:52:31 -0400
Subject: [PATCH] meson: get the project version from the version-gen script
This matches autotools and ensures that the version number is actually
reliable.
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('util-linux', 'c',
- version : '2.37',
+ version : run_command('tools/git-version-gen', check: true).stdout(),
license : 'GPLv2+')
pkgconfig = import('pkgconfig')

View File

@ -1,26 +0,0 @@
From dc307e1cbf73f6dbf72bb049c19d332774cdb4e7 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Thu, 5 May 2022 00:16:15 -0400
Subject: [PATCH] meson: fix error in processing version for pc files
This awk command was copied verbatim from configure.ac, which included
non-awk syntax because configure.ac cannot contain [ literals.
Rewrite these autoconf quadrigraphs as their actual values, for meson.
Fixes always setting the micro version to "0".
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,7 @@ conf.set_quoted('PACKAGE_VERSION', meson
codes = [''' {print $1} ''',
''' {sub("-.*","",$2); print $2} ''',
- ''' {sub("-.*","",$3); print $3 ~ /^@<:@0-9@:>@+$/ ? $3 : 0} ''']
+ ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} ''']
pc_version = []
foreach code : codes
res = run_command('bash', '-c',

View File

@ -1,10 +0,0 @@
--- a/meson.build
+++ b/meson.build
@@ -774,7 +774,6 @@ subdir('disk-utils')
subdir('misc-utils')
subdir('text-utils')
subdir('term-utils')
-subdir('po')
includes = [dir_include,
dir_libblkid,

173
rules.mk
View File

@ -20,14 +20,35 @@ endif
export TMP_DIR:=$(TOPDIR)/tmp
export TMPDIR:=$(TMP_DIR)
##@
# @brief Strip quotes `"` and pounds `#` from string.
#
# @param 1: String.
##
qstrip=$(strip $(subst ",,$(1)))
#"))
empty:=
space:= $(empty) $(empty)
comma:=,
pound:=\#
##@
# @brief Merge strings by removing spaces.
#
# @param 1: String.
##
merge=$(subst $(space),,$(1))
##@
# @brief Get hash sum of variable list.
#
# @param 1: List of variable names.
##
confvar=$(shell echo '$(foreach v,$(1),$(v)=$(subst ','\'',$($(v))))' | $(MKHASH) md5)
##@
# @brief Strip last extension from file name.
#
# @param 1: File name.
##
strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
paren_left = (
@ -50,9 +71,18 @@ __tr_head = $(subst $(paren_left)subst,$(paren_left)subst$(space),$(__tr_head_st
__tr_tail = $(subst $(space),,$(foreach cv,$(1),$(paren_right)))
__tr_template = $(__tr_head)$$(1)$(__tr_tail)
##@
# @brief Convert string characters to upper.
##
$(eval toupper = $(call __tr_template,$(chars_lower),$(chars_upper)))
##@
# @brief Convert string characters to lower.
##
$(eval tolower = $(call __tr_template,$(chars_upper),$(chars_lower)))
##@
# @brief Abbreviate version. Truncate to 8 characters.
##
version_abbrev = $(if $(if $(CHECK),,$(DUMP)),$(1),$(shell printf '%.8s' $(1)))
_SINGLE=export MAKEFLAGS=$(space);
@ -101,6 +131,13 @@ endif
DEFAULT_SUBDIR_TARGETS:=clean download prepare compile update refresh prereq dist distcheck configure check check-depends
##@
# @brief Create default targets.
#
# Targets are created from @DEFAULT_SUBDIR_TARGETS and input argument lists.
#
# @param 1: Additional targets list.
##
define DefaultTargets
$(foreach t,$(DEFAULT_SUBDIR_TARGETS) $(1),
.$(t):
@ -140,8 +177,8 @@ ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),)
iremap = -f$(if $(CONFIG_REPRODUCIBLE_DEBUG_INFO),file,macro)-prefix-map=$(1)=$(2)
endif
PACKAGE_DIR:=$(BIN_DIR)/packages
PACKAGE_DIR_ALL:=$(TOPDIR)/staging_dir/packages/$(BOARD)
PACKAGE_DIR?=$(BIN_DIR)/packages
PACKAGE_DIR_ALL?=$(TOPDIR)/staging_dir/packages/$(BOARD)
BUILD_DIR:=$(BUILD_DIR_BASE)/$(TARGET_DIR_NAME)
STAGING_DIR:=$(TOPDIR)/staging_dir/$(TARGET_DIR_NAME)
BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/$(TOOLCHAIN_DIR_NAME)
@ -184,33 +221,38 @@ ifndef DUMP
-include $(TOOLCHAIN_DIR)/info.mk
export GCC_HONOUR_COPTS:=0
TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-)
TOOLCHAIN_ROOT_DIR:=$(TOPDIR)/staging_dir/$(TOOLCHAIN_DIR_NAME)
TOOLCHAIN_BIN_DIRS:=$(TOOLCHAIN_ROOT_DIR)/bin
TOOLCHAIN_INC_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/include $(TOOLCHAIN_ROOT_DIR)/include
TOOLCHAIN_LIB_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/lib $(TOOLCHAIN_ROOT_DIR)/lib
TARGET_CFLAGS+= -fhonour-copts
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include
ifeq ($(CONFIG_USE_MUSL),y)
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify
TOOLCHAIN_INC_DIRS+= $(TOOLCHAIN_DIR)/include/fortify
endif
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include
TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib
TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH)
else
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
-include $(TOOLCHAIN_DIR)/info.mk
TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX))
TOOLCHAIN_ROOT_DIR:=$(call qstrip,$(CONFIG_TOOLCHAIN_ROOT))
TOOLCHAIN_BIN_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_BIN_PATH)))
TOOLCHAIN_INC_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH)))
TOOLCHAIN_LIB_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH)))
ifneq ($(TOOLCHAIN_BIN_DIRS),)
TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH)
endif
ifneq ($(TOOLCHAIN_INC_DIRS),)
TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS))
endif
ifneq ($(TOOLCHAIN_LIB_DIRS),)
TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS))
endif
endif
endif
ifneq ($(TOOLCHAIN_BIN_DIRS),)
TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH)
endif
ifneq ($(TOOLCHAIN_INC_DIRS),)
TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS))
endif
ifneq ($(TOOLCHAIN_LIB_DIRS),)
TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS))
endif
endif
TARGET_LINKER?=bfd
TARGET_LDFLAGS+= -fuse-ld=$(TARGET_LINKER)
TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(STAGING_DIR_HOSTPKG)/bin:$(TARGET_PATH)
ifeq ($(CONFIG_SOFT_FLOAT),y)
@ -227,6 +269,7 @@ else
endif
endif
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
export PATH:=$(TARGET_PATH)
export STAGING_DIR STAGING_DIR_HOST STAGING_DIR_HOSTPKG
export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
@ -235,14 +278,16 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
export PKG_CONFIG
HOSTCC:=gcc
HOSTCXX:=g++
HOSTCC:=$(STAGING_DIR_HOST)/bin/gcc
HOSTCXX:=$(STAGING_DIR_HOST)/bin/g++
HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include)
HOST_CXXFLAGS:=
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
HOST_CXXFLAGS:=$(HOST_CFLAGS)
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
BUILD_KEY=$(TOPDIR)/key-build
BUILD_KEY_APK_SEC=$(TOPDIR)/private-key.pem
BUILD_KEY_APK_PUB=$(TOPDIR)/public-key.pem
FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
@ -251,7 +296,9 @@ TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
TARGET_NM:=$(TARGET_CROSS)gcc-nm
TARGET_CC:=$(TARGET_CROSS)gcc
TARGET_CXX:=$(TARGET_CROSS)g++
TARGET_LD:=$(TARGET_CROSS)ld.$(TARGET_LINKER)
KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh
FILECMD:=$(STAGING_DIR_HOST)/bin/file
SED:=$(STAGING_DIR_HOST)/bin/sed -i -e
ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e
MKHASH:=$(STAGING_DIR_HOST)/bin/mkhash
@ -267,6 +314,14 @@ FIND:=find
PATCH:=patch
PYTHON:=python3
ifeq ($(HOST_OS),Darwin)
TRUE:=/usr/bin/env gtrue
FALSE:=/usr/bin/env gfalse
else
TRUE:=/usr/bin/env true
FALSE:=/usr/bin/env false
endif
INSTALL_BIN:=install -m0755
INSTALL_SUID:=install -m4755
INSTALL_DIR:=install -d -m0755
@ -283,8 +338,8 @@ export HOSTCC_NOCACHE
export HOSTCXX_NOCACHE
ifneq ($(CONFIG_CCACHE),)
TARGET_CC:= ccache_cc
TARGET_CXX:= ccache_cxx
TARGET_CC:= ccache $(TARGET_CC)
TARGET_CXX:= ccache $(TARGET_CXX)
HOSTCC:= ccache $(HOSTCC)
HOSTCXX:= ccache $(HOSTCXX)
export CCACHE_BASEDIR:=$(TOPDIR)
@ -295,7 +350,7 @@ endif
TARGET_CONFIGURE_OPTS = \
AR="$(TARGET_AR)" \
AS="$(TARGET_CC) -c $(TARGET_ASFLAGS)" \
LD=$(TARGET_CROSS)ld \
LD="$(TARGET_LD)" \
NM="$(TARGET_NM)" \
CC="$(TARGET_CC)" \
GCC="$(TARGET_CC)" \
@ -315,7 +370,7 @@ else
STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
else
ifneq ($(CONFIG_USE_SSTRIP),)
STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call qstrip,$(CONFIG_SSTRIP_ARGS))
STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(if $(CONFIG_SSTRIP_DISCARD_TRAILING_ZEROES),-z)
endif
endif
RSTRIP= \
@ -352,17 +407,45 @@ export BISON_PKGDATADIR:=$(STAGING_DIR_HOST)/share/bison
export HOST_GNULIB_SRCDIR:=$(STAGING_DIR_HOST)/share/gnulib
export M4:=$(STAGING_DIR_HOST)/bin/m4
##@
# @brief Slugify variable name and prepend suffix.
##
define shvar
V_$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
endef
##@
# @brief Create and export variable, set to function result.
#
# @param 1: Function name. Used as variable name, prepended with `V_`.
##
define shexport
export $(call shvar,$(1))=$$(call $(1))
endef
# Execute commands under flock
# $(1) => The shell expression.
# $(2) => The lock name. If not given, the global lock will be used.
##@
# @brief Support 64 bit tine in C code.
#
# Test support for 64-bit time with C code from largefile.m4 provided by GNU Gnulib
# the value is `y` when successful and `` otherwise
##
define YEAR_2038
$(shell \
mkdir -p $(TMP_DIR); \
echo '$(pound) include <time.h>' > $(TMP_DIR)/year2038.c; \
echo '$(pound) define LARGE_TIME_T ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))' >> $(TMP_DIR)/year2038.c; \
echo 'int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1];' >> $(TMP_DIR)/year2038.c; \
echo 'int main (void) {return 0;}' >> $(TMP_DIR)/year2038.c; \
$(HOSTCC) $(TMP_DIR)/year2038.c -o /dev/null 2>/dev/null && echo y && rm -f $(TMP_DIR)/year2038.c || rm -f $(TMP_DIR)/year2038.c; \
)
endef
##@
# @brief Execute commands under flock
#
# @param 1: The shell expression.
# @param 2: The lock name. If not given, the global lock will be used.
##
ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),)
define locked
SHELL= \
@ -374,10 +457,14 @@ else
locked=$(1)
endif
# Recursively copy paths into another directory, purge dangling
##@
# @brief Recursively copy paths into another directory, purge dangling
# symlinks before.
# $(1) => File glob expression
# $(2) => Destination directory
#
# @param 1: File glob expression.
# @param 1: Destination directory.
##
define file_copy
for src_dir in $(sort $(foreach d,$(wildcard $(1)),$(dir $(d)))); do \
( cd $$src_dir; find -type f -or -type d ) | \
@ -392,19 +479,30 @@ define file_copy
$(CP) $(1) $(2)
endef
# Calculate sha256sum of any plain file within a given directory
# $(1) => Input directory
# $(2) => If set, recurse into subdirectories
##@
# @brief Calculate sha256sum of any plain file within a given directory.
#
# @param 1: Input directory.
# @param 2: If set, recurse into subdirectories.
##
define sha256sums
(cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \
xargs -r $(MKHASH) -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums)
endef
# file extension
##@
# @brief Retrieve file extension.
#
# @param 1: File name.
##
ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))
# Count Git commits of a package
# $(1) => if non-empty: count commits since last ": [uU]pdate to " or ": [bB]ump to " in commit message
##@
# @brief Count Git commits of a package.
#
# @param 1: if non-empty: count commits since last ": [uU]pdate to "
# or ": [bB]ump to " in commit message.
##
define commitcount
$(shell \
if git log -1 >/dev/null 2>/dev/null; then \
@ -426,6 +524,11 @@ $(shell \
)
endef
##@
# @brief Get ABI version string, stripping `-`, `_` and `.`.
#
# @param 1: Version string.
##
abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))
COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))

View File

@ -1,32 +1,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=7z
PKG_VERSION:=22.01
PKG_SOURCE_VERSION:=2201
PKG_VERSION:=24.05
PKG_SOURCE:=$(PKG_NAME)$(PKG_SOURCE_VERSION)-src.tar.xz
PKG_SOURCE:=$(PKG_NAME)$(subst .,,$(PKG_VERSION))-src.tar.xz
PKG_SOURCE_URL:=https://7-zip.org/a/
PKG_HASH:=393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5
PKG_HASH:=63f341cf80b8d287c6e945519b3da0fa75553c85572a471b7fa6e68f9a90b790
PKG_CPE_ID:=cpe:/a:7-zip:7-zip
# This builds the 7zr variant which supports only 7z, so no non-LGPL code should be included
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=DOC/License.txt DOC/copying.txt
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
HOST_MAKE_PATH:=CPP/7zip/Bundles/Alone7z
include $(INCLUDE_DIR)/host-build.mk
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Bundles/Alone7z
define Host/Compile
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
endef
TAR_OPTIONS := -C $(HOST_BUILD_DIR) $(TAR_OPTIONS)
HOST_MAKE_FLAGS += -f makefile.gcc
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(ALONE_DIR)/_o/7zr $(STAGING_DIR_HOST)/bin/7zr
$(INSTALL_BIN) $(HOST_BUILD_DIR)/$(HOST_MAKE_PATH)/_o/7zr $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean

View File

@ -0,0 +1,20 @@
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -24,7 +24,7 @@ PROGPATH_STATIC = $(O)/$(PROG)s
ifneq ($(CC), xlc)
-CFLAGS_WARN_WALL = -Werror -Wall -Wextra
+CFLAGS_WARN_WALL = -Wall -Wextra
endif
# for object file
@@ -50,7 +50,7 @@ endif
endif
# CFLAGS_BASE_LIST = -S
-CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
+CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) -D_GNU_SOURCE \
$(CFLAGS_DEBUG) -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-fPIC

View File

@ -0,0 +1,36 @@
--- a/C/Threads.c
+++ b/C/Threads.c
@@ -265,7 +265,7 @@ WRes Thread_Create_With_CpuSet(CThread *
*/
// ret2 =
- pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet);
+ //pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet);
// if (ret2) ret = ret2;
#endif
}
@@ -275,14 +275,12 @@ WRes Thread_Create_With_CpuSet(CThread *
if (!ret)
{
p->_created = 1;
- /*
if (cpuSet)
{
// ret2 =
pthread_setaffinity_np(p->_tid, sizeof(*cpuSet), cpuSet);
// if (ret2) ret = ret2;
}
- */
}
}
// ret2 =
--- a/C/Threads.h
+++ b/C/Threads.h
@@ -29,6 +29,7 @@ Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_
#endif
#include <pthread.h>
+#include <sched.h>
#endif

View File

@ -20,6 +20,9 @@ endif
ifneq ($(CONFIG_SDK)$(CONFIG_PACKAGE_kmod-b43)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
BUILD_B43_TOOLS = y
endif
ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),)
BUILD_BZIP2_TOOLS = y
endif
ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
BUILD_LZ4_TOOLS = y
endif
@ -36,6 +39,7 @@ tools-y += cmake
tools-y += cpio
tools-y += dosfstools
tools-y += e2fsprogs
tools-y += elfutils
tools-y += expat
tools-y += fakeroot
tools-y += findutils
@ -60,26 +64,28 @@ tools-y += patch-image
tools-y += patchelf
tools-y += pkgconf
tools-y += quilt
tools-y += squashfskit4
tools-y += squashfs4
tools-y += sstrip
tools-y += util-linux
tools-y += xz
tools-y += zip
tools-y += zlib
tools-y += zstd
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS),y) += liblzo
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_B43_TOOLS),y) += b43-tools
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_BZIP2_TOOLS),y) += bzip2
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_ISL),y) += isl
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZ4_TOOLS),y) += lz4
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs3-lzma
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_mxs),y) += elftosb sdimage
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_realtek),y) += 7z
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_tegra),y) += cbootimage cbootimage-configs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += kernel2minor
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += yafut
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_MOLD),y) += mold
# builddir dependencies
$(curdir)/autoconf/compile := $(curdir)/m4/compile
@ -90,7 +96,8 @@ $(curdir)/bison/compile := $(curdir)/flex/compile
$(curdir)/cbootimage/compile += $(curdir)/automake/compile
$(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
$(curdir)/dosfstools/compile := $(curdir)/automake/compile
$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile
$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile $(curdir)/util-linux/compile
$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile $(curdir)/gnulib/compile $(curdir)/libtool/compile
$(curdir)/fakeroot/compile := $(curdir)/libtool/compile
$(curdir)/findutils/compile := $(curdir)/bison/compile
$(curdir)/firmware-utils/compile += $(curdir)/cmake/compile
@ -101,7 +108,8 @@ $(curdir)/gmp/compile := $(curdir)/libtool/compile
$(curdir)/isl/compile := $(curdir)/gmp/compile
$(curdir)/liblzo/compile := $(curdir)/cmake/compile
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/missing-macros/compile
$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/gnulib/compile $(curdir)/missing-macros/compile
$(curdir)/lz4/compile := $(curdir)/meson/compile
$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
$(curdir)/lzop/compile := $(curdir)/cmake/compile $(curdir)/liblzo/compile
$(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile
@ -110,6 +118,7 @@ $(curdir)/meson/compile := $(curdir)/ninja/compile
$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
$(curdir)/mkimage/compile += $(curdir)/bison/compile $(curdir)/libressl/compile
$(curdir)/mklibs/compile := $(curdir)/libtool/compile
$(curdir)/mold/compile := $(curdir)/cmake/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
$(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
$(curdir)/mpfr/compile := $(curdir)/gmp/compile
$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
@ -118,22 +127,21 @@ $(curdir)/patchelf/compile := $(curdir)/libtool/compile
$(curdir)/pkgconf/compile := $(curdir)/meson/compile
$(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
$(curdir)/sdcc/compile := $(curdir)/bison/compile
$(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
$(curdir)/util-linux/compile := $(curdir)/meson/compile $(curdir)/bison/compile
$(curdir)/zstd/compile := $(curdir)/meson/compile
$(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile
$(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
$(curdir)/util-linux/compile := $(curdir)/bison/compile $(curdir)/automake/compile
$(curdir)/yafut/compile := $(curdir)/cmake/compile
ifneq ($(HOST_OS),Linux)
$(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
$(curdir)/coreutils/compile += $(curdir)/automake/compile $(curdir)/bison/compile $(curdir)/gnulib/compile
$(curdir)/squashfs4/compile += $(curdir)/coreutils/compile
tools-y += coreutils
endif
ifeq ($(HOST_OS),Darwin)
tools-y += bash
else
$(curdir)/dwarves/compile += $(curdir)/elfutils/compile
$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_DWARVES),y) += dwarves
tools-y += elfutils
endif
ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
@ -146,22 +154,23 @@ endif
# dependency for tools which have patches directory
$(foreach tool, $(tools-y), $(if $(wildcard $(curdir)/$(tool)/patches),$(eval $(curdir)/$(tool)/compile += $(curdir)/patch/compile)))
$(foreach tool, $(filter-out xz,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/xz/compile))
$(foreach tool, $(filter-out zstd,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/zstd/compile))
# make any tool depend on the following to ensure that archives can be unpacked and patched properly
tools-core += libdeflate
tools-core += patch
tools-core += tar
tools-core += xz
tools-core += zstd
$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(patsubst %,$(curdir)/%/compile,$(tools-core))))
tools-y += $(tools-core)
# make core tools depend on sed and flock
$(foreach tool, $(filter-out xz,$(tools-core)), $(eval $(curdir)/$(tool)/compile += $(curdir)/sed/compile))
$(curdir)/xz/compile += $(curdir)/flock/compile
# make some core tools depend on sed and flock
$(curdir)/patch/compile += $(curdir)/sed/compile
$(curdir)/tar/compile += $(curdir)/sed/compile
$(curdir)/zstd/compile += $(curdir)/libdeflate/compile
$(curdir)/sed/compile := $(curdir)/flock/compile $(curdir)/xz/compile
$(curdir)/sed/compile := $(curdir)/flock/compile $(curdir)/zstd/compile
tools-y += flock sed
$(curdir)/autoremove := 1

View File

@ -1,28 +1,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf-archive
PKG_VERSION:=2021.02.19
PKG_VERSION:=2023.02.20
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf-archive
PKG_HASH:=e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd
PKG_HASH:=71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--datarootdir=$(STAGING_DIR_HOST)/share
define Host/Compile
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean
-export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@ -1,90 +0,0 @@
--- a/m4/ax_c_float_words_bigendian.m4
+++ b/m4/ax_c_float_words_bigendian.m4
@@ -27,32 +27,81 @@
# If neither value is found, the user is instructed to specify the
# ordering.
#
+# Early versions of this macro (i.e., before serial 12) would not work
+# when interprocedural optimization (via link-time optimization) was
+# enabled. This would happen when, say, the GCC/clang "-flto" flag, or the
+# ICC "-ipo" flag was used, for example. The problem was that under these
+# conditions, the compiler did not allocate for and write the special
+# float value in the data segment of the object file, since doing so might
+# not prove optimal once more context was available. Thus, the special
+# value (in platform-dependent binary form) could not be found in the
+# object file, and the macro would fail.
+#
+# The solution to the above problem was to:
+#
+# 1) Compile and link a whole test program rather than just compile an
+# object file. This ensures that we reach the point where even an
+# interprocedural optimizing compiler writes values to the data segment.
+#
+# 2) Add code that requires the compiler to write the special value to
+# the data segment, as opposed to "optimizing away" the variable's
+# allocation. This could be done via compiler keywords or options, but
+# it's tricky to make this work for all versions of all compilers with
+# all optimization settings. The chosen solution was to make the exit
+# code of the test program depend on the storing of the special value
+# in memory (in the data segment). Because the exit code can be
+# verified, any compiler that aspires to be correct will produce a
+# program binary that contains the value, which the macro can then find.
+#
+# How does the exit code depend on the special value residing in memory?
+# Memory, unlike variables and registers, can be addressed indirectly at
+# run time. The exit code of this test program is a result of indirectly
+# reading and writing to the memory region where the special value is
+# supposed to reside. The actual memory addresses used and the values to
+# be written are derived from the the program input ("argv") and are
+# therefore not known at compile or link time. The compiler has no choice
+# but to defer the computation to run time, and to prepare by allocating
+# and populating the data segment with the special value. For further
+# details, refer to the source code of the test program.
+#
+# Note that the test program is never meant to be run. It only exists to
+# host a double float value in a given platform's binary format. Thus,
+# error handling is not included.
+#
# LICENSE
#
-# Copyright (c) 2008 Daniel Amelang <dan@amelang.net>
+# Copyright (c) 2008, 2023 Daniel Amelang <dan@amelang.net>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 11
+#serial 13
AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
[AC_CACHE_CHECK(whether float word ordering is bigendian,
ax_cv_c_float_words_bigendian, [
ax_cv_c_float_words_bigendian=unknown
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+
+#include <stdlib.h>
+
+static double m[] = {9.090423496703681e+223, 0.0};
-double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
+int main (int argc, char *argv[])
+{
+ m[atoi (argv[1])] += atof (argv[2]);
+ return m[atoi (argv[3])] > 0.0;
+}
]])], [
-if grep noonsees conftest.$ac_objext >/dev/null ; then
+if grep noonsees conftest$EXEEXT >/dev/null ; then
ax_cv_c_float_words_bigendian=yes
fi
-if grep seesnoon conftest.$ac_objext >/dev/null ; then
+if grep seesnoon conftest$EXEEXT >/dev/null ; then
if test "$ax_cv_c_float_words_bigendian" = unknown; then
ax_cv_c_float_words_bigendian=no
else

View File

@ -1,4 +1,4 @@
#
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
@ -7,31 +7,25 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf
PKG_VERSION:=2.69
PKG_VERSION:=2.71
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/autoconf
PKG_HASH:=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
PKG_HASH:=431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--datarootdir=$(STAGING_DIR_HOST)/share
HOST_CONFIGURE_VARS += \
EMACS="no" \
PERL="/usr/bin/env perl"
define Host/Compile
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
-$(call Host/Compile/Default,--touch install-man1) # disable building of man pages
$(call Host/Compile/Default)
endef
define Host/Install
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean
-export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@ -1,7 +1,11 @@
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -28,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
@@ -30,9 +30,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@ -10,33 +14,23 @@
unshift @INC, "$pkgdatadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -50,7 +51,7 @@ use strict;
use vars qw ($config_h %verbatim %symbol);
@@ -54,7 +57,7 @@ use Autom4te::XFile;
our ($config_h, %symbol, %verbatim);
# Lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
local $config_h;
my $config_h_in;
my @prepend_include;
my @include;
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
@@ -26,9 +26,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
# autom4te - Wrapper around M4 libraries.
# Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
@@ -24,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@ -45,8 +39,8 @@
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -44,7 +47,8 @@ use File::Basename;
use strict;
@@ -48,7 +51,8 @@ use Autom4te::General;
use Autom4te::XFile;
# Data directory.
-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
@ -55,7 +49,7 @@
# $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
my %language;
@@ -87,7 +91,7 @@ my @include;
@@ -91,7 +95,7 @@ my @include;
my $freeze = 0;
# $M4.
@ -64,7 +58,7 @@
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
fatal "need GNU m4 1.4 or later: $m4"
if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
@@ -269,6 +273,12 @@ sub load_configuration ($)
@@ -272,6 +276,12 @@ sub load_configuration ($)
my @words = shellwords ($_);
my $type = shift @words;
@ -79,22 +73,13 @@
fatal "$file:$.: end-language missing for: $lang"
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
@@ -29,10 +29,13 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
# autoreconf - install the GNU Build System in a directory tree
# Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.
@@ -26,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
my $buildauxdir;
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@ -102,31 +87,25 @@
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -106,9 +109,9 @@ Written by David J. MacKenzie and Akim D
$buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux';
@@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D
";
# Lib files.
-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
+my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
my $automake = $ENV{'AUTOMAKE'} || 'automake';
my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
+my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
my $automake = $ENV{'AUTOMAKE'} || 'automake';
my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
--- a/bin/autoscan.in
+++ b/bin/autoscan.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -23,9 +23,12 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
@@ -28,9 +28,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
@ -138,7 +117,7 @@
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -91,10 +94,10 @@ my $configure_scan = 'configure.scan';
@@ -95,10 +98,10 @@ my %needed_macros =
my $log;
# Autoconf and lib files.
@ -153,15 +132,9 @@
# -----
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -24,9 +24,12 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
@@ -29,9 +29,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
@ -173,7 +146,7 @@
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -50,10 +53,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
@@ -55,10 +58,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
my $autoconf = "$autom4te --language=autoconf";
# We need to find m4sugar.
my @prepend_include;
@ -188,22 +161,12 @@
# $HELP
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
@@ -33,9 +33,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
# ifnames - print the identifiers used in C preprocessor conditionals
# Copyright (C) 1994-1995, 1999-2003, 2005-2012 Free Software
@@ -31,7 +33,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@ -214,15 +177,18 @@
# Override SHELL. On DJGPP SHELL may not be set to a shell
--- a/bin/autoconf.as
+++ b/bin/autoconf.as
@@ -84,7 +84,11 @@ exit_missing_arg='
@@ -89,8 +89,13 @@ exit_missing_arg='
# restore font-lock: '
# Variables.
-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
-: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+if test -n "$STAGING_DIR_HOST"; then
+ : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
+ : ${trailer_m4="$STAGING_DIR_HOST/share/autoconf/autoconf/trailer.m4"}
+else
+ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
+ : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+fi
autom4te_options=
outfile=

View File

@ -1,22 +0,0 @@
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in freeze.mk
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -225,7 +225,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in freeze.mk
edit = sed \

View File

@ -1,24 +0,0 @@
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -122,9 +122,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-musl* | \
+ linux-newlib* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@@ -1360,7 +1360,7 @@ case $os in
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
+ | -linux-musl* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \

View File

@ -13,7 +13,7 @@ PKG_DATE:=2022-07-05
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/mbuesch/b43-tools.git
PKG_SOURCE_VERSION:=2fe10ea6690df9a068cb21cde537236bae784a14
PKG_MIRROR_HASH:=4f1cde5da35a1e768f6a01d67888549d04512073990769342381af1b2c9e7fd2
PKG_MIRROR_HASH:=4009d6c1f9ede43102897d6ebf4bd954331f3c4e2a94d4e61c0e5f303f929914
include $(INCLUDE_DIR)/host-build.mk

View File

@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bash
PKG_CPE_ID:=cpe:/a:gnu:bash
PKG_VERSION:=5.2.15
PKG_VERSION:=5.2.21
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/bash
PKG_HASH:=13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c
PKG_HASH:=c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b977f078560d5b8
HOST_BUILD_PARALLEL := 1

View File

@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bison
PKG_VERSION:=3.8.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2
PKG_HASH:=06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb
PKG_CPE_ID:=cpe:/a:gnu:bison
HOST_BUILD_PARALLEL:=1

View File

@ -0,0 +1,43 @@
--- a/src/files.c
+++ b/src/files.c
@@ -560,9 +560,9 @@ pkgdatadir (void)
char const *
m4path (void)
{
- char const *m4 = getenv ("M4");
+ char const *m4 = getenv ("STAGING_DIR_HOST");
if (m4)
- return m4;
+ return strcat(getenv ("STAGING_DIR_HOST"), "/bin/m4");
/* We don't use relocate2() to store the temporary buffer and re-use
it, because m4path() is only called once. */
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -373,11 +373,13 @@ usage (int status)
A --long option is required.
Otherwise, add exceptions to ../build-aux/cross-options.pl. */
- printf (_("Usage: %s [OPTION]... FILE\n"), program_name);
+ printf (_("Usage: STAGING_DIR_HOST=... %s [OPTION]... FILE\n"), program_name);
fputs (_("\
Generate a deterministic LR or generalized LR (GLR) parser employing\n\
LALR(1), IELR(1), or canonical LR(1) parser tables.\n\
\n\
+Environment Variable STAGING_DIR_HOST controls path to m4\n\
+\n\
"), stdout);
fputs (_("\
@@ -450,6 +452,11 @@ Output Files:\n\
-M, --file-prefix-map=OLD=NEW replace prefix OLD with NEW when writing file paths\n\
in output files\n\
"), stdout);
+
+ fputs (_("\
+Environment Variables:\n\
+ STAGING_DIR_HOST Path to m4 is [STAGING_DIR_HOST]/bin/m4\n\
+"), stdout);
putc ('\n', stdout);
argmatch_report_usage (stdout);

32
tools/bzip2/Makefile Normal file
View File

@ -0,0 +1,32 @@
#
# Copyright (C) 2022 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bzip2
PKG_VERSION:=1.0.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://sourceware.org/pub/bzip2
PKG_HASH:=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
PKG_LICENSE:=bzip2-1.0.8
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:bzip:bzip2
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
HOSTCC := $(HOSTCC_NOCACHE)
HOST_CFLAGS += $(HOST_FPIC)
CMAKE_HOST_OPTIONS += -DENABLE_EXAMPLES=off
$(eval $(call HostBuild))

View File

@ -0,0 +1,27 @@
--- a/bzip2.c
+++ b/bzip2.c
@@ -69,7 +69,6 @@
#if BZ_UNIX
# include <fcntl.h>
# include <sys/types.h>
-# include <utime.h>
# include <unistd.h>
# include <sys/stat.h>
# include <sys/times.h>
@@ -1051,12 +1050,12 @@ void applySavedTimeInfoToOutputFile ( Ch
{
# if BZ_UNIX
IntNative retVal;
- struct utimbuf uTimBuf;
+ struct timespec uTimBuf[2] = {};
- uTimBuf.actime = fileMetaInfo.st_atime;
- uTimBuf.modtime = fileMetaInfo.st_mtime;
+ uTimBuf[0].tv_sec = fileMetaInfo.st_atime;
+ uTimBuf[1].tv_sec = fileMetaInfo.st_mtime;
- retVal = utime ( dstName, &uTimBuf );
+ retVal = utimensat ( AT_FDCWD, dstName, uTimBuf , 0 );
ERROR_IF_NOT_ZERO ( retVal );
# endif
}

View File

@ -0,0 +1,382 @@
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,354 @@
+cmake_minimum_required(VERSION 3.12)
+
+project(bzip2
+ VERSION 1.0.8
+ DESCRIPTION "This Bzip2/libbz2 a program and library for lossless block-sorting data compression."
+ LANGUAGES C)
+
+# See versioning rule:
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+#
+# KEEP THESE IN SYNC WITH meson.build OR STUFF WILL BREAK!
+set(LT_CURRENT 1)
+set(LT_REVISION 8)
+set(LT_AGE 0)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
+
+include_directories(${PROJECT_BINARY_DIR})
+
+math(EXPR LT_SOVERSION "${LT_CURRENT} - ${LT_AGE}")
+set(LT_VERSION "${LT_SOVERSION}.${LT_AGE}.${LT_REVISION}")
+set(PACKAGE_VERSION ${PROJECT_VERSION})
+
+set(ENABLE_APP_DEFAULT ON)
+set(ENABLE_EXAMPLES_DEFAULT OFF)
+set(ENABLE_DOCS_DEFAULT OFF)
+include(CMakeOptions.txt)
+
+if(ENABLE_LIB_ONLY AND (ENABLE_APP OR ENABLE_EXAMPLES))
+ # Remember when disabled options are disabled for later diagnostics.
+ set(ENABLE_LIB_ONLY_DISABLED_OTHERS 1)
+else()
+ set(ENABLE_LIB_ONLY_DISABLED_OTHERS 0)
+endif()
+if(ENABLE_LIB_ONLY)
+ set(ENABLE_APP OFF)
+ set(ENABLE_EXAMPLES OFF)
+endif()
+
+# Do not disable assertions based on CMAKE_BUILD_TYPE.
+foreach(_build_type Release MinSizeRel RelWithDebInfo)
+ foreach(_lang C)
+ string(TOUPPER CMAKE_${_lang}_FLAGS_${_build_type} _var)
+ string(REGEX REPLACE "(^|)[/-]D *NDEBUG($|)" " " ${_var} "${${_var}}")
+ endforeach()
+endforeach()
+
+# Support the latest c++ standard available.
+include(CheckCCompilerFlag)
+include(CheckCXXCompilerFlag)
+
+function(extract_valid_c_flags varname)
+ set(valid_flags)
+ foreach(flag IN LISTS ARGN)
+ string(REGEX REPLACE "[^a-zA-Z0-9_]+" "_" flag_var ${flag})
+ set(flag_var "C_FLAG_${flag_var}")
+ check_c_compiler_flag("${flag}" "${flag_var}")
+ if(${flag_var})
+ set(valid_flags "${valid_flags} ${flag}")
+ endif()
+ endforeach()
+ set(${varname} "${valid_flags}" PARENT_SCOPE)
+endfunction()
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the build type" FORCE)
+
+ # Include "None" as option to disable any additional (optimization) flags,
+ # relying on just CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (which are empty by
+ # default). These strings are presented in cmake-gui.
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+ None Debug Release MinSizeRel RelWithDebInfo)
+endif()
+
+# Install a symlink of script to the "bin" directory.
+# Not intended for use on Windows.
+function(install_script_symlink original symlink)
+ add_custom_command(OUTPUT ${symlink}
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${original} ${symlink}
+ DEPENDS ${original}
+ COMMENT "Generating symbolic link ${symlink} of ${original}")
+ add_custom_target(${symlink}_tgt ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${symlink})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${symlink} DESTINATION ${CMAKE_INSTALL_BINDIR})
+endfunction()
+
+# Install a symlink of binary target to the "bin" directory.
+# On Windows, it will be a copy instead of a symlink.
+function(install_target_symlink original symlink)
+ if(WIN32)
+ set(op copy)
+ set(symlink "${symlink}.exe")
+ else()
+ set(op create_symlink)
+ endif()
+ add_custom_command(TARGET ${original} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E ${op} $<TARGET_FILE_NAME:${original}> ${symlink}
+ WORKING_DIRECTORY $<TARGET_FILE_DIR:${original}>
+ COMMENT "Generating symbolic link (or copy) ${symlink} of ${original}")
+ install(PROGRAMS $<TARGET_FILE_DIR:${original}>/${symlink} DESTINATION ${CMAKE_INSTALL_BINDIR})
+endfunction()
+
+include(GNUInstallDirs)
+
+# Checks for header files.
+include(CheckIncludeFile)
+check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
+check_include_file(fcntl.h HAVE_FCNTL_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(limits.h HAVE_LIMITS_H)
+check_include_file(netdb.h HAVE_NETDB_H)
+check_include_file(netinet/in.h HAVE_NETINET_IN_H)
+check_include_file(pwd.h HAVE_PWD_H)
+check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(syslog.h HAVE_SYSLOG_H)
+check_include_file(time.h HAVE_TIME_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+
+include(CheckTypeSize)
+# Checks for typedefs, structures, and compiler characteristics.
+# AC_TYPE_SIZE_T
+check_type_size("ssize_t" SIZEOF_SSIZE_T)
+if(NOT SIZEOF_SSIZE_T)
+ # ssize_t is a signed type in POSIX storing at least -1.
+ # Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools).
+ set(ssize_t int)
+endif()
+
+include(CheckStructHasMember)
+check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_STRUCT_TM_TM_GMTOFF)
+
+include(CheckSymbolExists)
+# XXX does this correctly detect initgroups (un)availability on cygwin?
+check_symbol_exists(initgroups grp.h HAVE_DECL_INITGROUPS)
+if(NOT HAVE_DECL_INITGROUPS AND HAVE_UNISTD_H)
+ # FreeBSD declares initgroups() in unistd.h
+ check_symbol_exists(initgroups unistd.h HAVE_DECL_INITGROUPS2)
+ if(HAVE_DECL_INITGROUPS2)
+ set(HAVE_DECL_INITGROUPS 1)
+ endif()
+endif()
+
+set(WARNCFLAGS)
+if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
+ if(ENABLE_WERROR)
+ set(WARNCFLAGS /WX)
+ endif()
+else()
+ if(ENABLE_WERROR)
+ extract_valid_c_flags(WARNCFLAGS -Werror)
+ endif()
+
+ # For C compiler
+ # Please keep this list in sync with meson.build
+ extract_valid_c_flags(WARNCFLAGS
+ -Wall
+ -Wextra
+ -Wmissing-prototypes
+ -Wstrict-prototypes
+ -Wmissing-declarations
+ -Wpointer-arith
+ -Wdeclaration-after-statement
+ -Wformat-security
+ -Wwrite-strings
+ -Wshadow
+ -Winline
+ -Wnested-externs
+ -Wfloat-equal
+ -Wundef
+ -Wendif-labels
+ -Wempty-body
+ -Wcast-align
+ -Wclobbered
+ -Wvla
+ -Wpragmas
+ -Wunreachable-code
+ -Waddress
+ -Wattributes
+ -Wdiv-by-zero
+ -Wshorten-64-to-32
+ -Wconversion
+ -Wextended-offsetof
+ -Wformat-nonliteral
+ -Wlanguage-extension-token
+ -Wmissing-field-initializers
+ -Wmissing-noreturn
+ -Wmissing-variable-declarations
+ # -Wpadded # Not used because we cannot change public structs
+ -Wsign-conversion
+ # -Wswitch-enum # Not used because this basically disallows default case
+ -Wunreachable-code-break
+ -Wunused-macros
+ -Wunused-parameter
+ -Wredundant-decls
+ -Wheader-guard
+ -Wno-format-nonliteral # This is required because we pass format string as "const char*.
+ )
+endif()
+
+if(ENABLE_DEBUG)
+ set(DEBUGBUILD 1)
+endif()
+
+#add_definitions(-DHAVE_CONFIG_H)
+#configure_file(cmakeconfig.h.in config.h)
+
+# autotools-compatible names
+# Sphinx expects relative paths in the .rst files. Use the fact that the files
+# below are all one directory level deep.
+file(RELATIVE_PATH top_srcdir ${CMAKE_CURRENT_BINARY_DIR}/dir ${CMAKE_CURRENT_SOURCE_DIR})
+file(RELATIVE_PATH top_builddir ${CMAKE_CURRENT_BINARY_DIR}/dir ${CMAKE_CURRENT_BINARY_DIR})
+set(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR})
+# bzip2.pc (pkg-config file)
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
+set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR})
+set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+set(VERSION ${PACKAGE_VERSION})
+
+#
+# The build targets.
+# In a larger project, the following would be in subdirectories and
+# These targets would be included with `add_subdirectory()`
+#
+set(BZ2_SOURCES
+ blocksort.c
+ huffman.c
+ crctable.c
+ randtable.c
+ compress.c
+ decompress.c
+ bzlib.c)
+
+# The bz2 OBJECT-library, required for bzip2, bzip2recover.
+add_library(bz2_ObjLib OBJECT)
+target_sources(bz2_ObjLib
+ PRIVATE ${BZ2_SOURCES}
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
+
+if(ENABLE_SHARED_LIB)
+ # The libbz2 shared library.
+ add_library(bz2 SHARED ${BZ2_RES})
+ target_sources(bz2
+ PRIVATE ${BZ2_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/libbz2.def
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
+ # Always use '-fPIC'/'-fPIE' option for shared libraries.
+ set_property(TARGET bz2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+ set_target_properties(bz2 PROPERTIES
+ COMPILE_FLAGS "${WARNCFLAGS}"
+ VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION})
+ install(TARGETS bz2 DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+ if(USE_OLD_SONAME)
+ # Hack to support the old libbz2.so.1.0 version by including an extra copy.
+ # Technically the old SONAME is not libtool compatible.
+ # This hack is to support binary compatibility with libbz2 in some distro packages.
+ if(UNIX AND NOT APPLE)
+ add_library(bz2_old_soname SHARED ${BZ2_RES})
+ target_sources(bz2_old_soname
+ PRIVATE ${BZ2_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/libbz2.def
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h
+ )
+ set_target_properties(bz2_old_soname PROPERTIES
+ COMPILE_FLAGS "${WARNCFLAGS}"
+ VERSION ${LT_SOVERSION}.${LT_AGE} SOVERSION ${LT_SOVERSION}.${LT_AGE}
+ OUTPUT_NAME bz2
+ )
+ install(TARGETS bz2_old_soname DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ endif()
+endif()
+
+if(ENABLE_STATIC_LIB)
+ # The libbz2 static library.
+ add_library(bz2_static STATIC)
+ target_sources(bz2_static
+ PRIVATE ${BZ2_SOURCES}
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
+ set_target_properties(bz2_static PROPERTIES
+ COMPILE_FLAGS "${WARNCFLAGS}"
+ VERSION ${LT_VERSION}
+ SOVERSION ${LT_SOVERSION}
+ ARCHIVE_OUTPUT_NAME bz2_static)
+ target_compile_definitions(bz2_static PUBLIC BZ2_STATICLIB)
+ install(TARGETS bz2_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+endif()
+
+if(ENABLE_APP)
+ # The bzip2 executable.
+ add_executable(bzip2)
+ target_sources(bzip2
+ PRIVATE bzip2.c)
+ target_link_libraries(bzip2
+ PRIVATE bz2_ObjLib)
+ if(WIN32)
+ target_compile_definitions(bzip2 PUBLIC BZ_LCCWIN32 BZ_UNIX=0)
+ else()
+ target_compile_definitions(bzip2 PUBLIC BZ_LCCWIN32=0 BZ_UNIX)
+ endif()
+ install(TARGETS bzip2 DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ # Create bzip2 copies bzcat and bunzip.
+ # The default behavior is altered in bzip2.c code by checking the program name.
+ install_target_symlink(bzip2 bzcat)
+ install_target_symlink(bzip2 bunzip)
+
+ # The bzip2recover executable.
+ add_executable(bzip2recover)
+ target_sources(bzip2recover
+ PRIVATE bzip2recover.c)
+ target_link_libraries(bzip2recover
+ PRIVATE bz2_ObjLib)
+ if(WIN32)
+ target_compile_definitions(bzip2recover PUBLIC BZ_LCCWIN32 BZ_UNIX=0)
+ else()
+ target_compile_definitions(bzip2recover PUBLIC BZ_LCCWIN32=0 BZ_UNIX)
+ endif()
+ install(TARGETS bzip2recover DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if(ENABLE_EXAMPLES)
+ if(ENABLE_SHARED_LIB)
+ # The dlltest executable.
+ add_executable(dlltest)
+ target_sources(dlltest
+ PRIVATE dlltest.c)
+ target_link_libraries(dlltest bz2)
+ install(TARGETS dlltest DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ endif()
+
+ if(NOT WIN32)
+ # Install shell scripts, and renamed copies.
+ install(PROGRAMS bzdiff bzgrep bzmore
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ install_script_symlink(bzdiff bzcmp)
+
+ install_script_symlink(bzgrep bzegrep)
+ install_script_symlink(bzgrep bzfgrep)
+
+ install_script_symlink(bzmore bzless)
+ endif()
+
+endif()
--- /dev/null
+++ b/CMakeOptions.txt
@@ -0,0 +1,22 @@
+# Features that can be enabled for cmake (see CMakeLists.txt)
+
+option(ENABLE_WERROR "Turn on compile time warnings")
+
+option(ENABLE_DEBUG "Turn on debug output")
+
+option(ENABLE_APP "Build applications (bzip2, and bzip2recover)"
+ ${ENABLE_APP_DEFAULT})
+
+option(ENABLE_DOCS "Generate documentation"
+ ${ENABLE_DOCS_DEFAULT})
+
+option(ENABLE_EXAMPLES "Build examples"
+ ${ENABLE_EXAMPLES_DEFAULT})
+
+option(ENABLE_LIB_ONLY "Build libbz2 only. This is a short hand for -DENABLE_APP=0 -DENABLE_EXAMPLES=0")
+
+option(ENABLE_STATIC_LIB "Build libbz2 in static mode also")
+
+option(ENABLE_SHARED_LIB "Build libbz2 as a shared library" ON)
+
+option(USE_OLD_SONAME "Use libbz2.so.1.0 for compatibility with old Makefiles" OFF)

View File

@ -12,7 +12,7 @@ PKG_SOURCE_DATE := 2017-04-13
PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage-configs.git
PKG_SOURCE_VERSION := 7c3b458b93ed6947cd083623f543e93f9103cc0f
PKG_MIRROR_HASH := 1d24421af8cf74ec2d625e237aa8121b1273774c4380ad333e2954e052a5a4fe
PKG_MIRROR_HASH := 6ba2dde907d3cc403720954738a92431b1f40d562db5815c08971c39374d72a1
include $(INCLUDE_DIR)/host-build.mk

View File

@ -12,7 +12,7 @@ PKG_VERSION := 1.8
PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage.git
PKG_SOURCE_VERSION := 7c9db585d06cce9efffa2a82245f233233680060
PKG_MIRROR_HASH := 84d9abaaa3eddde05f506dc16effe1c9e18eb94727ed59c5e0a879baeb04e0b2
PKG_MIRROR_HASH := e38b1e9581524fcabc7b24fff1c18d13f7e3a93accf73c55caf33832249bfd03
HOST_BUILD_PARALLEL := 1

View File

@ -5,14 +5,13 @@
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/target.mk
PKG_NAME:=ccache
PKG_VERSION:=4.7.4
PKG_VERSION:=4.10.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION)
PKG_HASH:=df0c64d15d3efaf0b4f6837dd6b1467e40eeaaa807db25ce79c3a08a46a84e36
PKG_HASH:=108100960bb7e64573ea925af2ee7611701241abb36ce0aae3354528403a7d87
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
@ -22,20 +21,7 @@ CMAKE_HOST_OPTIONS += \
-DCMAKE_CXX_COMPILER_LAUNCHER="" \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \
-DENABLE_DOCUMENTATION=OFF \
-DREDIS_STORAGE_BACKEND=OFF
ifneq (docs-$(CONFIG_BUILD_DOCUMENTATION),docs-y)
CMAKE_HOST_OPTIONS += -DENABLE_DOCUMENTATION=OFF
endif
define Host/Install/ccache
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
$(CP) ./files/* $(STAGING_DIR_HOST)/bin/
endef
define Host/Install
$(call Host/Install/Default)
$(call Host/Install/ccache)
endef
$(eval $(call HostBuild))

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec ccache "${TARGET_CC_NOCACHE}" "$@"

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec ccache "${TARGET_CXX_NOCACHE}" "$@"

View File

@ -1,10 +1,10 @@
--- a/src/ccache.cpp
+++ b/src/ccache.cpp
@@ -1779,6 +1779,7 @@ get_manifest_key(Context& ctx, Hash& has
"CPLUS_INCLUDE_PATH",
"OBJC_INCLUDE_PATH",
"OBJCPLUS_INCLUDE_PATH", // clang
+ "GCC_HONOUR_COPTS",
nullptr};
--- a/src/ccache/ccache.cpp
+++ b/src/ccache/ccache.cpp
@@ -1914,6 +1914,7 @@ get_manifest_key(Context& ctx, Hash& has
"OBJCPLUS_INCLUDE_PATH", // Clang
"CLANG_CONFIG_FILE_SYSTEM_DIR", // Clang
"CLANG_CONFIG_FILE_USER_DIR", // Clang
+ "GCC_HONOUR_COPTS",
nullptr,
};
for (const char** p = envvars; *p; ++p) {
const char* v = getenv(*p);

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cmake
PKG_VERSION:=3.25.2
PKG_VERSION:=3.30.5
PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:kitware:cmake
@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
https://cmake.org/files/v$(PKG_VERSION_MAJOR)/
PKG_HASH:=c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c
PKG_HASH:=9f55e1a40508f2f29b7e065fa08c29f82c402fa0402da839fffe64a25755a86d
HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_PARALLEL:=1
@ -30,6 +30,7 @@ HOST_CONFIGURE_VARS += \
MAKE="$(STAGING_DIR_HOST)/bin/ninja"
HOST_CONFIGURE_ARGS := \
--no-debugger \
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
--prefix="$(STAGING_DIR_HOST)" \
--system-expat \
@ -38,8 +39,6 @@ HOST_CONFIGURE_ARGS := \
--system-zstd \
--generator=Ninja
HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib
define Host/Compile/Default
+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
endef

View File

@ -11,15 +11,15 @@
# like vs9 or vs10
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -33,7 +33,7 @@ whether testing support should be enable
#
#
@@ -47,7 +47,7 @@ if(cmp0145 STREQUAL "")
message(AUTHOR_WARNING "${_cmp0145_warning}")
endif()
-option(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
find_package(Dart QUIET)
# We only get here if a project already ran include(Dart),
--- a/Tests/Contracts/VTK/Dashboard.cmake.in
+++ b/Tests/Contracts/VTK/Dashboard.cmake.in
@@ -25,7 +25,7 @@ ctest_empty_binary_directory(${CTEST_BIN

View File

@ -1,8 +1,8 @@
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -43,7 +43,13 @@ This module will set the following varia
version number as a string (ex: "5.0.3")
#]=======================================================================]
@@ -61,7 +61,13 @@ The following variables are provided for
cmake_policy(PUSH)
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
-find_path(LIBLZMA_INCLUDE_DIR lzma.h )
+if(UNIX)

View File

@ -20,7 +20,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -611,6 +611,14 @@ if(CURL_USE_OPENSSL)
@@ -648,6 +648,14 @@ if(CURL_USE_OPENSSL)
endif()
set(SSL_ENABLED ON)
set(USE_OPENSSL ON)

View File

@ -1,6 +1,6 @@
--- a/bootstrap
+++ b/bootstrap
@@ -1449,7 +1449,10 @@ int main(){ printf("1%c", (char)0x0a); r
@@ -1509,7 +1509,10 @@ int main(){ printf("1%c", (char)0x0a); r
' > "test.c"
cmake_original_make_flags="${cmake_make_flags}"
if test "x${cmake_parallel_make}" != "x"; then

View File

@ -1,6 +1,6 @@
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -85,10 +85,13 @@ else()
@@ -120,10 +120,13 @@ else()
set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
endif()

View File

@ -1,18 +1,11 @@
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -632,8 +632,13 @@ IF(ENABLE_ZSTD)
@@ -656,7 +656,7 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)
- FIND_PATH(ZSTD_INCLUDE_DIR zstd.h)
- FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd)
+ IF(UNIX)
+ FIND_PACKAGE(PkgConfig QUIET)
+ PKG_SEARCH_MODULE(PC_ZSTD libzstd)
+ ENDIF()
+
+ FIND_PATH(ZSTD_INCLUDE_DIR zstd.h HINTS ${PC_ZSTD_INCLUDEDIR} ${PC_ZSTD_INCLUDE_DIRS})
+ FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd HINTS ${PC_ZSTD_LIBDIR} ${PC_ZSTD_LIBRARY_DIRS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
ELSE(ENABLE_ZSTD)
- IF(0) # CMake does not let pkg-config override its search paths.
+ IF(1) # CMake does not let pkg-config override its search paths.
IF(UNIX)
FIND_PACKAGE(PkgConfig QUIET)
PKG_SEARCH_MODULE(PC_ZSTD libzstd)

View File

@ -0,0 +1,22 @@
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -858,7 +858,7 @@ if(CMake_USE_XCOFF_PARSER)
endif()
# Xcode only works on Apple
-if(APPLE)
+if(APPLE_DISABLED)
target_sources(
CMakeLib
PRIVATE
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -134,7 +134,7 @@
# include "cmGlobalGhsMultiGenerator.h"
#endif
-#if defined(__APPLE__)
+#if defined(__APPLE_DISABLED__)
# if !defined(CMAKE_BOOTSTRAP)
# include "cmGlobalXCodeGenerator.h"

View File

@ -8,30 +8,61 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=coreutils
PKG_CPE_ID:=cpe:/a:gnu:coreutils
PKG_VERSION:=9.3
PKG_VERSION:=9.5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/coreutils
PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa
PKG_HASH:=767ae6a22950ec42f3ba5f7c1de79dd27800ee8e9b8642da5dedb5974a1741e5
HOST_BUILD_PARALLEL := 1
BUILD_PROGRAMS = date readlink touch ln chown ginstall
PKG_PROGRAMS:=date readlink touch ln chown ginstall
include $(INCLUDE_DIR)/host-build.mk
BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS))
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
HOST_GNULIB_SKIP := \
lib/nstrftime.c \
lib/fprintftime.c \
lib/fcntl.in.h \
lib/locale.in.h
HOST_CONFIGURE_ARGS += \
--enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS)))
--enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
HOST_MAKE_FLAGS += \
PROGRAMS="$(BUILD_BINS)" \
$(AM_TOOL_PATHS_FAKE) \
PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
LIBRARIES= MANS= SUBDIRS=.
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS_FAKE) \
./bootstrap \
--bootstrap-sync \
--force \
--no-git \
--skip-po \
--gnulib-srcdir=$(GNULIB_SRCDIR) \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
$(foreach src,$(HOST_GNULIB_SKIP),mv -f $(HOST_BUILD_DIR)/$(src)~ $(HOST_BUILD_DIR)/$(src) || true; )
$(call Host/Configure/Default)
endef
define Host/Install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/
$(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
ln -sf ginstall $(1)/bin/install
endef

View File

@ -0,0 +1,45 @@
--- a/bootstrap
+++ b/bootstrap
@@ -244,7 +244,7 @@ check_exists() {
($2 --version </dev/null)
fi
else
- ($1 --version </dev/null) >/dev/null 2>&1
+ ($@ --version </dev/null) >/dev/null 2>&1
fi
test $? -lt 126
@@ -309,7 +309,7 @@ p
q'
get_version() {
- app=$1
+ app="$@"
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
@@ -366,13 +366,13 @@ check_versions() {
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
- if ! check_exists --verbose $app; then
+ if ! check_exists --verbose "$app"; then
warn_ "Error: '$app' not found"
ret=1
fi
else
# Require app to produce a new enough version string.
- inst_ver=$(get_version $app)
+ inst_ver=$(get_version "$app")
if [ ! "$inst_ver" ]; then
warn_ "Error: '$app' not found"
ret=1
@@ -1157,7 +1157,7 @@ autogen()
# two just-pre-run programs.
# Import from gettext.
- with_gettext=yes
+ with_gettext=no
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no

View File

@ -3,13 +3,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dwarves
PKG_VERSION:=1.25
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=1.27
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://fedorapeople.org/~acme/dwarves/
PKG_HASH:=e7d45955f6f4eca25a4c8c3bd6611059b35dc217e45976681d7db170fccdec4a
PKG_HASH:=ef7f21f1c6016896d03a01f05cab225151f9068e19cc8cddc6e754b2b5cbe279
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING

View File

@ -0,0 +1,12 @@
--- a/pahole.c
+++ b/pahole.c
@@ -3723,6 +3723,9 @@ int main(int argc, char *argv[])
goto out;
}
+ if (getenv("SOURCE_DATE_EPOCH") || getenv("KBUILD_BUILD_TIMESTAMP"))
+ conf_load.reproducible_build = true;
+
if (dwarves__init()) {
fputs("pahole: insufficient memory\n", stderr);
goto out;

View File

@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
PKG_VERSION:=1.46.5
PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
PKG_RELEASE:=2
PKG_VERSION:=1.46.6
PKG_HASH:=skip
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
HOST_BUILD_PARALLEL:=1
@ -30,7 +30,8 @@ HOST_CONFIGURE_ARGS += \
--enable-libuuid \
--disable-tls \
--disable-nls \
--enable-threads=pth
--enable-threads=pth \
--disable-fuse2fs
define Host/Prepare
$(call Host/Prepare/Default)

View File

@ -1,11 +1,11 @@
--- a/configure
+++ b/configure
@@ -12538,7 +12538,7 @@ $as_echo_n "checking for system crontab
@@ -15259,7 +15259,7 @@ then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
$as_echo "${crond_dir}" >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
printf "%s\n" "${crond_dir}" >&6; }
- have_crond="yes"
+ have_crond="no"; with_crond_dir=""
else
else $as_nop

View File

@ -1,50 +0,0 @@
From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Thu, 21 Apr 2022 19:31:48 +0200
Subject: libext2fs: add sanity check to extent manipulation
It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.
Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().
Note that e2fsck is currently unable to spot and fix such corruption in
pass1.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
lib/ext2fs/extent.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -495,6 +495,10 @@ retry:
ext2fs_le16_to_cpu(eh->eh_entries);
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
+ /* Make sure there is at least one extent present */
+ if (newpath->left <= 0)
+ return EXT2_ET_EXTENT_NO_DOWN;
+
if (path->left > 0) {
ix++;
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte
cp = path->curr;
+ /* Sanity check before memmove() */
+ if (path->left < 0)
+ return EXT2_ET_EXTENT_LEAF_BAD;
+
if (path->left) {
memmove(cp, cp + sizeof(struct ext3_extent_idx),
path->left * sizeof(struct ext3_extent_idx));

View File

@ -1,6 +1,6 @@
--- elftosb-10.12.01/makefile.rules 2012-03-15 11:01:44.979020178 -0400
+++ elftosb-10.12.01/makefile.rules 2012-03-15 11:01:16.332761989 -0400
@@ -101,7 +101,7 @@
--- a/makefile.rules
+++ b/makefile.rules
@@ -101,7 +101,7 @@ OBJ_FILES_KEYGEN = \
keygen.o

View File

@ -5,9 +5,8 @@ others once multiarch becomes more common.
This patch makes the types a relative path, and allows the system
to use whatever include paths it feels are correct.
diff -Naurp elftosb-10.12.01-orig/common/stdafx.h elftosb-10.12.01/common/stdafx.h
--- elftosb-10.12.01-orig/common/stdafx.h 2012-07-12 13:30:10.990249396 -0400
+++ elftosb-10.12.01/common/stdafx.h 2012-07-12 13:30:06.858249391 -0400
--- a/common/stdafx.h
+++ b/common/stdafx.h
@@ -27,7 +27,7 @@
// For Linux systems only, types.h only defines the signed
// integer types. This is not professional code.

View File

@ -3,12 +3,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=elfutils
PKG_VERSION:=0.188
PKG_VERSION:=0.191
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
PKG_HASH:=fb8b0e8d0802005b9a309c60c1d8de32dd2951b56f0c3a3cb56d21ce01595dff
PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3

View File

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=expat
PKG_CPE_ID:=cpe:/a:libexpat:expat
PKG_VERSION:=2.5.0
PKG_CPE_ID:=cpe:/a:libexpat:libexpat
PKG_VERSION:=2.6.3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=17aa6cfc5c4c219c09287abfc10bc13f0c06f30bb654b28bfe6f567ca646eb79
PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION))
HOST_BUILD_PARALLEL:=1
@ -24,6 +24,7 @@ HOSTCC := $(HOSTCC_NOCACHE)
HOST_CONFIGURE_ARGS += \
--disable-shared \
--without-docbook \
--without-tests \
--with-pic
define Host/Uninstall

View File

@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fakeroot
PKG_VERSION:=1.29
PKG_VERSION:=1.36
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot
PKG_HASH:=8fbbafb780c9173e3ace4a04afbc1d900f337f3216883939f5c7db3431be7c20
PKG_HASH:=7fe3cf3daf95ee93b47e568e85f4d341a1f9ae91766b4f9a9cdc29737dea4988
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf

View File

@ -6,5 +6,5 @@
-SUBDIRS=doc scripts test
+SUBDIRS=scripts test
noinst_LTLIBRARIES = libcommunicate.la libmacosx.la
noinst_LTLIBRARIES = libcommunicate.la libmacosx.la libfakeroot_time64.la
libcommunicate_la_SOURCES = communicate.c

View File

@ -0,0 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
@@ -390,7 +390,7 @@ dnl Digital Unix: stat
time64_hack=no
AH_TEMPLATE([TIME64_HACK], [time64 shuffle])
AC_MSG_CHECKING([if we need to cope with time64])
-AC_EGREP_CPP([time64],[
+AC_EGREP_CPP([_*[a-z0-9]+_time64[^_]],[
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#define __USE_TIME_BITS64 1

View File

@ -21,14 +21,3 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
#endif
@@ -142,8 +144,9 @@
/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
id_t is used everywhere, just happens to be int on some OSes */
-#ifndef _ID_T
+#if !defined(_ID_T) && !defined(__DEFINED_id_t)
#define _ID_T
+#define __DEFINED_id_t
typedef int id_t;
#endif
#endif

View File

@ -24,10 +24,10 @@
#include <spawn.h>
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa
#endif
@@ -51,9 +51,11 @@ getattrlist$UNIX2003;int;(const char *pa
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
#include <spawn.h>
+#if !__DARWIN_ONLY_64_BIT_INO_T
lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
@ -36,7 +36,7 @@
posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
#endif
@@ -229,7 +231,7 @@ facl;int;(int fd, int cmd, int cnt, void
@@ -235,7 +237,7 @@ facl;int;(int fd, int cmd, int cnt, void
#ifdef HAVE_FTS_READ
fts_read;FTSENT *;(FTS *ftsp);(ftsp)
#ifdef __APPLE__
@ -45,7 +45,7 @@
fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp)
#endif
#endif /* ifdef __APPLE__ */
@@ -237,7 +239,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
@@ -243,7 +245,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
#ifdef HAVE_FTS_CHILDREN
fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
#ifdef __APPLE__

View File

@ -8,11 +8,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=findutils
PKG_CPE_ID:=cpe:/a:gnu:findutils
PKG_VERSION:=4.9.0
PKG_VERSION:=4.10.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe
PKG_HASH:=1387e0b67ff247d2abde998f90dfbf70c1491391a59ddfecb8ae698789f0a4f5
PKG_PROGRAMS:=find locate updatedb xargs
HOST_BUILD_PARALLEL:=1

View File

@ -1,20 +0,0 @@
--- a/find/parser.c
+++ b/find/parser.c
@@ -67,12 +67,12 @@
#include "findutils-version.h"
#include "system.h"
-
-#ifndef HAVE_ENDGRENT
-# define endgrent ()
+#if ! HAVE_ENDGRENT
+# define endgrent() ((void) 0)
#endif
-#ifndef HAVE_ENDPWENT
-# define endpwent ()
+
+#if ! HAVE_ENDPWENT
+# define endpwent() ((void) 0)
#endif
static bool parse_accesscheck (const struct parser_table*, char *argv[], int *arg_ptr);

View File

@ -11,9 +11,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2022-12-15
PKG_SOURCE_VERSION:=bd856eff48509fa4511169ee55f639ede8dd4ac6
PKG_MIRROR_HASH:=4dc754b403b10f43dc2871f17ef7b223c85ad3b14c57899497f0b6bb304756d9
PKG_SOURCE_DATE:=2024-10-20
PKG_SOURCE_VERSION:=4b7638925d3eac03e614e40bc30cb49f5877c46d
PKG_MIRROR_HASH:=ea0e30f2b20211e4153704019ebb3f8789269893a4af6d853a85fae7c091802c
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

View File

@ -1,38 +0,0 @@
diff -ruN firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c firmware-utils-2022-02-28-002cfaf0/src/ptgen.c
--- firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c 2022-04-23 19:02:07.307896842 +0200
+++ firmware-utils-2022-02-28-002cfaf0/src/ptgen.c 2022-04-22 18:48:54.477970950 +0200
@@ -82,6 +82,14 @@
GUID_INIT( 0x0fc63daf, 0x8483, 0x4772, \
0x8e, 0x79, 0x3d, 0x69, 0xd8, 0x47, 0x7d, 0xe4)
+#define GUID_PARTITION_SIFIVE_SPL \
+ GUID_INIT( 0x5b193300, 0xfc78, 0x40cd, \
+ 0x80, 0x02, 0xe8, 0x6c, 0x45, 0x58, 0x0b, 0x47)
+
+#define GUID_PARTITION_SIFIVE_UBOOT \
+ GUID_INIT( 0x2e54b353, 0x1271, 0x4842, \
+ 0x80, 0x6f, 0xe4, 0x36, 0xd6, 0xaf, 0x69, 0x85)
+
#define GPT_HEADER_SIZE 92
#define GPT_ENTRY_SIZE 128
#define GPT_ENTRY_MAX 128
@@ -276,6 +284,19 @@
(1ULL << 56); /* success=1 */
return true;
}
+
+ if (!strcmp(type, "sifiveu_spl")) {
+ part->has_guid = true;
+ part->guid = GUID_PARTITION_SIFIVE_SPL;
+ return true;
+ }
+
+ if (!strcmp(type, "sifiveu_uboot")) {
+ part->has_guid = true;
+ part->guid = GUID_PARTITION_SIFIVE_UBOOT;
+ return true;
+ }
+
return false;
}

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=flex
PKG_CPE_ID:=cpe:/a:flex_project:flex
PKG_CPE_ID:=cpe:/a:westes:flex
PKG_VERSION:=2.6.4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@ -21,13 +21,17 @@ include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += --disable-shared
define Host/Compile
$(call Host/Compile/Default,SUBDIRS='src tools')
endef
define Host/Install
$(call Host/Install/Default)
$(call Host/Compile/Default,install SUBDIRS='src tools')
$(LN) flex $(STAGING_DIR_HOST)/bin/lex
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
-$(call Host/Compile/Default,uninstall SUBDIRS='src tools')
endef
define Host/Clean

View File

@ -1,13 +0,0 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,10 +43,7 @@ EXTRA_DIST = \
SUBDIRS = \
src \
- doc \
- examples \
po \
- tests \
tools
# Create the ChangeLog, but only if we're inside a git working directory

View File

@ -0,0 +1,23 @@
--- a/src/main.c
+++ b/src/main.c
@@ -213,6 +213,8 @@ int main (int argc, char *argv[])
void check_options (void)
{
+ const char * staging_dir = NULL;
+ char * m4_staging = NULL;
int i;
const char * m4 = NULL;
@@ -341,7 +343,10 @@ void check_options (void)
/* Setup the filter chain. */
output_chain = filter_create_int(NULL, filter_tee_header, headerfilename);
- if ( !(m4 = getenv("M4"))) {
+ if ( (staging_dir = getenv("STAGING_DIR_HOST"))) {
+ asprintf(&m4_staging, "%s/bin/m4", staging_dir);
+ m4 = m4_staging;
+ } else if ( !(m4 = getenv("M4"))) {
char *slash;
m4 = M4;
if ((slash = strrchr(M4, '/')) != NULL) {

View File

@ -13,12 +13,16 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac
HOST_FIXUP:=autoreconf
PKG_SUBDIRS:=$$$$(foreach dir,gl src skels,$$$$(wildcard $$$$(dir)) )
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/gengetopt $(STAGING_DIR_HOST)/bin/
endef

View File

@ -0,0 +1,25 @@
From bfba6445a778007f40af5cbfbe725e12c0fcafc6 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Tue, 5 Mar 2024 22:25:20 +0100
Subject: [PATCH] gm_utils.cpp: Call clear instead of empty.
Since the intention seem to be to erase the next word, I believe calling empty
was a mistake and it should have been clear. Empty does nothing in this
context.
* src/gm_utils.cpp (wrap_cstr): Call clear.
---
src/gm_utils.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/gm_utils.cpp
+++ b/src/gm_utils.cpp
@@ -311,7 +311,7 @@ void wrap_cstr(string& wrapped, unsigned
// trim leading spaces
std::size_t pos = next_word.find_first_not_of(' ');
if( pos == std::string::npos )
- next_word.empty();
+ next_word.clear();
else if( pos )
next_word.erase( 0, pos );

View File

@ -0,0 +1,33 @@
From a3d0a0419a35bef9b80a6a12432ab30e2d1e0f5a Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Tue, 5 Mar 2024 22:27:42 +0100
Subject: [PATCH] gm_utils.h: Drop std::unary_function.
I am not sure what it does, it is deprecated/removed (depending on C++ version)
and the advice seems to be that is just is not necessary. So just remove it.
* src/gm_utils.h (print_f, pair_print_f): Drop std::unary_function.
---
src/gm_utils.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/src/gm_utils.h
+++ b/src/gm_utils.h
@@ -117,7 +117,7 @@ bool string_contains(const char *s, cons
* Function object to print something into a stream (to be used with for_each)
*/
template<class T>
-struct print_f : public std::unary_function<T, void>
+struct print_f
{
print_f(std::ostream& out, const string &s = ", ") : os(out), sep(s) {}
void operator() (T x) { os << x << sep; }
@@ -129,7 +129,7 @@ struct print_f : public std::unary_funct
* Function object to print a pair into two streams (to be used with for_each)
*/
template<class T>
-struct pair_print_f : public std::unary_function<T, void>
+struct pair_print_f
{
pair_print_f(std::ostream& out1, std::ostream& out2, const string &s = ", ") :
os1(out1), os2(out2), sep(s) {}

View File

@ -1,33 +0,0 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4
-SUBDIRS = gl src doc tests
+SUBDIRS = gl src
gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE
--- a/Makefile.in
+++ b/Makefile.in
@@ -593,7 +593,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4
-SUBDIRS = gl src doc tests
+SUBDIRS = gl src
gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE
TARBALL = $(top_builddir)/gengetopt-$(PACKAGE_VERSION).tar.xz
all: config.h
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,7 @@
# with gengetopt; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-SUBDIRS = skels tests
+SUBDIRS = skels
bin_PROGRAMS = gengetopt

View File

@ -7,11 +7,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gmp
PKG_VERSION:=6.2.1
PKG_VERSION:=6.3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gmp/
PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
PKG_HASH:=e56fd59d76810932a0555aa15a14b61c16bed66110d3c75cc2ac49ddaa9ab24c
PKG_CPE_ID:=cpe:/a:gmplib:gmp
HOST_FIXUP:=autoreconf

View File

@ -2,11 +2,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gnulib
PKG_CPE_ID:=cpe:/a:gnu:$(PKG_NAME)
PKG_VERSION:=f9a4ee73c3e7b544f640d0d04b55983d3a7b894e# # master
PKG_VERSION:=c99c8d491850dc3a6e0b8604a2729d8bc5c0eff1# # stable-202401
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.savannah.gnu.org/cgit/$(PKG_NAME).git/snapshot
PKG_HASH:=514716d58987a9c0de0d69fb22d42bcd19edf80eed099882a004ff162060f1a8
PKG_HASH:=8e6f4a907d9677b55fd452e1340a3e030a6f530b138d420c11975da33f086b1e
include $(INCLUDE_DIR)/host-build.mk
@ -14,12 +14,15 @@ define Host/Configure
endef
define Host/Install
$(INSTALL_DIR) $(1)/share/aclocal
$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(1)/share/aclocal/
$(INSTALL_DIR) $(1)/share/gnulib
$(CP) $(HOST_BUILD_DIR)/* $(1)/share/gnulib/
ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool
endef
define Host/Clean
rm -rf $(STAGING_DIR_HOST)/share/gnulib
rm -rf $(STAGING_DIR_HOST)/bin/gnulib-tool $(STAGING_DIR_HOST)/share/gnulib
endef
$(eval $(call HostBuild))

View File

@ -43,7 +43,7 @@
if [ ! "$inst_ver" ]; then
warn_ "Error: '$app' not found"
ret=1
@@ -1135,7 +1135,7 @@ autogen()
@@ -1157,7 +1157,7 @@ autogen()
# two just-pre-run programs.
# Import from gettext.

View File

@ -0,0 +1,47 @@
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -346,6 +346,34 @@ Options for --import, --add/remove-impor
Report bugs to <bug-gnulib@gnu.org>."
}
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
+
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
+
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
+
+# The following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
+
+# get_version
+# copied from build-aux/bootstrap
+get_version () {
+ app=$1
+
+ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
+
+ $app --version 2>&1 | sed -n "$get_version_sed"
+}
+
# func_version
# outputs to stdout the --version message.
func_version ()
@@ -1620,6 +1648,9 @@ func_determine_path_separator
fi
case "$autoconf_minversion" in
1.* | 2.[0-5]* | 2.6[0-3]*)
+ # if the version of autoconf in use is high enough, do not error
+ case "$(get_version autoconf)" in 1.* | 2.[0-5]* | 2.6[0-3]*) false ;; esac && \
+ func_warning "gnulib requires a newer version of autoconf than configure.ac ( $DEFAULT_AUTOCONF_MINVERSION > AC_PREREQ([$autoconf_minversion]) )" || \
func_fatal_error "minimum supported autoconf version is 2.64. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;;
esac

View File

@ -0,0 +1,19 @@
--- /dev/null
+++ b/lib/fts.h
@@ -0,0 +1,6 @@
+#ifdef __APPLE__
+# define _FTS_H_ 1
+# include <fts_.h>
+#else
+# include_next <fts.h>
+#endif
--- a/modules/fts
+++ b/modules/fts
@@ -2,6 +2,7 @@ Description:
Traverse a file hierarchy.
Files:
+lib/fts.h
lib/fts_.h
lib/fts.c
lib/fts-cycle.c

View File

@ -0,0 +1,193 @@
--- a/lib/search.in.h
+++ b/lib/search.in.h
@@ -112,6 +112,11 @@ _GL_CXXALIASWARN (lsearch);
# define twalk rpl_twalk
# endif
# endif
+# if @REPLACE_TDESTROY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define tdestroy rpl_tdestroy
+# endif
+# endif
/* See <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/search.h.html>
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/tsearch.html>
@@ -137,6 +142,7 @@ extern "C" {
# if !GNULIB_defined_search_fn_types
typedef int (*_gl_search_compar_fn) (const void *, const void *);
typedef void (*_gl_search_action_fn) (const void *, VISIT, int);
+typedef void (*_gl_search_free_fn) (void *);
# define GNULIB_defined_search_fn_types 1
# endif
# ifdef __cplusplus
@@ -252,9 +258,36 @@ _GL_CXXALIAS_SYS (twalk, void,
_GL_CXXALIASWARN (twalk);
# endif
+/* Removes the whole tree pointed to by root,
+ freeing all resources allocated by the tsearch() function.
+ The FREE_NODE function is called:
+ - For the data in each tree node.
+ - Even when no such work is necessary, to a function doing nothing
+ The arguments passed to FREE_NODE are:
+ 1. The pointer to the data. */
+# if @REPLACE_TDESTROY@
+_GL_FUNCDECL_RPL (tdestroy, void,
+ (void *vroot, _gl_search_free_fn freefct)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (tdestroy, void,
+ (void *vroot, _gl_search_free_fn freefct));
+# else
+# if !@HAVE_TDESTROY@
+_GL_FUNCDECL_SYS (tdestroy, void,
+ (void *vroot, _gl_search_free_fn freefct)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (tdestroy, void,
+ (void *vroot, _gl_search_free_fn freefct));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (tdestroy);
+# endif
+
/* Flags used by tsearch.c. */
# define GNULIB_defined_tsearch (@REPLACE_TSEARCH@ || !@HAVE_TSEARCH@)
# define GNULIB_defined_twalk (@REPLACE_TWALK@ || !@HAVE_TWALK@)
+# define GNULIB_defined_tdestroy (@REPLACE_TDESTROY@ || !@HAVE_TDESTROY@)
#elif defined GNULIB_POSIXCHECK
# undef tsearch
@@ -277,6 +310,11 @@ _GL_WARN_ON_USE (tdelete, "tdelete is un
_GL_WARN_ON_USE (twalk, "twalk is unportable - "
"use gnulib module tsearch for portability");
# endif
+# undef tdestroy
+# if HAVE_RAW_DECL_TDESTROY
+_GL_WARN_ON_USE (tdestroy, "tdestroy is unportable - "
+ "use gnulib module tsearch for portability");
+# endif
#endif
--- a/lib/tsearch.c
+++ b/lib/tsearch.c
@@ -98,12 +98,14 @@
typedef int (*__compar_fn_t) (const void *, const void *);
typedef void (*__action_fn_t) (const void *, VISIT, int);
+typedef void (*__free_fn_t) (void *);
#ifndef weak_alias
# define __tsearch tsearch
# define __tfind tfind
# define __tdelete tdelete
# define __twalk twalk
+# define __tdestroy tdestroy
#endif
#ifndef internal_function
@@ -656,7 +658,7 @@ weak_alias (__twalk, twalk)
#endif /* GNULIB_defined_twalk */
-#ifdef _LIBC
+#if defined(_LIBC) || GNULIB_defined_tdestroy
/* The standardized functions miss an important functionality: the
tree cannot be removed easily. We provide a function to do this. */
@@ -683,6 +685,8 @@ __tdestroy (void *vroot, __free_fn_t fre
if (root != NULL)
tdestroy_recurse (root, freefct);
}
+#ifdef weak_alias
weak_alias (__tdestroy, tdestroy)
+#endif
-#endif /* _LIBC */
+#endif /* defined(_LIBC) || GNULIB_defined_tdestroy */
--- a/m4/search_h.m4
+++ b/m4/search_h.m4
@@ -39,7 +39,7 @@ AC_DEFUN_ONCE([gl_SEARCH_H],
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <search.h>
- ]], [tdelete tfind tsearch twalk])
+ ]], [tdelete tfind tsearch twalk tdestroy])
AC_REQUIRE([AC_C_RESTRICT])
])
@@ -75,8 +75,10 @@ AC_DEFUN([gl_SEARCH_H_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LFIND], [1])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEARCH], [1])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_TSEARCH=1; AC_SUBST([HAVE_TSEARCH])
- HAVE_TWALK=1; AC_SUBST([HAVE_TWALK])
- REPLACE_TSEARCH=0; AC_SUBST([REPLACE_TSEARCH])
- REPLACE_TWALK=0; AC_SUBST([REPLACE_TWALK])
+ HAVE_TSEARCH=1; AC_SUBST([HAVE_TSEARCH])
+ HAVE_TWALK=1; AC_SUBST([HAVE_TWALK])
+ HAVE_TDESTROY=1; AC_SUBST([HAVE_TDESTROY])
+ REPLACE_TSEARCH=0; AC_SUBST([REPLACE_TSEARCH])
+ REPLACE_TWALK=0; AC_SUBST([REPLACE_TWALK])
+ REPLACE_TDESTROY=0; AC_SUBST([REPLACE_TDESTROY])
])
--- a/m4/tsearch.m4
+++ b/m4/tsearch.m4
@@ -9,6 +9,7 @@ AC_DEFUN([gl_FUNC_TSEARCH],
AC_REQUIRE([gl_SEARCH_H_DEFAULTS])
gl_CHECK_FUNCS_ANDROID([tsearch], [[#include <search.h>]])
gl_CHECK_FUNCS_ANDROID([twalk], [[#include <search.h>]])
+ gl_CHECK_FUNCS_ANDROID([tdestroy], [[#include <search.h>]])
if test $ac_cv_func_tsearch = yes; then
dnl On OpenBSD 4.0, the return value of tdelete() is incorrect.
AC_REQUIRE([AC_PROG_CC])
@@ -50,6 +51,7 @@ main ()
*no)
REPLACE_TSEARCH=1
REPLACE_TWALK=1
+ REPLACE_TDESTROY=1
;;
esac
else
@@ -64,6 +66,12 @@ main ()
future*) REPLACE_TWALK=1 ;;
esac
fi
+ if test $ac_cv_func_tdestroy != yes; then
+ HAVE_TDESTROY=0
+ case "$gl_cv_onwards_func_tdestroy" in
+ future*) REPLACE_TDESTROY=1 ;;
+ esac
+ fi
])
# Prerequisites of lib/tsearch.c.
--- a/modules/search
+++ b/modules/search
@@ -37,8 +37,10 @@ search.h: search.in.h $(top_builddir)/co
-e 's/@''GNULIB_MDA_LSEARCH''@/$(GNULIB_MDA_LSEARCH)/g' \
-e 's|@''HAVE_TSEARCH''@|$(HAVE_TSEARCH)|g' \
-e 's|@''HAVE_TWALK''@|$(HAVE_TWALK)|g' \
+ -e 's|@''HAVE_TDESTROY''@|$(HAVE_TDESTROY)|g' \
-e 's|@''REPLACE_TSEARCH''@|$(REPLACE_TSEARCH)|g' \
-e 's|@''REPLACE_TWALK''@|$(REPLACE_TWALK)|g' \
+ -e 's|@''REPLACE_TDESTROY''@|$(REPLACE_TDESTROY)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
--- a/modules/tsearch
+++ b/modules/tsearch
@@ -11,7 +11,12 @@ search
configure.ac:
gl_FUNC_TSEARCH
gl_CONDITIONAL([GL_COND_OBJ_TSEARCH],
- [test $HAVE_TSEARCH = 0 || test $HAVE_TWALK = 0 || test $REPLACE_TSEARCH = 1 || test $REPLACE_TWALK = 1])
+ [test $HAVE_TSEARCH = 0 ||
+ test $HAVE_TWALK = 0 ||
+ test $HAVE_TDESTROY = 0 ||
+ test $REPLACE_TSEARCH = 1 ||
+ test $REPLACE_TWALK = 1 ||
+ test $REPLACE_TDESTROY = 1])
AM_COND_IF([GL_COND_OBJ_TSEARCH], [
gl_PREREQ_TSEARCH
])

View File

@ -0,0 +1,115 @@
--- a/lib/ialloc.h
+++ b/lib/ialloc.h
@@ -106,6 +106,8 @@ icalloc (idx_t n, idx_t s)
return calloc (n, s);
}
+#if GNULIB_REALLOCARRAY
+
/* ireallocarray (ptr, num, size) is like reallocarray (ptr, num, size).
It returns a non-NULL pointer to num * size bytes of memory.
Upon failure, it returns NULL with errno set. */
@@ -131,6 +133,8 @@ ireallocarray (void *p, idx_t n, idx_t s
return _gl_alloc_nomem ();
}
+#endif /* GNULIB_REALLOCARRAY */
+
#ifdef __cplusplus
}
#endif
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -51,12 +51,16 @@ ximalloc (idx_t s)
return nonnull (imalloc (s));
}
+#if GNULIB_REALLOCARRAY
+
char *
xcharalloc (size_t n)
{
return XNMALLOC (n, char);
}
+#endif /* GNULIB_REALLOCARRAY */
+
/* Change the size of an allocated block of memory P to S bytes,
with error checking. */
@@ -75,6 +79,8 @@ xirealloc (void *p, idx_t s)
return nonnull (irealloc (p, s));
}
+#if GNULIB_REALLOCARRAY
+
/* Change the size of an allocated block of memory P to an array of N
objects each of S bytes, with error checking. */
@@ -205,6 +211,8 @@ x2nrealloc (void *p, size_t *pn, size_t
return p;
}
+#endif /* GNULIB_REALLOCARRAY */
+
/* Grow PA, which points to an array of *PN items, and return the
location of the reallocated array, updating *PN to reflect its
new size. The new array will contain at least N_INCR_MIN more
--- a/lib/xalloc.h
+++ b/lib/xalloc.h
@@ -129,6 +129,7 @@ char *xstrdup (char const *str)
# define XCALLOC(n, t) \
((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
+# if GNULIB_REALLOCARRAY
/* Allocate an array of N objects, each with S bytes of memory,
dynamically, with error checking. S must be nonzero. */
@@ -156,6 +157,8 @@ char *xcharalloc (size_t n)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+# endif /* GNULIB_REALLOCARRAY */
+
#endif /* GNULIB_XALLOC */
--- a/lib/safe-alloc.h
+++ b/lib/safe-alloc.h
@@ -36,6 +36,8 @@ _GL_INLINE_HEADER_BEGIN
# define SAFE_ALLOC_INLINE _GL_INLINE
#endif
+#if GNULIB_REALLOCARRAY
+
/* Don't call these directly - use the macros below. */
SAFE_ALLOC_INLINE void *
safe_alloc_realloc_n (void *ptr, size_t count, size_t size)
@@ -51,6 +53,9 @@ safe_alloc_realloc_n (void *ptr, size_t
#endif
return ptr;
}
+
+#endif /* GNULIB_REALLOCARRAY */
+
_GL_ATTRIBUTE_NODISCARD SAFE_ALLOC_INLINE int
safe_alloc_check (void *ptr)
{
@@ -84,6 +89,8 @@ safe_alloc_check (void *ptr)
#define ALLOC_N(ptr, count) \
safe_alloc_check ((ptr) = calloc (count, sizeof *(ptr)))
+#if GNULIB_REALLOCARRAY
+
/**
* ALLOC_N_UNINITIALIZED:
* @ptr: pointer to allocated memory
@@ -112,6 +119,8 @@ safe_alloc_check (void *ptr)
#define REALLOC_N(ptr, count) \
safe_alloc_check ((ptr) = safe_alloc_realloc_n (ptr, count, sizeof *(ptr)))
+#endif /* GNULIB_REALLOCARRAY */
+
/**
* FREE:
* @ptr: pointer holding address to be freed

View File

@ -0,0 +1,56 @@
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -198,6 +198,8 @@ static int klibc_fcntl (int fd, int acti
FD_CLOEXEC is portable, but other flags may be present); otherwise
return -1 and set errno. */
+#if (GNULIB_defined_fcntl || GNULIB_defined_rpl_fcntl)
+
int
fcntl (int fd, int action, /* arg */...)
#undef fcntl
@@ -443,6 +445,8 @@ fcntl (int fd, int action, /* arg */...)
return result;
}
+#endif /* (GNULIB_defined_fcntl || GNULIB_defined_rpl_fcntl) */
+
static int
rpl_fcntl_DUPFD (int fd, int target)
{
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -1447,10 +1447,16 @@ _GL_FUNCDECL_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
_GL_CXXALIAS_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
+# if !GNULIB_defined_rpl_reallocarray
+# define GNULIB_defined_rpl_reallocarray 1
+# endif
# else
# if ! @HAVE_REALLOCARRAY@
_GL_FUNCDECL_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
+# if !GNULIB_defined_reallocarray
+# define GNULIB_defined_reallocarray 1
+# endif
# endif
_GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size));
--- a/lib/reallocarray.c
+++ b/lib/reallocarray.c
@@ -23,6 +23,8 @@
#include <stdlib.h>
#include <errno.h>
+#if (GNULIB_defined_reallocarray || GNULIB_defined_rpl_reallocarray)
+
void *
reallocarray (void *ptr, size_t nmemb, size_t size)
{
@@ -36,3 +38,5 @@ reallocarray (void *ptr, size_t nmemb, s
/* Rely on the semantics of GNU realloc. */
return realloc (ptr, nbytes);
}
+
+#endif /* (GNULIB_defined_reallocarray || GNULIB_defined_rpl_reallocarray) */

View File

@ -0,0 +1,326 @@
--- /dev/null
+++ b/modules/fallocate-posix
@@ -0,0 +1,43 @@
+Description:
+posix_fallocate function that is glibc compatible.
+
+Files:
+lib/posix_fallocate.c
+m4/fcntl_h.m4
+m4/posix_fallocate.m4
+
+Depends-on:
+errno [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+fcntl [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+fstat [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+ftruncate [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+pread [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+pwrite [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+stdint [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+sys_stat [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+unistd [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1]
+fcntl-h
+
+configure.ac:
+gl_FUNC_POSIX_FALLOCATE
+gl_CONDITIONAL([GL_COND_OBJ_POSIX_FALLOCATE],
+ [test $HAVE_FALLOCATE_POSIX = 0 || test $REPLACE_FALLOCATE_POSIX = 1])
+AM_COND_IF([GL_COND_OBJ_POSIX_FALLOCATE], [
+ gl_PREREQ_POSIX_FALLOCATE
+])
+gl_MODULE_INDICATOR([fallocate-posix])
+gl_FCNTL_MODULE_INDICATOR([fallocate-posix])
+
+Makefile.am:
+if GL_COND_OBJ_POSIX_FALLOCATE
+lib_SOURCES += posix_fallocate.c
+endif
+
+Include:
+<fcntl.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
--- /dev/null
+++ b/m4/posix_fallocate.m4
@@ -0,0 +1,20 @@
+# posix_fallocate.m4 serial 1
+dnl Copyright (C) 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_POSIX_FALLOCATE],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ gl_CHECK_FUNCS_ANDROID([posix_fallocate], [[#include <fcntl.h>]])
+ if test "$ac_cv_func_posix_fallocate" = no; then
+ HAVE_FALLOCATE_POSIX=0
+ case "$gl_cv_onwards_func_posix_fallocate" in
+ future*) REPLACE_FALLOCATE_POSIX=1 ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/posix_fallocate.c.
+AC_DEFUN([gl_PREREQ_POSIX_FALLOCATE], [:])
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -23,7 +23,7 @@ AC_DEFUN_ONCE([gl_FCNTL_H],
dnl corresponding gnulib module is not in use, if it is not common
dnl enough to be declared everywhere.
gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
- ]], [fcntl openat])
+ ]], [fcntl openat posix_fallocate])
])
# gl_FCNTL_MODULE_INDICATOR([modulename])
@@ -50,6 +50,7 @@ AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FALLOCATE_POSIX])
dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1])
@@ -61,10 +62,12 @@ AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS],
AC_DEFUN([gl_FCNTL_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
- HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
- REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
- REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
- REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
- REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ HAVE_FALLOCATE_POSIX=1; AC_SUBST([HAVE_FALLOCATE_POSIX])
+ REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+ REPLACE_FALLOCATE_POSIX=0; AC_SUBST([REPLACE_FALLOCATE_POSIX])
])
--- a/modules/fcntl-h
+++ b/modules/fcntl-h
@@ -40,14 +40,17 @@ fcntl.h: fcntl.in.h $(top_builddir)/conf
-e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
-e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
-e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+ -e 's/@''GNULIB_FALLOCATE_POSIX''@/$(GNULIB_FALLOCATE_POSIX)/g' \
-e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \
-e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \
-e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''HAVE_FALLOCATE_POSIX''@|$(HAVE_FALLOCATE_POSIX)|g' \
-e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
-e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e 's|@''REPLACE_FALLOCATE_POSIX''@|$(REPLACE_FALLOCATE_POSIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -238,6 +238,33 @@ _GL_WARN_ON_USE (openat, "openat is not
# endif
#endif
+#if @GNULIB_FALLOCATE_POSIX@
+# if @REPLACE_FALLOCATE_POSIX@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef posix_fallocate
+# define posix_fallocate rpl_posix_fallocate
+# endif
+_GL_FUNCDECL_RPL (posix_fallocate, int,
+ (int fd, off_t offset, off_t len));
+_GL_CXXALIAS_RPL (posix_fallocate, int,
+ (int fd, off_t offset, off_t len));
+# else
+# if !@HAVE_FALLOCATE_POSIX@
+_GL_FUNCDECL_SYS (posix_fallocate, int,
+ (int fd, off_t offset, off_t len));
+# endif
+_GL_CXXALIAS_SYS (posix_fallocate, int,
+ (int fd, off_t offset, off_t len));
+# endif
+_GL_CXXALIASWARN (posix_fallocate);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_fallocate
+# if HAVE_RAW_DECL_POSIX_FALLOCATE
+_GL_WARN_ON_USE (posix_fallocate, "posix_fallocate is not portable - "
+ "use gnulib module fallocate-posix for portability");
+# endif
+#endif
+
/* Fix up the FD_* macros, only known to be missing on mingw. */
--- /dev/null
+++ b/lib/posix_fallocate.c
@@ -0,0 +1,150 @@
+/* posix_fallocate function that is glibc compatible.
+
+ Copyright (C) 2024 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <sys/fcntl.h>
+#include <sys/stat.h>
+
+#ifdef __APPLE__
+# include <sys/param.h>
+# include <sys/mount.h>
+#else
+# include <sys/statfs.h>
+#endif
+
+/* Reserve storage for the data of the file associated with FD. This
+ emulation is far from perfect, but the kernel cannot do not much
+ better for network file systems, either. */
+
+int
+posix_fallocate (int fd, off_t offset, off_t len)
+{
+ int ret;
+ struct stat st;
+
+ if (fd < 0 || offset < 0 || len < 0)
+ return EINVAL;
+
+ /* Perform overflow check. The outer cast relies on a GCC
+ extension. */
+ if ((off_t) ((uint64_t) offset + (uint64_t) len) < 0)
+ return EFBIG;
+
+ /* pwrite below will not do the right thing in O_APPEND mode. */
+ {
+ int flags = fcntl (fd, F_GETFL, 0);
+ if (flags < 0 || (flags & O_APPEND) != 0)
+ return EBADF;
+ }
+
+ /* We have to make sure that this is really a regular file. */
+ if (fstat (fd, &st) != 0)
+ return EBADF;
+ if (S_ISFIFO (st.st_mode))
+ return ESPIPE;
+ if (! S_ISREG (st.st_mode))
+ return ENODEV;
+
+ if (len == 0)
+ {
+ /* This is racy, but there is no good way to satisfy a
+ zero-length allocation request. */
+ if (st.st_size < offset)
+ {
+ ret = ftruncate (fd, offset);
+
+ if (ret != 0)
+ ret = errno;
+ return ret;
+ }
+ return ret;
+ }
+
+#ifdef __APPLE__
+ fstore_t sto = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, offset + len, 0};
+ /* allocate continuous */
+ ret = fcntl (fd, F_PREALLOCATE, &sto);
+ if (ret < 0)
+ {
+ /* allocate non-continuous */
+ sto.fst_flags = F_ALLOCATEALL;
+ ret = fcntl (fd, F_PREALLOCATE, &sto);
+ if (ret < 0)
+ {
+ return ret;
+ }
+ }
+ ret = ftruncate(fd, offset + len);
+#else
+
+ /* Minimize data transfer for network file systems, by issuing
+ single-byte write requests spaced by the file system block size.
+ (Most local file systems have fallocate support, so this fallback
+ code is not used there.) */
+
+ unsigned increment;
+ {
+ struct statfs f;
+
+ if (fstatfs (fd, &f) != 0)
+ return errno;
+ if (f.f_bsize == 0)
+ increment = 512;
+ else if (f.f_bsize < 4096)
+ increment = f.f_bsize;
+ else
+ /* NFS does not propagate the block size of the underlying
+ storage and may report a much larger value which would still
+ leave holes after the loop below, so we cap the increment at
+ 4096. */
+ increment = 4096;
+ }
+
+ /* Write a null byte to every block. This is racy; we currently
+ lack a better option. Compare-and-swap against a file mapping
+ might additional local races, but requires interposition of a
+ signal handler to catch SIGBUS. */
+ for (offset += (len - 1) % increment; len > 0; offset += increment)
+ {
+ len -= increment;
+
+ if (offset < st.st_size)
+ {
+ unsigned char c;
+ ssize_t rsize = pread (fd, &c, 1, offset);
+
+ if (rsize < 0)
+ return errno;
+ /* If there is a non-zero byte, the block must have been
+ allocated already. */
+ else if (rsize == 1 && c != 0)
+ continue;
+ }
+
+ if (pwrite (fd, "", 1, offset) != 1)
+ return errno;
+ }
+
+#endif /* __APPLE__ */
+
+ return ret;
+}
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -2552,6 +2552,7 @@ func_all_modules ()
func_module execve
func_module execvp
func_module execvpe
+ func_module fallocate-posix
func_module fchdir
func_module fclose
func_module fcntl-h

View File

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_GENERIC_BITS_PER_LONG
#define __ASM_GENERIC_BITS_PER_LONG
#ifndef __BITS_PER_LONG
/*
* In order to keep safe and avoid regression, only unify uapi
* bitsperlong.h for some archs which are using newer toolchains
* that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.
* See the following link for more info:
* https://lore.kernel.org/linux-arch/b9624545-2c80-49a1-ac3c-39264a591f7b@app.fastmail.com/
*/
#if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
#define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
#else
/*
* There seems to be no way of detecting this automatically from user
* space, so 64 bit architectures should override this in their
* bitsperlong.h. In particular, an architecture that supports
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
* to decide it, but rather check a compiler provided macro.
*/
#define __BITS_PER_LONG 32
#endif
#endif
#endif /* __ASM_GENERIC_BITS_PER_LONG */

View File

@ -0,0 +1,12 @@
#ifndef __ASM_BYTEORDER_H
#define __ASM_BYTEORDER_H
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
#include <linux/byteorder/little_endian.h>
#else
#include <linux/byteorder/big_endian.h>
#endif
#endif

View File

@ -0,0 +1,40 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE 34 /* Math result not representable */
#endif

123
tools/include/asm/errno.h Normal file
View File

@ -0,0 +1,123 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_ERRNO_H
#define _ASM_GENERIC_ERRNO_H
#include <asm/errno-base.h>
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
/*
* This error code is special: arch syscall entry code will return
* -ENOSYS if users try to call a syscall that doesn't exist. To keep
* failures of syscalls that really do exist distinguishable from
* failures due to attempts to use a nonexistent syscall, syscall
* implementations should refrain from returning -ENOSYS.
*/
#define ENOSYS 38 /* Invalid system call number */
#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG 44 /* Channel number out of range */
#define EL2NSYNC 45 /* Level 2 not synchronized */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */
#define EUNATCH 49 /* Protocol driver not attached */
#define ENOCSI 50 /* No CSI structure available */
#define EL2HLT 51 /* Level 2 halted */
#define EBADE 52 /* Invalid exchange */
#define EBADR 53 /* Invalid request descriptor */
#define EXFULL 54 /* Exchange full */
#define ENOANO 55 /* No anode */
#define EBADRQC 56 /* Invalid request code */
#define EBADSLT 57 /* Invalid slot */
#define EDEADLOCK EDEADLK
#define EBFONT 59 /* Bad font file format */
#define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data available */
#define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */
#define ENONET 64 /* Machine is not on the network */
#define ENOPKG 65 /* Package not installed */
#define EREMOTE 66 /* Object is remote */
#define ENOLINK 67 /* Link has been severed */
#define EADV 68 /* Advertise error */
#define ESRMNT 69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
#define EREMCHG 78 /* Remote address changed */
#define ELIBACC 79 /* Can not access a needed shared library */
#define ELIBBAD 80 /* Accessing a corrupted shared library */
#define ELIBSCN 81 /* .lib section in a.out corrupted */
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
#define EILSEQ 84 /* Illegal byte sequence */
#define ERESTART 85 /* Interrupted system call should be restarted */
#define ESTRPIPE 86 /* Streams pipe error */
#define EUSERS 87 /* Too many users */
#define ENOTSOCK 88 /* Socket operation on non-socket */
#define EDESTADDRREQ 89 /* Destination address required */
#define EMSGSIZE 90 /* Message too long */
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
#define ENOPROTOOPT 92 /* Protocol not available */
#define EPROTONOSUPPORT 93 /* Protocol not supported */
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define EADDRINUSE 98 /* Address already in use */
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
#define ENETDOWN 100 /* Network is down */
#define ENETUNREACH 101 /* Network is unreachable */
#define ENETRESET 102 /* Network dropped connection because of reset */
#define ECONNABORTED 103 /* Software caused connection abort */
#define ECONNRESET 104 /* Connection reset by peer */
#define ENOBUFS 105 /* No buffer space available */
#define EISCONN 106 /* Transport endpoint is already connected */
#define ENOTCONN 107 /* Transport endpoint is not connected */
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
#define ETIMEDOUT 110 /* Connection timed out */
#define ECONNREFUSED 111 /* Connection refused */
#define EHOSTDOWN 112 /* Host is down */
#define EHOSTUNREACH 113 /* No route to host */
#define EALREADY 114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
#define EREMOTEIO 121 /* Remote I/O error */
#define EDQUOT 122 /* Quota exceeded */
#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#define ECANCELED 125 /* Operation Canceled */
#define ENOKEY 126 /* Required key not available */
#define EKEYEXPIRED 127 /* Key has expired */
#define EKEYREVOKED 128 /* Key has been revoked */
#define EKEYREJECTED 129 /* Key was rejected by service */
/* for robust mutexes */
#define EOWNERDEAD 130 /* Owner died */
#define ENOTRECOVERABLE 131 /* State not recoverable */
#define ERFKILL 132 /* Operation not possible due to RF-kill */
#define EHWPOISON 133 /* Memory page has hardware error */
#endif

View File

@ -0,0 +1,100 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_GENERIC_POSIX_TYPES_H
#define __ASM_GENERIC_POSIX_TYPES_H
#include <asm/bitsperlong.h>
/*
* This file is generally used by user-level software, so you need to
* be a little careful about namespace pollution etc.
*
* First the types that are often defined in different ways across
* architectures, so that you can override them.
*/
#ifndef __kernel_long_t
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;
#endif
#ifndef __kernel_ino_t
typedef __kernel_ulong_t __kernel_ino_t;
#endif
#ifndef __kernel_mode_t
typedef unsigned int __kernel_mode_t;
#endif
#ifndef __kernel_pid_t
typedef int __kernel_pid_t;
#endif
#ifndef __kernel_ipc_pid_t
typedef int __kernel_ipc_pid_t;
#endif
#ifndef __kernel_uid_t
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
#endif
#ifndef __kernel_suseconds_t
typedef __kernel_long_t __kernel_suseconds_t;
#endif
#ifndef __kernel_daddr_t
typedef int __kernel_daddr_t;
#endif
#ifndef __kernel_uid32_t
typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
#endif
#ifndef __kernel_old_uid_t
typedef __kernel_uid_t __kernel_old_uid_t;
typedef __kernel_gid_t __kernel_old_gid_t;
#endif
#ifndef __kernel_old_dev_t
typedef unsigned int __kernel_old_dev_t;
#endif
/*
* Most 32 bit architectures use "unsigned int" size_t,
* and all 64 bit architectures use "unsigned long" size_t.
*/
#ifndef __kernel_size_t
#if __BITS_PER_LONG != 64
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
#else
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;
#endif
#endif
#ifndef __kernel_fsid_t
typedef struct {
int val[2];
} __kernel_fsid_t;
#endif
/*
* anything below here should be completely generic
*/
typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
#endif /* __ASM_GENERIC_POSIX_TYPES_H */

19
tools/include/asm/swab.h Normal file
View File

@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_SWAB_H
#define _ASM_GENERIC_SWAB_H
#include <asm/bitsperlong.h>
/*
* 32 bit architectures typically (but not always) want to
* set __SWAB_64_THRU_32__. In user space, this is only
* valid if the compiler supports 64 bit data types.
*/
#if __BITS_PER_LONG == 32
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
#define __SWAB_64_THRU_32__
#endif
#endif
#endif /* _ASM_GENERIC_SWAB_H */

Some files were not shown because too many files have changed in this diff Show More