Initial Commit
- initial default booting image
This commit is contained in:
37
package/perl/Config.in
Normal file
37
package/perl/Config.in
Normal file
@@ -0,0 +1,37 @@
|
||||
config BR2_PACKAGE_PERL
|
||||
bool "perl"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
help
|
||||
Larry Wall's Practical Extraction and Report Language
|
||||
An interpreted scripting language, known among some as
|
||||
"Unix's Swiss Army Chainsaw".
|
||||
|
||||
https://www.perl.org/
|
||||
|
||||
if BR2_PACKAGE_PERL
|
||||
|
||||
config BR2_PACKAGE_PERL_MODULES
|
||||
string "custom module selection"
|
||||
help
|
||||
List of space-separated perl modules (without .pm) to copy
|
||||
to the rootfs.
|
||||
|
||||
Examples: constant Getopt/Std Time/Local
|
||||
|
||||
Module dependencies on external libraries are not automatic so
|
||||
check your needs.
|
||||
|
||||
Leave empty for all modules (as far as the external libraries
|
||||
are available).
|
||||
|
||||
config BR2_PACKAGE_PERL_THREADS
|
||||
bool "thread support"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
Enable use of threads in Perl scripts
|
||||
|
||||
WARNING: The use of interpreter-based threads in Perl
|
||||
is officially discouraged.
|
||||
See https://perldoc.perl.org/threads.html#WARNING
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,55 @@
|
||||
From 6bdfdff24f4a7d17d3b7d9d02bca3eac11c235a4 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Wed, 26 Aug 2026 19:34:39 +0200
|
||||
Subject: [PATCH] configure: keep _GNU_SOURCE in build flags
|
||||
|
||||
The checkfunc() function probes available libc functions with _GNU_SOURCE
|
||||
defined. The generated config.sh did not retain that define in ccflags, so
|
||||
the actual cross build could use functions whose prototypes remain hidden by
|
||||
feature-test macros. This breaks musl builds, where memrchr is declared only
|
||||
with _GNU_SOURCE.
|
||||
|
||||
To fix this, append _GNU_SOURCE to explicit -Dccflags values while parsing
|
||||
configure arguments. Such values are locked before configure_tool.sh can
|
||||
append flags. This keeps the function-availability checks and subsequent
|
||||
compilation in the same feature set, including when flags are supplied
|
||||
through CFLAGS.
|
||||
|
||||
This fixes the regression introduced by b40c560f5d5e (configure_func.sh: Add
|
||||
_GNU_SOURCE define and function signatures).
|
||||
|
||||
It fixes the following build issue with musl:
|
||||
|
||||
In file included from op.c:163:
|
||||
op.c: In function 'Perl_newATTRSUB_x':
|
||||
perl.h:2385:25: error: implicit declaration of function 'memrchr'; did
|
||||
you mean 'memchr'? [-Wimplicit-function-declaration]
|
||||
2385 | # define my_memrchr memrchr
|
||||
| ^~~~~~~
|
||||
|
||||
This issue is worked around in several build systems:
|
||||
|
||||
- In OpenEmbedded:
|
||||
https://github.com/openembedded/openembedded-core/commit/6422e62
|
||||
|
||||
- In NixOS:
|
||||
https://github.com/NixOS/nixpkgs/pull/441527
|
||||
|
||||
Fixes: https://github.com/arsv/perl-cross/issues/158
|
||||
Upstream: https://github.com/arsv/perl-cross/pull/180
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
|
||||
diff --git a/cnf/configure_args.sh b/cnf/configure_args.sh
|
||||
index 5bc4c6b..65ffc96 100644
|
||||
--- a/cnf/configure_args.sh
|
||||
+++ b/cnf/configure_args.sh
|
||||
@@ -225,6 +225,9 @@ while [ $i -le $# -o -n "$n" ]; do
|
||||
host|target|build) ;;
|
||||
# original Configure options
|
||||
D)
|
||||
+ if [ "$k" = 'ccflags' ]; then
|
||||
+ v="$v -D_GNU_SOURCE"
|
||||
+ fi
|
||||
setordefine "$k" "$x" "$v" 'define' 'true'
|
||||
;;
|
||||
U)
|
||||
12
package/perl/perl.hash
Normal file
12
package/perl/perl.hash
Normal file
@@ -0,0 +1,12 @@
|
||||
# Hashes from: https://www.cpan.org/src/5.0/perl-5.42.3.tar.xz.{md5,sha1,sha256}.txt
|
||||
md5 fb96e6cf064bf374e84ef232b0eda5c1 perl-5.42.3.tar.xz
|
||||
sha1 1d878802a55eacc778bb1d84b1f1b8ab9b22cc96 perl-5.42.3.tar.xz
|
||||
sha256 c9387e1473a1866935cb047ece7c2e0a80767a3acdecb79d4a375f8a95970ddc perl-5.42.3.tar.xz
|
||||
|
||||
# Hash from: https://github.com/arsv/perl-cross/releases/download/1.6.4/perl-cross-1.6.4.hash
|
||||
sha256 b6202173b0a8a43fb312867d85a8cd33527f3f234b1b6e591cdaa9895c9920c7 perl-cross-1.6.4.tar.gz
|
||||
|
||||
# Locally calculated
|
||||
sha256 dd90d4f42e4dcadf5a7c09eea0189d93c7b37ae560c91f0f6d5233ed3b9292a2 Artistic
|
||||
sha256 8979e6dd61852041643c5c5c40ea63b2bd1b438a67d114e62cbaef808c514315 Copying
|
||||
sha256 16381bf5fe73ad96ed26449b52eb4a85b2a32a49763c8a788d43af80f3add548 README
|
||||
138
package/perl/perl.mk
Normal file
138
package/perl/perl.mk
Normal file
@@ -0,0 +1,138 @@
|
||||
################################################################################
|
||||
#
|
||||
# perl
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# When updating the version here, also update utils/scancpan
|
||||
PERL_VERSION_MAJOR = 42
|
||||
PERL_VERSION = 5.$(PERL_VERSION_MAJOR).3
|
||||
PERL_SITE = https://www.cpan.org/src/5.0
|
||||
PERL_SOURCE = perl-$(PERL_VERSION).tar.xz
|
||||
PERL_LICENSE = Artistic or GPL-1.0+
|
||||
PERL_LICENSE_FILES = Artistic Copying README
|
||||
PERL_CPE_ID_VENDOR = perl
|
||||
PERL_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
|
||||
PERL_INSTALL_STAGING = YES
|
||||
|
||||
PERL_CROSS_VERSION = 1.6.4
|
||||
# DO NOT refactor with the github helper (the result is not the same)
|
||||
PERL_CROSS_SITE = https://github.com/arsv/perl-cross/releases/download/$(PERL_CROSS_VERSION)
|
||||
PERL_CROSS_SOURCE = perl-cross-$(PERL_CROSS_VERSION).tar.gz
|
||||
PERL_EXTRA_DOWNLOADS = $(PERL_CROSS_SITE)/$(PERL_CROSS_SOURCE)
|
||||
|
||||
# We use the perlcross hack to cross-compile perl. It should
|
||||
# be extracted over the perl sources, so we don't define that
|
||||
# as a separate package. Instead, it is downloaded and extracted
|
||||
# together with perl
|
||||
define PERL_CROSS_EXTRACT
|
||||
$(call suitable-extractor,$(PERL_CROSS_SOURCE)) $(PERL_DL_DIR)/$(PERL_CROSS_SOURCE) | \
|
||||
$(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -
|
||||
mv $(@D)/cnf/diffs/perl5-5.42.0 $(@D)/cnf/diffs/perl5-5.42.3
|
||||
endef
|
||||
PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
|
||||
|
||||
# We need to patch perl-cross, but perl-cross is extracted over the
|
||||
# target perl sources only (and not the host variant). So we apply the
|
||||
# patch only for the target case using a post patch hook.
|
||||
define PERL_CROSS_PATCH
|
||||
$(APPLY_PATCHES) $(@D) $(PERL_PKGDIR)/perl-cross \
|
||||
0001-configure-keep-_GNU_SOURCE-in-build-flags.patch
|
||||
endef
|
||||
PERL_POST_PATCH_HOOKS += PERL_CROSS_PATCH
|
||||
|
||||
# Even though perl is not an autotools-package, it uses config.sub and
|
||||
# config.guess. Up-to-date versions of these files may be needed to build perl
|
||||
# on newer host architectures, so we borrow the hook which updates them from the
|
||||
# autotools infrastructure.
|
||||
PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
||||
|
||||
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
|
||||
PERL_DEPENDENCIES += berkeleydb
|
||||
endif
|
||||
ifeq ($(BR2_PACKAGE_GDBM),y)
|
||||
PERL_DEPENDENCIES += gdbm
|
||||
endif
|
||||
|
||||
# We have to override LD, because an external multilib toolchain ld is not
|
||||
# wrapped to provide the required sysroot options.
|
||||
PERL_CONF_OPTS = \
|
||||
--target=$(GNU_TARGET_NAME) \
|
||||
--target-tools-prefix=$(TARGET_CROSS) \
|
||||
--prefix=/usr \
|
||||
-Dld="$(TARGET_CC)" \
|
||||
-Dccflags="$(TARGET_CFLAGS)" \
|
||||
-Dldflags="$(TARGET_LDFLAGS) -lm $(TARGET_NLS_LIBS)" \
|
||||
-Dmydomain="" \
|
||||
-Dmyhostname="noname" \
|
||||
-Dmyuname="Buildroot $(BR2_VERSION_FULL)" \
|
||||
-Dosname=linux \
|
||||
-Dosvers=$(LINUX_VERSION) \
|
||||
-Dperladmin=root
|
||||
|
||||
ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
|
||||
PERL_CONF_OPTS += -Dusedevel
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PERL_THREADS),y)
|
||||
PERL_CONF_OPTS += -Dusethreads
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),y)
|
||||
PERL_CONF_OPTS += --all-static --no-dynaloader
|
||||
endif
|
||||
|
||||
PERL_MODULES = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES))
|
||||
ifneq ($(PERL_MODULES),)
|
||||
PERL_CONF_OPTS += --only-mod=$(subst $(space),$(comma),$(PERL_MODULES))
|
||||
endif
|
||||
|
||||
define PERL_CONFIGURE_CMDS
|
||||
(cd $(@D); $(TARGET_MAKE_ENV) HOSTCC='$(HOSTCC_NOCCACHE)' \
|
||||
./configure $(PERL_CONF_OPTS))
|
||||
$(SED) 's/UNKNOWN-/Buildroot $(subst /,\/,$(BR2_VERSION_FULL)) /' $(@D)/patchlevel.h
|
||||
endef
|
||||
|
||||
define PERL_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) all
|
||||
endef
|
||||
|
||||
define PERL_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl install.sym
|
||||
endef
|
||||
|
||||
define PERL_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" install.perl install.sym
|
||||
endef
|
||||
|
||||
HOST_PERL_CONF_OPTS = \
|
||||
-des \
|
||||
-Dprefix="$(HOST_DIR)" \
|
||||
-Dcc="$(HOSTCC)" \
|
||||
-Dccflags="$(HOST_CFLAGS)" \
|
||||
-Dldflags="$(HOST_LDFLAGS)"
|
||||
|
||||
define HOST_PERL_CONFIGURE_CMDS
|
||||
(cd $(@D); $(HOST_MAKE_ENV) HOSTCC='$(HOSTCC_NOCCACHE)' \
|
||||
./Configure $(HOST_PERL_CONF_OPTS))
|
||||
endef
|
||||
|
||||
define HOST_PERL_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
|
||||
endef
|
||||
|
||||
define HOST_PERL_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) INSTALL_DEPENDENCE='' install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
|
||||
define PERL_FINALIZE_TARGET
|
||||
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
|
||||
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
|
||||
find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 | xargs -0 rm -f
|
||||
find $(TARGET_DIR)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
|
||||
find $(TARGET_DIR)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
|
||||
endef
|
||||
PERL_TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
|
||||
Reference in New Issue
Block a user