Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903607 - dev-lang/rust-1.69.0-r1 fails to compile with musl-9999 (1.2.4) because of LFS changes - undefined symbol: stat64
Summary: dev-lang/rust-1.69.0-r1 fails to compile with musl-9999 (1.2.4) because of LF...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard: fixed in 1.72.0
Keywords: PullRequest
Depends on: 910496
Blocks: musl-1.2.4 908071
  Show dependency tree
 
Reported: 2023-03-30 17:14 UTC by immolo
Modified: 2023-12-21 19:41 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (rust.log,64.29 KB, text/x-log)
2023-03-30 17:14 UTC, immolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description immolo 2023-03-30 17:14:04 UTC
Created attachment 859297 [details]
build.log

On my clang/musl/23.0 test machine I've run across a LFS change causing an issue with compiling rust.

This is known upstream but highlighting here as it effects the 23.0 profiles.

Reproduce:

1. Setup llvm/musl with a 23.0 profile
2. emerge -va sys-libs/musl-9999
3. emerge -va dev-lang/rust

Error:

ld.lld: error: undefined symbol: stat64
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-06 10:33:15 UTC
https://github.com/rust-lang/rust/pull/107129 was finally merged which should unblock https://github.com/rust-lang/libc/pull/3068 which should unblock https://github.com/rust-lang/libc/pull/2935.
Comment 2 immolo 2023-05-07 14:03:00 UTC
As of dev-lang/rust-1.69.0-r1 this seems like it compiling on a musl-1.2.4 system.
Comment 3 Violet Purcell 2023-05-08 03:37:21 UTC
I'm still running into this issue.
Comment 4 Agostino Sarubbo gentoo-dev 2023-05-08 07:58:52 UTC
tinderbox_musl has reproduced this issue with version 1.69.0-r1 - Updating summary.
Comment 5 immolo 2023-05-13 14:00:14 UTC
Taking back earlier comment of it working as it was a one time thing I can't get to work again.
Comment 6 Violet Purcell 2023-05-16 14:06:05 UTC
I've put together a quite bad hack to fix this that applies the two unmerged PRs to all three versions of the libc crate bundled with rust. Unfortunately since the compilation errors are caused by the already-compiled std crate from the bootstrapping rust version, this patch requires you to to first downgrade to musl 1.2.3, then compile rust, then upgrade back to musl 1.2.4, and then do any further rust updates with system-bootstrap. Any suggestions on how to make this not a bad hack would be appreciated.
patch: https://0x0.st/HN4m.4.patch
Comment 8 tt_1 2023-10-03 09:36:26 UTC
(In reply to orbea from comment #7)
> Fixed.
> 
> https://github.com/gentoo/gentoo/commit/
> 515b5920046117355d88b3494c74da269ce9b30a

Is it possible to skip that patch, and continue with the soon to be released rust-1.73.0 instead?
Comment 9 orbea 2023-10-03 13:53:55 UTC
> Is it possible to skip that patch, and continue with the soon to be released rust-1.73.0 instead?

It was already merged in ::gentoo and its not my call, but is there a reason why?
Comment 10 tt_1 2023-10-04 17:31:17 UTC
well, I read in one the many pullrequests, or one of the bugs concerning the whole rust breaking due to lfs changes in musl-1.2.4 that it is a rather complicated process, requesting multiple patching and rebootstraps. 

musl is not considered a blocker while stabilizing, so it's possible it will break at some point, therefore it *might* be a better idea to wait for a fixed rust-stage, and to continue with a fully fixed dev-lang/rust. 

if you're aware of all the precautions to take, a musl specific news item would be great!?
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-04 17:35:35 UTC
(In reply to tt_1 from comment #10)
> well, I read in one the many pullrequests, or one of the bugs concerning the
> whole rust breaking due to lfs changes in musl-1.2.4 that it is a rather
> complicated process, requesting multiple patching and rebootstraps. 
> 
> musl is not considered a blocker while stabilizing, so it's possible it will
> break at some point, therefore it *might* be a better idea to wait for a
> fixed rust-stage, and to continue with a fully fixed dev-lang/rust. 
> 
> if you're aware of all the precautions to take, a musl specific news item
> would be great!?

This just sounds based on speculation? I'm not aware of any real issues with vimproved's approach. It's using a newer version for bootstrapping.

I think you're referring to an older approach that was considered but not merged.