perl: add support for loongarch64 - #30386
Conversation
Config parameters grabbed from standard libraries and existing Perl build tree. Tested good on both glibc and musl with simple scripts. Signed-off-by: Xinhui Yang <[email protected]>
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 new commit. The file name matches ARCH:=loongarch64 in target/linux/loongarch64/Makefile, so files/$(ARCH).config picks it up, and the PKG_RELEASE bump to 7 is right for a change with no PKG_VERSION update. The commit message matches what the diff does.
Four findings, all inline, all about symbols this config leaves unset compared with the eleven existing per-arch configs. The SIGCLD omission is the one I'd call a real defect — t/base/*.t would not catch it. The d_long_double_style_ieee / fpossize ones affect what lands in the generated config.sh; the ccsymbols one is a nit and I've phrased it as a question. None of them look like merge blockers to a maintainer's eye, but the signal list is worth fixing before merge.
Generated by Claude Code
| owrt:sig_name_extra='IOT POLL UNUSED' | ||
| owrt:sig_num_extra='6 29 31' |
There was a problem hiding this comment.
SIGCLD is missing from the extra-signal list, so $SIG{CLD}, kill 'CLD', ... and POSIX's name↔number lookup won't know about it on loongarch64.
LoongArch uses the asm-generic signal numbering, where SIGCHLD is 17 and both glibc and musl alias SIGCLD to it. Every other arch config in this directory that uses asm-generic numbering lists it — e.g. riscv64.config:20-21 and aarch64.config:19-20 both use 'IOT CLD POLL UNUSED' / '6 17 29 31'. The two lists are consumed pairwise by signal.config, so both need the entry added at the same position.
| owrt:sig_name_extra='IOT POLL UNUSED' | |
| owrt:sig_num_extra='6 29 31' | |
| owrt:sig_name_extra='IOT CLD POLL UNUSED' | |
| owrt:sig_num_extra='6 17 29 31' |
Generated by Claude Code
|
|
||
| # Took from existing Perl 5.40 build. | ||
| d_casti32='define' | ||
| d_long_double_style_ieee='define' |
There was a problem hiding this comment.
d_long_double_style_ieee='define' is set without any of the three concrete styles, which leaves the generated config.sh self-contradictory: base.config:308-311 defaults _doubledouble, _extended and _std all to undef, and this file overrides only the umbrella symbol.
Perl's Configure derives the umbrella from the specific one, and longdblkind='1' (IEEE 754 128-bit little endian, correct for LoongArch64's binary128 long double) maps to d_long_double_style_ieee_std. Compare x86_64.config:10-11, which sets d_long_double_style_ieee together with _extended for its longdblkind='3'.
| d_long_double_style_ieee='define' | |
| d_long_double_style_ieee='define' | |
| d_long_double_style_ieee_std='define' |
Generated by Claude Code
| d_casti32='define' | ||
| d_long_double_style_ieee='define' | ||
| d_modflproto='define' | ||
| doublekind='3' |
There was a problem hiding this comment.
fpossize is never defined for this target. It is set only in the per-arch config files — all eleven existing ones define it (fpossize='16' in riscv64.config:13, aarch64.config and x86_64.config; 20 or 24 elsewhere) — and it appears in neither base.config, architecture.config nor misc.config, so on loongarch64 it drops out of the generated config.sh and $Config{fpossize} ends up undefined. sizeof(fpos_t) is 16 on both glibc and musl for LP64.
| doublekind='3' | |
| doublekind='3' | |
| fpossize='16' |
Generated by Claude Code
| # Architecture definitions | ||
| owrt:arch=loongarch64 | ||
| owrt:bits=64 | ||
| owrt:endian=little |
There was a problem hiding this comment.
nit: ccsymbols, cppccsymbols and cppsymbols are omitted. Like fpossize, they are defined only in the per-arch files (see riscv64.config:5-7), and all eleven existing ones set at least the two empty ones — so on loongarch64 they will be absent from config.sh entirely rather than empty. Was this deliberate (the dumps are large and mostly informational), or just not captured from the reference build?
Generated by Claude Code
📦 Package Details
Maintainer: @jw2013
Description:
This PR allows Perl to be built for LoongArch64, as it lacks the configuration file. Both glibc and musl are tested using perl's
t/base/*.tscripts.🧪 Run Testing Details
7b7cf1454abe88463560f4c9463e578baab4276aloongarch64/generic✅ Formalities