Bug 282663

Summary: lang/rust: building 1.82.0 on/for armv7 fails for multiple definitions and undefined field name
Product: Ports & Packages Reporter: Mark Millard <marklmi26-fbsd>
Component: Individual Port(s)Assignee: FreeBSD Rust Team <rust>
Status: Closed FIXED    
Severity: Affects Some People CC: asomers, fuz, jonc, marklmi26-fbsd, mikael, rcm
Priority: --- Flags: bugzilla: maintainer-feedback? (rust)
fuz: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
rust-1.82.0_1 build log on armv7 FreeBSD 14.1 none

Description Mark Millard 2024-11-10 04:51:13 UTC
This was a poudriere-devel based build after updating my
/usr/ports/ via git. I did this because someone asked if
I would also get build errors. The context is aarch64 with
an armv7 poudriere jail on a Windows Dev Kit 2023. It
supports user armv7 code. FreeBSD is main [so: 15].

The build log file reports . . .

error[E0428]: the name `type_of_thread_id` is defined multiple times
    --> /rust/deps/nix-0.29.0/src/sys/signal.rs:1110:1
     |
1107 | pub type type_of_thread_id = libc::lwpid_t;
     | ------------------------------------------- previous definition of the type `type_of_thread_id` here
...
1110 | pub type type_of_thread_id = libc::pid_t;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `type_of_thread_id` redefined here
     |
     = note: `type_of_thread_id` must be defined only once in the type namespace of this module
. . .

error[E0609]: no field `sigev_notify_thread_id` on type `signal::sigevent::ffi::sigevent`
    --> /rust/deps/nix-0.29.0/src/sys/signal.rs:1364:25
     |
1364 |                     sev.sigev_notify_thread_id = thread_id;
     |                         ^^^^^^^^^^^^^^^^^^^^^^ unknown field
     |
     = note: available fields are: `sigev_notify`, `sigev_signo`, `sigev_value`, `_sigev_un`

Some errors have detailed explanations: E0428, E0609.
For more information about an error, try `rustc --explain E0428`.
. . .
-------------
warning: `nix` (lib) generated 9 warnings
error: could not compile `nix` (lib) due to 2 previous errors; 9 warnings emitted

[I ignore later reporting that might be consequences of the above earlier
reports of errors.]


For reference:

# ~/fbsd-based-on-what-commit.sh -C /usr/ports/
716a5651faed (HEAD -> main, freebsd/main, freebsd/HEAD) net-mgmt/rubygem-oxidized-web: Fix dependency on www/rubygem-haml
Author:     Einar Bjarni Halldórsson <einar@isnic.is>
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2024-11-09 20:49:29 +0000
branch: main
merge-base: 716a5651faedef308ee5c267c381d6dd4483d88c
merge-base: CommitDate: 2024-11-09 20:49:29 +0000
n685665 (--first-parent --count for merge-base)

# uname -apKU
FreeBSD aarch64-main-pbase 15.0-CURRENT FreeBSD 15.0-CURRENT main-n273174-8b2e7da70855 GENERIC-NODEBUG arm64 aarch64 1500026 1500026

(That is an install of an official PkgBase kernel that was in use.)
Comment 1 Mark Millard 2024-11-10 04:57:51 UTC
(In reply to Mark Millard from comment #0)

It may well be that this submittal is mostly a reminder
to pick up an up stream fix if/when such becomes
available. I make no claim that the issue is FreeBSD
specific, though it could be. (A FreeBSD vs. gnu
confusion, where it appears to meet both criteria
at the same time?)
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2024-11-10 23:29:27 UTC
Notably, this is a different error than the one I got in (and still get) bug #280027.  Mark said he has a bunch of patches applied to his ports tree when he got this error.  Maybe that changed things?

What kernel version with what configuration are you testing on?
Comment 3 Mark Millard 2024-11-11 00:15:08 UTC
(In reply to Robert Clausecker from comment #2)

I already reported some kernel identification information,
repeated below:

# uname -apKU
FreeBSD aarch64-main-pbase 15.0-CURRENT FreeBSD 15.0-CURRENT main-n273174-8b2e7da70855 GENERIC-NODEBUG arm64 aarch64 1500026 1500026

That is from an installation of an official PkgBase kernel. As such
the configuration is as it was in the official PkgBase build. Any
/etc/src.conf or /etc/make.conf content, for example, came from
the PkgBase build server, not my context. I expect that
/usr/src/sys/arm64/conf/* related files involved are as they
were provided in the pkg that supplies /usr/src/sys/ content.

[I'll note that I also have the debug (WITNESS: just "GENERIC")
kernel from that PkgBase as well and could run while booted from
that.]

But PkgBase is a bit of a problem for well identifying its commit(s)
and the matching source code, especially because sys/ has its own
package that need not be from the same commit that the rest of the
source tree is from. Converting back to a pair of Commit-IDs is
not obvious as well. So I provide the following summary based on
snapshot IDs (snapshot date and time information):

# ~/pkgbase-snapshot-list.sh 
Via pkg-static info -C -x '^FreeBSD-' . . .
 352 FreeBSD-*-15.snap20241023235252
   1 FreeBSD-*-15.snap20241022122410
   1 FreeBSD-*-15.snap20241020224518
   1 FreeBSD-*-15.snap20241020094723
   7 FreeBSD-*-15.snap20241015203742
   1 FreeBSD-*-15.snap20241015145839
   1 FreeBSD-*-15.snap20241015120827
   1 FreeBSD-*-15.snap20241014101436
  34 FreeBSD-*-15.snap20241011184813
 129 FreeBSD-*-15.snap20241009162208
Instead via /var/cache/pkg/*.snap*.pkg . . .
 352 FreeBSD-*-15.snap20241023235252
   1 FreeBSD-*-15.snap20241022122410
   1 FreeBSD-*-15.snap20241020224518
   1 FreeBSD-*-15.snap20241020094723
   7 FreeBSD-*-15.snap20241015203742
   1 FreeBSD-*-15.snap20241015145839
   1 FreeBSD-*-15.snap20241015120827
   1 FreeBSD-*-15.snap20241014101436
  34 FreeBSD-*-15.snap20241011184813
 129 FreeBSD-*-15.snap20241009162208

(A full list of the individual packages would be over
500 packages long.)

As for kern.conftxt as seen via sysctl :

# sysctl kern.conftxt
kern.conftxt: options	CONFIG_AUTOGENERATED
ident	GENERIC-NODEBUG
machine	arm64
cpu	ARM64
makeoptions	MODULES_EXTRA=dtb/allwinner
makeoptions	WITH_CTF=1
makeoptions	DEBUG=-g
options	SOC_XILINX_ZYNQ
options	SOC_ROCKCHIP_RK3568
options	SOC_ROCKCHIP_RK3399
options	SOC_ROCKCHIP_RK3328
options	SOC_NXP_LS
options	SOC_NVIDIA_TEGRA210
options	SOC_MARVELL_8K
options	SOC_FREESCALE_IMX8
options	SOC_HISI_HI6220
options	THUNDERX_PASS_1_1_ERRATA
options	SOC_CAVM_THUNDERX
options	SOC_BRCM_NS2
options	SOC_BRCM_BCM2838
options	SOC_BRCM_BCM2837
options	RATELIMIT
options	COMPAT_LINUXKPI
options	SOC_APPLE_T8103
options	SOC_INTEL_STRATIX10
options	SOC_ALLWINNER_H6
options	SOC_ALLWINNER_H5
options	SOC_ALLWINNER_A64
options	FDT
options	IEEE80211_SUPPORT_MESH
options	USB_HOST_ALIGN=64
options	EVDEV_SUPPORT
options	NVME_USE_NVD=0
options	PCI_IOV
options	PCI_HP
options	PPS_SYNC
options	SMP
options	NETDUMP
options	DEBUGNET
options	ZSTDIO
options	GZIO
options	EKCD
options	ALT_BREAK_TO_DEBUGGER
options	VERBOSE_SYSINIT=0
options	GDB
options	DDB
options	KDB_TRACE
options	KDB
options	PERTHREAD_SSP
options	LINUX_BOOT_ABI
options	RCTL
options	RACCT_DEFAULT_TO_DISABLED
options	RACCT
options	VFP
options	INCLUDE_CONFIG_FILE
options	DDB_CTF
options	KDTRACE_HOOKS
options	KDTRACE_FRAME
options	MAC
options	CAPABILITIES
options	CAPABILITY_MODE
options	AUDIT
options	HWPMC_HOOKS
options	KBD_INSTALL_CDEV
options	PRINTF_BUFR_SIZE=128
options	_KPOSIX_PRIORITY_SCHEDULING
options	SYSVSEM
options	SYSVMSG
options	SYSVSHM
options	STACK
options	KTRACE
options	SCSI_DELAY=5000
options	COMPAT_FREEBSD14
options	COMPAT_FREEBSD13
options	COMPAT_FREEBSD12
options	COMPAT_FREEBSD11
options	COMPAT_FREEBSD32
options	EFIRT
options	GEOM_LABEL
options	GEOM_RAID
options	TMPFS
options	PSEUDOFS
options	PROCFS
options	CD9660
options	MSDOSFS
options	NFS_ROOT
options	NFSLOCKD
options	NFSD
options	NFSCL
options	MD_ROOT
options	QUOTA
options	UFS_GJOURNAL
options	UFS_DIRHASH
options	UFS_ACL
options	SOFTUPDATES
options	FFS
options	KERN_TLS
options	SCTP_SUPPORT
options	TCP_RFC7413
options	TCP_HHOOK
options	TCP_BLACKBOX
options	TCP_OFFLOAD
options	FIB_ALGO
options	ROUTE_MPATH
options	IPSEC_OFFLOAD
options	IPSEC_SUPPORT
options	INET6
options	INET
options	VIMAGE
options	PREEMPTION
options	NUMA
options	SCHED_ULE
options	NETLINK
options	INTRNG
options	CC_CUBIC
options	GEOM_PART_GPT
options	GEOM_PART_MBR
options	GEOM_PART_BSD
options	CC_CUBIC
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	KERN_TLS
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
options	FDT
device	mem
device	efidev
device	efirtc
device	smbios
device	pci
device	cpufreq
device	ahci
device	scbus
device	da
device	cd
device	pass
device	nvme
device	nvd
device	gpio
device	gpioled
device	fdt_pinctrl
device	gpioregulator
device	iicbus
device	iicmux
device	iic
device	icee
device	armv8crypto
device	spibus
device	pwm
device	uart
device	vt
device	kbdmux
device	vt_efifb
device	vt_simplefb
device	crypto
device	armv8_rng
device	loop
device	ether
device	vlan
device	tuntap
device	md
device	gif
device	firmware
device	clk
device	phy
device	hwreset
device	nvmem
device	regulator
device	syscon
device	evdev
device	uinput
device	iflib
device	em
device	ix
device	mdio
device	mii
device	miibus
device	bpf
device	netmap
device	ohci
device	uhci
device	ehci
device	xhci
device	usb
device	usbhid
device	hkbd
device	ukbd
device	umass
device	sound
device	mmc
device	mmcsd
device	hid
device	hidbus
device	mmio_sram
device	al_ccu
device	al_nb_service
device	al_iofic
device	al_serdes
device	al_udma
device	al_pci
device	uart_ns8250
device	al_eth
device	acpi
device	a10_timer
device	a31_dmac
device	aw_gpio
device	aw_rsb
device	twsi
device	sy8106a
device	aw_ccu
device	aw_r_intc
device	aw_nmi
device	aw_rtc
device	aw_wdog
device	aw_syscon
device	axp81x
device	aw_sid
device	aw_thermal
device	uart_snps
device	awg
device	aw_usbphy
device	musb
device	dwc3
device	aw_dwc3
device	a10_codec
device	aw_i2s
device	a33_codec
device	a64_codec
device	aw_mmc
device	dwgpio
device	dwc
device	dwc_socfpga
device	dwmmc
device	dwmmc_altera
device	pl061
device	pl011
device	axa
device	msk
device	bge
device	pci_n1sdp
device	pl031
device	scmi
device	arm_doorbell
device	hyperv
device	xz
device	mlx5
device	mlxfw
device	mlx5en
device	bcm2835_bsc
device	bcm2835_spi
device	uart_mu
device	genet
device	dwcotg
device	muge
device	smsc
device	sdhci
device	vnic
device	virtio
device	virtio_pci
device	virtio_mmio
device	virtio_blk
device	vtnet
device	dwmmc_hisi
device	vf_i2c
device	fsliic
device	uart_imx
device	ffec
device	a37x0_gpio
device	mv_gpio
device	mvebu_pinctrl
device	a37x0_iic
device	tca64xx
device	mv_cp110_icu
device	mv_ap806_gicp
device	mv_ap806_sei
device	mv_rtc
device	safexcel
device	mv_thermal
device	a37x0_spi
device	uart_mvebu
device	neta
device	etherswitch
device	miiproxy
device	ehci_mv
device	sdhci_xenon
device	a37x0_xtal
device	a37x0_tbg
device	a37x0_nb_periph
device	a37x0_sb_periph
device	re
device	tegra210_xusb_fw
device	ure
device	pca954x
device	pcf8563
device	pcf85063
device	dpaa2
device	enetc
device	sff
device	qcom_gcc
device	qcom_mdio
device	uart_msm
device	rk_gpio
device	rk_pinctrl
device	rk_combphy
device	rk_i2c
device	fan53555
device	rk805
device	rk817
device	syr827
device	tcs4525
device	rk_spi
device	rk_pwm
device	dwc_rk
device	eqos
device	rk_iodomain
device	rk_usb2phy
device	rk_typec_phy
device	rk_dwc3
device	rk_dwmmc
device	rk_emmcphy
device	pvscsi
device	vmx
device	virtio_gpu
device	virtio_scmi
device	virtio_scsi
device	acpi_ged
device	cgem
device	cdnc_i2c
Comment 4 Mark Millard 2024-11-11 00:46:23 UTC
(In reply to Robert Clausecker from comment #2)

FYI: My ports activity is biased to testing the recent
devel/llvm[0-9][0-9] use (that is not a -devel one).
There are other tailored aspects as well.

I tend to prefer to replicate problems via official
FreeBSD builds. But in this context for the world
code, I do not have a reasonable context to do so.
So my personal environment is involved. Sorry.

Also, I've had no problem with building 1.81.0 of
lang/rust for armv7. My problem started with
1.82.0 (which internally upgraded to LLVM 19).

But Robert's reference to bug #280027 indicates a
longer history for his problems, not specific to
1.82.0 of rust or to LLVM 19 being involved. And
it makes a claim that contradicts the historical
behavior on the official armv7 build server (ampere2
using armv7 jails via poudriere):

QUOTE
Seems like it's a port bug after all.

To reproduce, build with Poudriere . . .
END QUOTE

So far as I know, the ampere2 has never shown the
behaviors Robert has reported for its poudriere
based builds. The recent:

https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/p711a2f7f1ca4_s0d965bc034/logs/rust-1.81.0.log

is another example of a successful rust 1.81.0 build
on ampere2.

=>> Building lang/rust
build started at Fri Nov  1 05:01:04 UTC 2024
port directory: /usr/ports/lang/rust
package name: rust-1.81.0
building for: FreeBSD main-armv7-default-job-10 15.0-CURRENT FreeBSD 15.0-CURRENT 1500026 arm
maintained by: rust@FreeBSD.org
Makefile datestamp: -rw-r--r--  1 root wheel 11307 Oct 26 01:05 /usr/ports/lang/rust/Makefile
Ports top last git commit: 711a2f7f1ca
Ports top unclean checkout: no
Port dir last git commit: 2501f5298c3
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.4.2
Host OSVERSION: 1500023
Jail OSVERSION: 1500026
Job Id: 10
. . .

So I think what I've reported and what Robert's reporting
are separate issues. Also, based on ampere2 build behavior,
the problem seems specific to Robert's context somehow.
Comment 5 Mark Millard 2024-11-11 02:05:58 UTC
(In reply to Mark Millard from comment #4)

While the evidence is still for separate problems for
my report vs. Robert's  reports, below I correct a
sampling bias in my comparisons.

CORRECTION for the ampere* status for building lang/rust . . .

My comments were based on a sampling bias: I
use and pay attention to main [so: 15 for now]
for the most part. This mean ampere2 only as well.

https://portsfallout.com/fallout?port=lang%2Frust&maintainer=&env=releng-armv7-&category=&flavor=

does indicate that *releng-armv7-* (so 133 and 141,
default and quarterly, as things are now) are failing
to build lang/rust on the ampere[13] buildlers and have
been that way for some time. (I've  not reviewed the
log details vs. Robert's reports in the other bugzilla
submittal.)

I'll note that port-package builders (ampere* included)
run a main [so: 15] kernel but a poudriere/world-jail
that is for the target system type and version.

So: only main-armv7-default seems to be well behaved
for lang/rust. None of the *releng-armv7-* seems to
be well behaved for that.

lang/rust armv7 package building for releases is broken
on FreeBSD and has been for some time.

https://portsfallout.com/ does not present a long term
history as far as I can tell, currently going back to
early 2024-Jul. So I've no evidence of when before
then the lang/rust build problems for releases started.
Comment 6 Mark Millard 2024-11-12 17:29:54 UTC
I'll note that the FreeBSD context here is main [so: 15 as stands,
both kernel and world] aarch64 with aarch32/armv7 supported for
use code as well.

Building lang/rust on stable/14 (kernel and world) on an aarch64
with aarch32/armv7 support is broken other ways. Similarly the
official package build server records show failures for that
main-kernel [so: 15 as stands] but releng/1[34].* poudriere jail
world --that match my attempted stable/14 test that did not
involve FreeBSD main at all.

Also, back when it was 1.81.0, I had no problem for main [so:
15 as stands, both kernel and world] But the historical official
package builder logs show failures for all the 1.[78]*.0 versions
that still have log files available.

So I seem to be reporting something new here.
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2024-11-13 08:43:29 UTC
I think the bootstrap compiler still has 'env: "gnu".into(),' in its target definition. I'll regen a working bootstrap "soon".
Comment 8 Alan Somers freebsd_committer freebsd_triage 2024-11-13 17:29:39 UTC
(In reply to Mikael Urankar from comment #7)
Yes, that sounds likely to me.  But if that proves difficult, an alternative would be to reintroduce the patch-vendor_nix-0.28.0_src_sys_signal.rs file that was removed in 05961664b7f01ac5ed3e9352d43c2aa1ae3028b5 (PR #282518).  It should be harmless, but it might help to regenerate a newer rust-bootstrap
Comment 9 Mark Millard 2024-11-14 00:44:17 UTC
As for 1.81.0 builds, the official main-armv7-default
overall build on ampere2 completed and was successful
for its 1.81.0 lang/rust build:

=>> Building lang/rust
build started at Mon Nov 11 06:37:44 UTC 2024
port directory: /usr/ports/lang/rust
package name: rust-1.81.0
building for: FreeBSD main-armv7-default-job-02 15.0-CURRENT FreeBSD 15.0-CURRENT 1500026 arm
maintained by: rust@FreeBSD.org
Makefile datestamp: -rw-r--r--  1 root wheel 11307 Oct 26 01:05 /usr/ports/lang/rust/Makefile
Ports top last git commit: 380be9c7980
Ports top unclean checkout: no
Port dir last git commit: 2501f5298c3
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.4.2
Host OSVERSION: 1500023
Jail OSVERSION: 1500026
Job Id: 02
. . .
=======================<phase: package        >============================
===== env: 'PKG_NOTES=build_timestamp ports_top_git_hash ports_top_checkout_unclean port_git_hash port_checkout_unclean built_by' 'PKG_NOTE_build_timestamp=2024-11-11T06:37:44+0000' 'PKG_NOTE_ports_top_git_hash=380be9c7980' 'PKG_NOTE_ports_top_checkout_unclean=no' 'PKG_NOTE_port_git_hash=2501f5298c3' 'PKG_NOTE_port_checkout_unclean=no' 'PKG_NOTE_built_by=poudriere-git-3.4.2' NO_DEPENDS=yes USER=root UID=0 GID=0
===>  Building packages for rust-1.81.0
===>   Building rust-1.81.0
===========================================================================
=>> Cleaning up wrkdir
===>  Cleaning for rust-1.81.0
build of lang/rust | rust-1.81.0 ended at Mon Nov 11 16:27:47 UTC 2024
build time: 09:50:04


Note that "Jail OSVERSION: 1500026" means the poudriere jail had the
LLVM 19 system clang toolchain.

[Note: official builds for recent 13.* and 14.* do not work, just main.
This had been true for a long time.]
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-11-14 15:31:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=560fd669d24aafad437789954800d57e7cfeafa9

commit 560fd669d24aafad437789954800d57e7cfeafa9
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-11-14 14:59:30 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-11-14 15:30:31 +0000

    lang/rust: Regen bootstrap for armv7

    PR:             282663

 lang/rust/distinfo | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2024-11-14 16:46:09 UTC
Created attachment 255174 [details]
rust-1.82.0_1 build log on armv7 FreeBSD 14.1

Build still fails for me with the recent bootstrap toolchain regen.
Comment 12 Alan Somers freebsd_committer freebsd_triage 2024-11-14 17:36:27 UTC
(In reply to Robert Clausecker from comment #11)
That looks like a new error.  Or have you seen it before?

thread 'rustc' panicked at compiler/rustc_middle/src/ty/adt.rs:155:20:
already borrowed: BorrowMutError
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::cell::panic_already_borrowed
   3: <rustc_middle::ty::adt::AdtDefData as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   4: <rustc_type_ir::ty_info::WithCachedTypeInfo<rustc_type_ir::ty_kind::TyKind<rustc_middle::ty::context::TyCtxt>> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   5: <rustc_type_ir::ty_info::WithCachedTypeInfo<rustc_type_ir::ty_kind::TyKind<rustc_middle::ty::context::TyCtxt>> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   6: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   7: rustc_symbol_mangling::legacy::mangle
   8: rustc_symbol_mangling::symbol_name_provider
      [... omitted 2 frames ...]
   9: <hashbrown::raw::RawIterRange<(rustc_span::def_id::LocalDefId, ())>>::fold_impl::<<hashbrown::map::Iter<rustc_span::def_id::LocalDefId, ()> as core::iter::traits::iterator::Iterator>::fold<(), <hashbrown::map::Keys<rustc_span::def_id::LocalDefId, ()> as core::iter::traits::iterator::Iterator>::fold<(), core::iter::adapters::filter_map::filter_map_fold<&rustc_span::def_id::LocalDefId, rustc_span::def_id::LocalDefId, (), rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#0}, core::iter::adapters::map::map_fold<rustc_span::def_id::LocalDefId, (rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo), (), rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#1}, core::iter::traits::iterator::Iterator::for_each::call<(rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo), <hashbrown::map::HashMap<rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as core::iter::traits::collect::Extend<(rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo)>>::extend<core::iter::adapters::map::Map<core::iter::adapters::filter_map::FilterMap<std::collections::hash::set::Iter<rustc_span::def_id::LocalDefId>, rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#0}>, rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#1}>>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, ()>
  10: rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider
      [... omitted 2 frames ...]
  11: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
      [... omitted 2 frames ...]
  12: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  13: rustc_metadata::rmeta::encoder::encode_metadata
  14: rustc_metadata::fs::encode_and_write_metadata
  15: rustc_interface::passes::start_codegen
  16: <rustc_interface::queries::Linker>::codegen_and_build_linker
  17: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  18: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}>
  19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.
Comment 13 Alan Somers freebsd_committer freebsd_triage 2024-11-14 17:42:21 UTC
(In reply to Alan Somers from comment #12)
Note that this same error was reported by somebody attempting to cross-build Rust 1.77.1 from amd64 to aarch64 on NetBSD.
https://github.com/rust-lang/rust/issues/123551
Comment 14 Mikael Urankar freebsd_committer freebsd_triage 2024-11-15 10:29:06 UTC
clippy fails to build on armv7 due to memory exhaustion. Otherwise rust 1.82.0 builds fine on my armv7 board (with tools=["analysis","cargo","rust-analyzer","rustdoc","rustfmt","rls"] in config.toml)
Comment 15 Robert Clausecker freebsd_committer freebsd_triage 2024-11-15 11:46:33 UTC
(In reply to Mikael Urankar from comment #14)

On 14.1 or on 15-CURRENT?  The problems so far only reproduce on 14.1 and 13.3.
Comment 16 Mikael Urankar freebsd_committer freebsd_triage 2024-11-15 15:45:55 UTC
(In reply to Robert Clausecker from comment #15)
15-current

clippy builds if I put codegen-units=1 in config.toml
Comment 17 Mark Millard 2024-11-15 15:57:58 UTC
(In reply to Robert Clausecker from comment #15)

My non-FreeBSD-main test context is: stable/14 . I get the failures
for that context.

I've not yet updated a FreeBSD-main [so: 15 as stands] test context
to test building there after the recent "gnu" removal related updates.
Comment 18 Mark Millard 2024-11-15 16:44:30 UTC
(In reply to Mark Millard from comment #17)

I updated on a personally configured FreeBSD-main's
port tree and started a 1.82.0 lang/rust build. It
is past where the stable/14 (my testing) and
releases (Robert's testing) fail. (I've never seen
the specific problem on FreeBSD main, despite use
of armv7 poudriere jails on aarch64.)


On stable/14 I now have a PORTS_LLVM based build of
1.82.0 of lang/rust in process. But it has to build
the LLVM 17 first. (I turned off various options for
the LLVM 17 build that are not needed in order to
cut the time involved. But it will be hours before
it starts to build lang/rust itself.)
Comment 19 Mark Millard 2024-11-15 18:29:32 UTC
(In reply to Mikael Urankar from comment #14)

I've a question, generated on/for my stable/14
test context (I split the lines before "ELF"):

# file /usr/obj/DESTDIRs/PBstable-armv7/bin/sh
/usr/obj/DESTDIRs/PBstable-armv7/bin/sh: 
ELF 32-bit LSB executable, ARM, EABI5 version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, FreeBSD-style, for FreeBSD 14.2 (1402500), stripped

vs.

# file /usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/rustc
/usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/rustc: 
ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, FreeBSD-style, with debug_info, not stripped

Or, for easier comparison just the content that I'm worried about:

ELF 32-bit LSB executable, ARM, EABI5 version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, FreeBSD-style, for FreeBSD 14.2 (1402500), stripped
vs.
ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, FreeBSD-style, with debug_info, not stripped

Why does work/bootstrap/bin/rustc not show ", for FreeBSD 14.2 (1402500)" or anything indicating the FreeBSD version that is is for?

Is work/bootstrap/bin/rustc trying to be the same executable by content
across all of 1[34].*-RELELASE and stable/1[34] and main [so: 15 as
stands]?
Comment 20 Mark Millard 2024-11-15 18:53:36 UTC
(In reply to Mark Millard from comment #19)

Looks like some involved .so files are explicit
(FreeBSD 13.3 here):

# file /usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/../lib/librustc_driver-0609d770979c2845.so
/usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/../lib/librustc_driver-0609d770979c2845.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (FreeBSD), dynamically linked, for FreeBSD 13.3, with debug_info, not stripped

# file /usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/../lib/libstd-0a46fd5bc285334c.so
/usr/obj/DESTDIRs/PBstable-armv7/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/../lib/libstd-0a46fd5bc285334c.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (FreeBSD), dynamically linked, for FreeBSD 13.3, with debug_info, not stripped

I looked at ztop: same sort of lack of indication. So such may be normal
for rust.
Comment 21 Mark Millard 2024-11-15 21:50:18 UTC
(In reply to Mark Millard from comment #18)

The lang/rust 1.82.0_1 with the updated boostrap built
on a aarch32/armv7 capable aarch64 in an armv7 poudriere
jail built just fine.

This contrasts with my testing on stable/14 and Robert's
tests on 1[34].*-RELEASE .

So far as I can tell, native armv7 vs. aarch64 with
aarch32/armv7 support is not the controlling aspect at
all.

Unfortunately, I've still no clue why stable/14 and
1[34].*-RELEASE do the odd things that they do.
Comment 22 Mark Millard 2024-11-16 11:30:31 UTC
(In reply to Mikael Urankar from comment #14)

I've put a PkgBase based stable/14 on USB media
and used it on a Native armv7 (OrangePi+ 2ed) and
it replicated the newer "already borrowed" failure
in this context:

thread 'rustc' panicked at compiler/rustc_middle/src/ty/adt.rs:155:20:
already borrowed: BorrowMutError
stack backtrace:
thread 'rustc' panicked at compiler/rustc_middle/src/ty/adt.rs:155:20:
already borrowed: BorrowMutError
stack backtrace:
thread 'rustc' panicked at compiler/rustc_middle/src/ty/adt.rs:155:20:
already borrowed: BorrowMutError
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::cell::panic_already_borrowed
   3: <rustc_middle::ty::adt::AdtDefData as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   4: <rustc_type_ir::ty_info::WithCachedTypeInfo<rustc_type_ir::ty_kind::TyKind<rustc_middle::ty::context::TyCtxt>> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   5: rustc_symbol_mangling::legacy::mangle
   6: rustc_symbol_mangling::symbol_name_provider
. . .

native armv7 vs. aarch32/armv7 on aarch64 is not what makes
the difference here.

What makes the difference is main [so: 15 as stands] vs.
stable/1[34] and 1[34].*-RELEASE : it only works on main .

For reference:

# uname -apKU
FreeBSD armv7-OfficialStable 14.2-STABLE FreeBSD 14.2-STABLE stable/14-n269609-9ee0b40e4a51 GENERIC arm armv7 1402500 1402500

# poudriere jail -jstable-armv7 -i
Jail name:         stable-armv7
Jail version:      14.2-STABLE
Jail arch:         armv7
Jail method:       pkgbase
Jail mount:        /usr/local/poudriere/jails/stable-armv7-poud
Jail fs:           
Jail updated:      2024-11-16 09:59:48
Jail pkgbase:      disabled

# poudriere ports -l
PORTSTREE METHOD    TIMESTAMP           PATH
default   git+https 2024-11-16 10:15:57 /usr/local/poudriere/ports/default

# ~/fbsd-based-on-what-commit.sh -C /usr/local/poudriere/ports/default
10098268c (grafted, HEAD -> main, origin/main, origin/HEAD) x11-wm/awesome-vicious: Update to 2.7.1
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-11-16 09:29:12 +0000
branch: main
fatal: Not a valid object name freebsd/main
Comment 23 Mikael Urankar freebsd_committer freebsd_triage 2024-11-16 18:08:41 UTC
(In reply to Alan Somers from comment #13)
I've rebuilt a bootstrap based on rust 1.82 with "has_thread_local: false" in compiler/rustc_target/src/spec/base/freebsd.rs
It seems to work (at least it doesn't "crash" straight away).
Comment 24 Mikael Urankar freebsd_committer freebsd_triage 2024-11-16 18:13:53 UTC
(In reply to Mikael Urankar from comment #23)
If someone wants to confirm, the bootstrap are available here: https://cocyte.westeurope.cloudapp.azure.com/rust/
you'll have to rename them to 1.81 and regen distinfo

It'd be nice to know which commit on head fixed this.
Comment 25 Robert Clausecker freebsd_committer freebsd_triage 2024-11-16 18:30:54 UTC
(In reply to Mikael Urankar from comment #24)

Started a test build with that bootstrap toolchain.  Seems like it doesn't fail immediately anymore, which is definitely a big plus.  I'll let you know if it runs through!
Comment 26 Robert Clausecker freebsd_committer freebsd_triage 2024-11-16 20:47:20 UTC
The build went almost to completion and finally crashed as follows:

thread 'rustc' panicked at compiler/rustc_middle/src/ty/adt.rs:154:20:                                               
already borrowed: BorrowMutError
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::cell::panic_already_borrowed
   3: <rustc_middle::ty::adt::AdtDefData as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   4: <rustc_type_ir::ty_info::WithCachedTypeInfo<rustc_type_ir::ty_kind::TyKind<rustc_middle::ty::context::TyCtxt>> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   5: <rustc_type_ir::ty_info::WithCachedTypeInfo<rustc_type_ir::ty_kind::TyKind<rustc_middle::ty::context::TyCtxt>> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   6: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   7: rustc_symbol_mangling::legacy::mangle
   8: rustc_symbol_mangling::symbol_name_provider
      [... omitted 2 frames ...]
   9: <hashbrown::raw::RawIterRange<(rustc_span::def_id::LocalDefId, ())>>::fold_impl::<<hashbrown::map::Iter<rustc_span::def_id::LocalDefId, ()> as core::iter::traits::iterator::Iterator>::fold<(), <hashbrown::map::Keys<rustc_span::def_id::LocalDefId, ()> as core::iter::traits::iterator::Iterator>::fold<(), core::iter::adapters::filter_map::filter_map_fold<&rustc_span::def_id::LocalDefId, rustc_span::def_id::LocalDefId, (), rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#0}, core::iter::adapters::map::map_fold<rustc_span::def_id::LocalDefId, (rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo), (), rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#1}, core::iter::traits::iterator::Iterator::for_each::call<(rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo), <hashbrown::map::HashMap<rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as core::iter::traits::collect::Extend<(rustc_span::def_id::DefId, rustc_middle::middle::exported_symbols::SymbolExportInfo)>>::extend<core::iter::adapters::map::Map<core::iter::adapters::filter_map::FilterMap<std::collections::hash::set::Iter<rustc_span::def_id::LocalDefId>, rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#0}>, rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider::{closure#1}>>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, ()>
  10: rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider
      [... omitted 2 frames ...]
  11: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
      [... omitted 2 frames ...]
  12: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  13: rustc_metadata::rmeta::encoder::encode_metadata
  14: rustc_metadata::fs::encode_and_write_metadata
  15: rustc_interface::passes::start_codegen
  16: <rustc_interface::queries::Linker>::codegen_and_build_linker
  17: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  18: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}>
  19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  20: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/library/rustc-ice-2024-11-16T20_44_49-2364.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C linker=cc -C symbol-mangling-version=legacy -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -Z inline-mir -Z inline-mir-preserve-debug -C embed-bitcode=yes -C force-frame-pointers=yes -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/1.82.0/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [symbol_name] computing the symbol for `crate::fmt::num::imp::<impl at core/src/fmt/num.rs:480:13: 480:38>::fmt`
#1 [reachable_non_generics] looking up the exported symbols of a crate
#2 [exported_symbols] collecting exported symbols for crate `0`
end of query stack

Did not run successfully: exit status: 101
LD_LIBRARY_PATH="/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2/lib:/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/release/deps:/usr/home/fuz/lib" "/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2/bin/rustc" "--crate-name" "core" "--edition=2021" "core/src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--diagnostic-width=119" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "--warn=unexpected_cfgs" "--check-cfg" "cfg(docsrs)" "--check-cfg" "cfg(feature, values(\"debug_refcell\", \"optimize_for_size\", \"panic_immediate_abort\"))" "--check-cfg" "cfg(bootstrap)" "--check-cfg" "cfg(no_fp_fmt_parse)" "--check-cfg" "cfg(stdarch_intel_sde)" "--check-cfg" "cfg(feature, values(any()))" "-C" "metadata=4122020641cb3408" "-C" "extra-filename=-4122020641cb3408" "--out-dir" "/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/wasm32-unknown-unknown/release/deps" "--target" "wasm32-unknown-unknown" "-C" "linker=cc" "-L" "dependency=/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/wasm32-unknown-unknown/release/deps" "-L" "dependency=/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/release/deps" "-Csymbol-mangling-version=legacy" "--check-cfg=cfg(feature,values(any()))" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "-Zmacro-backtrace" "-Csplit-debuginfo=off" "-Cprefer-dynamic" "-Zinline-mir" "-Zinline-mir-preserve-debug" "-Cembed-bitcode=yes" "-Cforce-frame-pointers=yes" "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/1.82.0/\")" "-Z" "binary-dep-depinfo" "-Wrust_2018_idioms" "-Wunused_lifetimes" "--sysroot" "/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2" "--remap-path-prefix" "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src=/rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14" "--remap-path-prefix" "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/vendor=/rust/deps" "-Z" "force-unstable-if-unmarked"
-------------
warning: `core` (lib) generated 1 warning (1 duplicate)
error: could not compile `core` (lib); 1 warning emitted

Caused by:
  process didn't exit successfully: `CARGO=/usr/home/ports/main.ports/lang/rust/work/bootstrap/bin/cargo CARGO_CRATE_NAME=core CARGO_MANIFEST_DIR=/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/library/core CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='The Rust Core Library' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=core CARGO_PKG_README='' CARGO_PKG_REPOSITORY='https://github.com/rust-lang/rust.git' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.0.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_RUSTC_CURRENT_DIR=/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/library LD_LIBRARY_PATH='/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/release/deps:/usr/home/fuz/lib' /usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/rustc /usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/rustc --crate-name core --edition=2021 core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=119 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --warn=unexpected_cfgs --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("debug_refcell", "optimize_for_size", "panic_immediate_abort"))' --check-cfg 'cfg(bootstrap)' --check-cfg 'cfg(no_fp_fmt_parse)' --check-cfg 'cfg(stdarch_intel_sde)' --check-cfg 'cfg(feature, values(any()))' -C metadata=4122020641cb3408 -C extra-filename=-4122020641cb3408 --out-dir /usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -C linker=cc -L dependency=/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/wasm32-unknown-unknown/release/deps -L dependency=/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std/release/deps -Csymbol-mangling-version=legacy '--check-cfg=cfg(feature,values(any()))' -Zunstable-options '--check-cfg=cfg(bootstrap)' -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zinline-mir -Zinline-mir-preserve-debug -Cembed-bitcode=yes -Cforce-frame-pointers=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/1.82.0/")' -Z binary-dep-depinfo` (exit status: 101)
command did not execute successfully: cd "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src" && env -u MAKEFLAGS -u MFLAGS AR_wasm32_unknown_unknown="ar" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2-std" CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER="cc" CC_wasm32_unknown_unknown="cc" CFG_COMPILER_BUILD_TRIPLE="armv7-unknown-freebsd" CFG_COMPILER_HOST_TRIPLE="wasm32-unknown-unknown" CFG_DISABLE_UNSTABLE_FEATURES="1" CFG_RELEASE_CHANNEL="stable" CFG_VIRTUAL_RUST_SOURCE_BASE_DIR="/rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14" CFLAGS_wasm32_unknown_unknown="-ffunction-sections -fdata-sections -fPIC -pipe -fstack-protector-strong -fno-strict-aliasing" CXXFLAGS_wasm32_unknown_unknown="-ffunction-sections -fdata-sections -fPIC -pipe -fstack-protector-strong -fno-strict-aliasing" CXX_wasm32_unknown_unknown="c++" LIBC_CHECK_CFG="1" RANLIB_wasm32_unknown_unknown="ar s" REAL_LIBRARY_PATH="/usr/home/fuz/lib" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/usr/home/ports/main.ports/lang/rust/work/_build/wasm32-unknown-unknown/native" RUSTC="/usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_CARGO_REGISTRY_SRC_TO_REMAP="/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/vendor=/rust/deps" RUSTC_DEBUGINFO_MAP="/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src=/rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14" RUSTC_ERROR_METADATA_DST="/usr/home/ports/main.ports/lang/rust/work/_build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="-Zunstable-options --check-cfg=cfg(bootstrap) -Clinker=cc" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2/lib" RUSTC_LINK_STD_INTO_RUSTC_DRIVER="1" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes" RUSTC_REAL="/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2/bin/rustc" RUSTC_SNAPSHOT="/usr/home/ports/main.ports/lang/rust/work/bootstrap/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/usr/home/ports/main.ports/lang/rust/work/bootstrap/lib" RUSTC_STAGE="2" RUSTC_SYSROOT="/usr/home/ports/main.ports/lang/rust/work/_build/armv7-unknown-freebsd/stage2" RUSTC_VERBOSE="2" RUSTC_WRAPPER="/usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/rustc" RUSTDOC="/usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Wrustdoc::invalid_codeblock_attributes --crate-version 1.82.0\t(f6e511eec\t2024-10-15)\t(built\tfrom\ta\tsource\ttarball) -Clinker=cc -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/1.82.0/\") -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zinline-mir -Zinline-mir-preserve-debug -Cembed-bitcode=yes -Cforce-frame-pointers=yes -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/1.82.0/\")" RUST_COMPILER_RT_ROOT="/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/src/llvm-project/compiler-rt" RUST_TEST_THREADS="8" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="stablestd" "/usr/home/ports/main.ports/lang/rust/work/bootstrap/bin/cargo" "build" "--target" "wasm32-unknown-unknown" "--release" "-Zbinary-dep-depinfo" "-j" "8" "-v" "-v" "--frozen" "--features" " panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/library/sysroot/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
Traceback (most recent call last):
  File "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/x.py", line 50, in <module>
    bootstrap.main()
  File "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/src/bootstrap/bootstrap.py", line 1208, in main
    bootstrap(args)
  File "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/src/bootstrap/bootstrap.py", line 1184, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/usr/home/ports/main.ports/lang/rust/work/rustc-1.82.0-src/src/bootstrap/bootstrap.py", line 195, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/home/ports/main.ports/lang/rust/work/_build/bootstrap/debug/bootstrap dist --jobs=8
*** Error code 1

Stop.
make[1]: stopped in /usr/home/ports/main.ports/lang/rust
*** Error code 1
Comment 27 Mikael Urankar freebsd_committer freebsd_triage 2024-11-16 20:59:43 UTC
(In reply to Robert Clausecker from comment #26)
Can you try to create a patch for has_thread_local = no and start over? I suppose the stage1 compiler has has_thread_local = yes
Comment 28 Mark Millard 2024-11-16 21:08:10 UTC
(In reply to Mikael Urankar from comment #24)

The following ends up reporting that the main vs.
other distinction for building looks to go back to
at least 2024-Apr-30 .


Going in the direction of finding when the problem started,
the first (earliest) fallout log for *releng-armv7-default
for lang/rust consistently failing looks too be:

Maintainer:     rust@FreeBSD.org
Log URL:        https://pkg-status.freebsd.org/ampere3/data/132releng-armv7-default/26c5fe5d2fe6/logs/rust-1.77.0.log
Build URL:      https://pkg-status.freebsd.org/ampere3/build.html?mastername=132releng-armv7-default&build=26c5fe5d2fe6
Log:

=>> Building lang/rust
build started at Mon Apr  1 13:42:10 UTC 2024
port directory: /usr/ports/lang/rust
package name: rust-1.77.0
building for: FreeBSD 132releng-armv7-default-job-02 13.2-RELEASE-p5 FreeBSD 13.2-RELEASE-p5 1302001 arm
maintained by: rust@FreeBSD.org
Makefile datestamp: -rw-r--r--  1 root  wheel  11562 Mar 28 01:02 /usr/ports/lang/rust/Makefile
Ports top last git commit: 26c5fe5d2fe
Ports top unclean checkout: no
Port dir last git commit: 6f156f501ce
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.4.1-1-g1e9f97d6
Host OSVERSION: 1500006
Jail OSVERSION: 1302001
Job Id: 02
. . .

The details are different for what the logs look like for
1.77.0  vs. 1.78.0 and later.

I'll note that we know the failures happen both on the release
kernels as well as the 15????? kernels used on the package
builders. This is despite main-armv7-default not getting the
problem for its 15????? kernel use.

Note the 13.2-RELEASE-p5 and 1302001, making it looks like that
13.2-RELEASE-p4 worked.

So looking at the first 14.0 example of the armv7 failure:

Maintainer:     rust@FreeBSD.org
Log URL:        https://pkg-status.freebsd.org/ampere3/data/140releng-armv7-default/26c5fe5d2fe6/logs/rust-1.77.0.log
Build URL:      https://pkg-status.freebsd.org/ampere3/build.html?mastername=140releng-armv7-default&build=26c5fe5d2fe6
Log:

=>> Building lang/rust
build started at Mon Apr  8 03:40:28 UTC 2024
port directory: /usr/ports/lang/rust
package name: rust-1.77.0
building for: FreeBSD 140releng-armv7-default-job-10 14.0-RELEASE-p5 FreeBSD 14.0-RELEASE-p5 1400097 arm
maintained by: rust@FreeBSD.org
Makefile datestamp: -rw-r--r--  1 root wheel 11562 Mar 28 01:02 /usr/ports/lang/rust/Makefile
Ports top last git commit: 26c5fe5d2fe
Ports top unclean checkout: no
Port dir last git commit: 6f156f501ce
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.4.1-1-g1e9f97d6
Host OSVERSION: 1500006
Jail OSVERSION: 1400097
Job Id: 10

So: 14.0-RELEASE-p5 and 1400097


These lead to checking when 1.77.0 happend:

author	Mikael Urankar <mikael@FreeBSD.org>	2024-03-18 13:14:34 +0000
committer	Mikael Urankar <mikael@FreeBSD.org>	2024-03-23 09:41:45 +0000
 . . 

lang/rust: Update to 1.77.0

Announce:	https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html
ChangeLog:	https://github.com/rust-lang/rust/releases/tag/1.77.0

PR:		277786
Tested by:	mikael



1.77.00 log failure details vs. 1.78.0 and later are distinct. 1.78.0
stops sooner and lagnuage chnages seem to be involved in 1.77.0
reporting additional output.


Unfortunately, main-armv7-default from 2024-Feb-28 until 2024-Jun-02
was broken by a system hangup problem unless the build happened to
avoid the ports that happend to hit the problem. That happend once and
main-armv7-default lang/rust 1.77.0_1 built okay for that one example:

=>> Building lang/rust
build started at Tue Apr 30 02:32:22 UTC 2024
port directory: /usr/ports/lang/rust
package name: rust-1.77.0_1
building for: FreeBSD main-armv7-default-job-11 15.0-CURRENT FreeBSD 15.0-CURRENT 1500018 arm
maintained by: rust@FreeBSD.org
Makefile datestamp: -rw-r--r--  1 root wheel 11241 Apr 28 01:05 /usr/ports/lang/rust/Makefile
Ports top last git commit: 5a022ef6a46
Ports top unclean checkout: no
Port dir last git commit: 54f7b9d654d
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.4.1-30-g79e3edcd
Host OSVERSION: 1500018
Jail OSVERSION: 1500018
Job Id: 11


In the general time frame, the non-main builds were failing.

I do not find armv7 fallout reports from the months prior to
2024-Apr. This might be getting back to before armv7 was
moved to the ampere*'s. Also, it might be that main was moved
first and the other later. The available records do not seem
to span any pre-ampere* armv7 build activity any more.

This means no driect evidence for 1.76.0 or before of lang/rust
as far as I can tell: both system and rust evidence is lacking.
Comment 29 Robert Clausecker freebsd_committer freebsd_triage 2024-11-16 21:39:36 UTC
It's great that people finally believe me about lang/rust not building on armv7, when I was previously told that this can't possibly be the case.

It would be great if the rust team could in the future conduct more comprehensive build tests and actually look at fallouts to catch these failures.

I'm currently redoing the build test with a patch to disable TLS as requested, but that'll take a couple more hours.
Comment 30 Mark Millard 2024-11-16 22:24:32 UTC
(In reply to Mikael Urankar from comment #24)

I think found a potential distinction for main vs.
not. It only has been done in main and yet was not
recent at all. The removed #if . . . #endif (where
the . . . was not removed) is still present in
stable/14 . It is a change to the default
thread-local storage module used:


author	R. Christian McDonald <rcm@rcm.sh>	2023-11-09 20:22:21 +0000
committer	Kristof Provost <kp@FreeBSD.org>	2023-11-09 20:24:23 +0000
commit	6e5b1ff71e01bd48172483cb6df921f84300ea3a (patch)
tree	f68e0f494c8eca8fe83118e648563b6a9b64db26
parent	ede4c412b3ea9289ef42c664b01b6b5ff7eac434 (diff)
download	src-6e5b1ff71e01bd48172483cb6df921f84300ea3a.tar.gz
src-6e5b1ff71e01bd48172483cb6df921f84300ea3a.zip

libc: enable initial-exec (IE) as default thread-local storage model on arm
As suggested by jrtc27@ in https://reviews.freebsd.org/D42415, this
patch enables IE as default thread-local storage model in libc on arm.

Reviewed by:	kib
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42445
Diffstat
-rw-r--r--	lib/libc/Makefile	4	
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 7540eb8c21ad..e817104642b8 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -54,11 +54,7 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
 
 # Use a more efficient TLS model for libc since we can reasonably assume that
 # it will be loaded during program startup.
-.if ${LIBC_ARCH} == "aarch64" || ${LIBC_ARCH} == "amd64" || \
-    ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "riscv" || \
-    ${LIBC_ARCH:Mpowerpc*} != ""
 CFLAGS+= -ftls-model=initial-exec
-.endif
 
 #
 # Link with static libcompiler_rt.a.
Comment 31 Mark Millard 2024-11-16 22:38:57 UTC
(In reply to Mark Millard from comment #30)

Looks like the https://reviews.freebsd.org/D42415
that is mentioned might be related work done that
helped enable the change to be supported. I've
not checked the details for if those changes made
to outside main.
Comment 32 Mark Millard 2024-11-16 22:47:12 UTC
(In reply to Mark Millard from comment #31)

Looks like at least:

https://cgit.freebsd.org/src/commit/?id=98fd69f0090da73d9d0451bd769d7752468284c6

is part of the changes needed to have -ftls-model=initial-exec
work for armv7.

For reference, the diff it lists is:

diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c
index c3e95940be74..6efc9f499761 100644
--- a/libexec/rtld-elf/arm/reloc.c
+++ b/libexec/rtld-elf/arm/reloc.c
@@ -280,10 +280,13 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache,
 				return -1;
 
 			tmp = (Elf_Addr)def->st_value + defobj->tlsoffset;
-			if (__predict_true(RELOC_ALIGNED_P(where)))
+			if (__predict_true(RELOC_ALIGNED_P(where))) {
+				tmp += *where;
 				*where = tmp;
-			else
+			} else {
+				tmp += load_ptr(where);
 				store_ptr(where, tmp);
+			}
 			dbg("TLS_TPOFF32 %s in %s --> %p",
 			    obj->strtab + obj->symtab[symnum].st_name,
 			    obj->path, (void *)tmp);
Comment 33 Robert Clausecker freebsd_committer freebsd_triage 2024-11-17 00:00:14 UTC
(In reply to Mikael Urankar from comment #27)

I can confirm that the updated bootstrap plus the requested patch lead to a succesfull lang/rust build on armv7 FreeBSD 14.1!  Finally!

Could you commit a patch to this effect and MFH it for good measure?
Comment 34 Robert Clausecker freebsd_committer freebsd_triage 2024-11-17 00:01:08 UTC
*** Bug 280027 has been marked as a duplicate of this bug. ***
Comment 35 Mark Millard 2024-11-17 05:58:18 UTC
(In reply to Mark Millard from comment #32)

I created a poudriere-devel jail based on the 2
commits missing from all but main and the
updated bootstrap that had the "gnu" removal.
This is on the stable/14 boot media.

This does not have your thread local storage
removals or the like.

The build is still on-going: it did not stop
quickly.

URL: https://cgit.FreeBSD.org/ports/commit/?id=560fd669d24aafad437789954800d57e7cfeafa9

commit 560fd669d24aafad437789954800d57e7cfeafa9
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-11-14 14:59:30 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-11-14 15:30:31 +0000

    lang/rust: Regen bootstrap for armv7

    PR:             282663

 lang/rust/distinfo | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

[Note: Previously, with just that change it still
got errors, just not the multiple definition errors
and the like.]

What is new is the following changes to the
world build:

# git -C /usr/official-src/ diff libexec/rtld-elf/arm/reloc.c
diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c
index c3e95940be74..6efc9f499761 100644
--- a/libexec/rtld-elf/arm/reloc.c
+++ b/libexec/rtld-elf/arm/reloc.c
@@ -280,10 +280,13 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache,
                                return -1;
 
                        tmp = (Elf_Addr)def->st_value + defobj->tlsoffset;
-                       if (__predict_true(RELOC_ALIGNED_P(where)))
+                       if (__predict_true(RELOC_ALIGNED_P(where))) {
+                               tmp += *where;
                                *where = tmp;
-                       else
+                       } else {
+                               tmp += load_ptr(where);
                                store_ptr(where, tmp);
+                       }
                        dbg("TLS_TPOFF32 %s in %s --> %p",
                            obj->strtab + obj->symtab[symnum].st_name,
                            obj->path, (void *)tmp);


# git -C /usr/official-src/ diff lib/libc/Makefile
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index fbfd6619784d..d887e0808ceb 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -54,11 +54,7 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
 
 # Use a more efficient TLS model for libc since we can reasonably assume that
 # it will be loaded during program startup.
-.if ${LIBC_ARCH} == "aarch64" || ${LIBC_ARCH} == "amd64" || \
-    ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "riscv" || \
-    ${LIBC_ARCH:Mpowerpc*} != ""
 CFLAGS+= -ftls-model=initial-exec
-.endif
 
 #
 # Link with static libcompiler_rt.a.


So far the build is suggestive of being able to complete
but we will just have to wait and see.

If all goes well: Too bad about the timing relative to 14.2-STABLE.
Comment 36 Mark Millard 2024-11-17 06:01:22 UTC
(In reply to Mark Millard from comment #35)

Dumb typo. Fix: ". . . relative to 14.2-RELEASE."
Comment 37 Mark Millard 2024-11-17 09:16:29 UTC
(In reply to Mikael Urankar from comment #24)
(In reply to Mark Millard from comment #36)

lang/rust 1.82.0_1 built just fine on/for stable/14
based on the 3 points:

) The lack of the "gnu" target_env issue for the
  bootstrap rustc.

) The libexec/rtld-elf/arm/reloc.c fix for
  -ftls-model=initial-exec support.

) The change to when 'CFLAGS+= -ftls-model=initial-exec'
  is used in lib/libc/Makefile .

For reference:

[00:29:39] [01] [00:00:00] Building   lang/rust | rust-1.82.0_1
[02:59:41] [01] [02:30:02] Finished   lang/rust | rust-1.82.0_1: Success

# pkg-static -r/stable-armv7-alt-chroot/ add /usr/local/poudriere/data/packages/stable-armv7-alt-default/All/rust-1.82.0_1.pkg 
Installing rust-1.82.0_1...
`-- Installing curl-8.10.1...
|   `-- Installing libnghttp2-1.64.0...
|   `-- Extracting libnghttp2-1.64.0: 100%
|   `-- Installing libpsl-0.21.5_1...
|   | `-- Installing libidn2-2.3.7...
|   |   `-- Installing indexinfo-0.3.1...
|   |   `-- Extracting indexinfo-0.3.1: 100%
|   |   `-- Installing libunistring-1.2...
|   |   `-- Extracting libunistring-1.2: 100%
|   | `-- Extracting libidn2-2.3.7: 100%
|   `-- Extracting libpsl-0.21.5_1: 100%
|   `-- Installing libssh2-1.11.1,3...
|   `-- Extracting libssh2-1.11.1,3: 100%
`-- Extracting curl-8.10.1: 100%
Extracting rust-1.82.0_1: 100%

# ~/do-chroot-stable-armv7-alt-chroot.sh

# rustc -vV
rustc 1.82.0 (f6e511eec 2024-10-15) (built from a source tarball)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: armv7-unknown-freebsd
release: 1.82.0
LLVM version: 19.1.1

# rustc --print=cfg
debug_assertions
panic="unwind"
target_abi="eabihf"
target_arch="arm"
target_endian="little"
target_env=""
target_family="unix"
target_has_atomic="16"
target_has_atomic="32"
target_has_atomic="64"
target_has_atomic="8"
target_has_atomic="ptr"
target_os="freebsd"
target_pointer_width="32"
target_vendor="unknown"
unix
Comment 38 Mark Millard 2024-11-17 09:23:41 UTC
(In reply to Mark Millard from comment #37)

Note, both:

/stable-armv7-alt-chroot

/stable/armv7-alt-poud
(the poudriere jail stable-armv7-alt 's world)

are populated with installs of the world built
with the 2 patches involved.
Comment 39 Mark Millard 2024-11-17 09:26:15 UTC
(In reply to Mark Millard from comment #38)

[Just correcting the mistaken "/" to be a "-".]

Note, both:

/stable-armv7-alt-chroot

/stable-armv7-alt-poud
(the poudriere jail stable-armv7-alt 's world)

are populated with installs of the world built
with the 2 patches involved.
Comment 40 Mikael Urankar freebsd_committer freebsd_triage 2024-11-17 17:14:57 UTC
(In reply to Mark Millard from comment #37)
Thank you!
Comment 41 Mark Millard 2024-11-18 00:24:33 UTC
I'll note that the main-armv7-default official package
builder run that recently started had lang/rust fail
while fetching.

https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/pdfee61567d9e_s5036d9652a/logs/errors/rust-1.82.0_1.log

reports:

. . .
=======================<phase: fetch          >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
===>  License APACHE20 MIT accepted by the user
=> 2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz doesn't seem to exist in /portdistfiles/rust.
=> Attempting to fetch http://distcache.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: http://distcache.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: size mismatch: expected 61790324, actual 61737980
=> Attempting to fetch http://distcache.us-east.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: http://distcache.us-east.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: size mismatch: expected 61790324, actual 61737980
=> Attempting to fetch http://distcache.eu.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: http://distcache.eu.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: size mismatch: expected 61790324, actual 61737980
=> Attempting to fetch http://distcache.us-west.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: http://distcache.us-west.FreeBSD.org/local-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: size mismatch: expected 61790324, actual 61737980
=> Attempting to fetch https://static.rust-lang.org/dist/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: https://static.rust-lang.org/dist/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: Not Found
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz
fetch: http://distcache.FreeBSD.org/ports-distfiles/rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz: Not Found
=> Couldn't fetch it - please try to retrieve this
=> port manually into /portdistfiles/rust and try again.
*** Error code 1
. . .
Comment 42 Mark Millard 2024-11-18 00:29:05 UTC
(In reply to Mark Millard from comment #41)

May be that is just the ports snapshot it was working
from being older than, for example, the bootstrap update.

(main-arm64-default and then main-armv7-default use the same
snapshot as a pair but bulk -a times are longer than for
amd64 so the time frame ends up being older for
main-armv7-default by the time it actually starts its
build.)
Comment 43 Robert Clausecker freebsd_committer freebsd_triage 2024-11-20 12:06:17 UTC
(In reply to Mikael Urankar from comment #27)

Now that we've confirmed that this is the fix, could you commit something to lang/rust that updates to your regenerated bootstrap and adds the necessary patch to make the build succeed on armv7 FreeBSD 14.1?  Please MFH if possible.
Comment 44 commit-hook freebsd_committer freebsd_triage 2024-11-22 08:43:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c348a547923c25a771d0d2a5db796103e25511ec

commit c348a547923c25a771d0d2a5db796103e25511ec
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-11-22 08:40:03 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-11-22 08:40:03 +0000

    lang/rust: Fix build on armv7

    PR:             282663

 lang/rust/distinfo                                           | 12 ++++++------
 ...tch-compiler_rustc__target_src_spec_base_freebsd.rs (new) | 11 +++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)
Comment 45 Mark Millard 2024-11-22 18:16:21 UTC
FYI:

Today stable/14 and stable/13 got the updates that are what had
main [so: 15 as stands] working:

git: d39e0bdc6b76 - stable/14 - rtld/arm: fix initial-exec (IE) thread-local storage relocation R. Christian McDonald
git: f424c4a907e1 - stable/14 - libc: enable initial-exec (IE) as default thread-local storage model on arm R. Christian McDonald
git: e10cca68cf34 - stable/13 - rtld/arm: fix initial-exec (IE) thread-local storage relocation R. Christian McDonald
git: c364608261d1 - stable/13 - libc: enable initial-exec (IE) as default thread-local storage model on arm R. Christian McDonald

So: at least 14.3-RELEASE and 13.5-RELEASE (if there is such) should
end up fixed for such issues. (lang/rust need not be the only example
of an issue.) It may be too late for 14.2-RELEASE .
Comment 46 Robert Clausecker freebsd_committer freebsd_triage 2024-11-22 19:51:13 UTC
(In reply to commit-hook from comment #44)

Could you MFH these updates if possible?