Skip to content

perl: add support for loongarch64 - #30386

Open
Cyanoxygen wants to merge 1 commit into
openwrt:masterfrom
Cyanoxygen:cyan/perl-add-loongarch64
Open

perl: add support for loongarch64#30386
Cyanoxygen wants to merge 1 commit into
openwrt:masterfrom
Cyanoxygen:cyan/perl-add-loongarch64

Conversation

@Cyanoxygen

Copy link
Copy Markdown

📦 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/*.t scripts.


🧪 Run Testing Details

  • OpenWrt Version: master 7b7cf1454abe88463560f4c9463e578baab4276a
  • OpenWrt Target/Subtarget: loongarch64/generic
  • OpenWrt Device: QEMU, 3B6000

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

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 openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +9 to +10
owrt:sig_name_extra='IOT POLL UNUSED'
owrt:sig_num_extra='6 29 31'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

Suggested change
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'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
doublekind='3'
doublekind='3'
fpossize='16'

Generated by Claude Code

# Architecture definitions
owrt:arch=loongarch64
owrt:bits=64
owrt:endian=little

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants