Openwrt 24.10.0: Rust/host does not build on Ubuntu 22.04 build host
Shankar Unni
shankar.unni+openwrt at gmail.com
Mon Feb 10 15:30:23 PST 2025
I'm trying to build an x86_64 target, on an x86_64 Ubuntu host. My
.config and the failed rust host build log are attached.
cc'ing Luca, the maintainer of the rust package in Openwrt.
Basically, something strange is happening here: I have enabled a
package (python-cryptography) that requires the Rust host build. When
the rust host build kicks off, it uses the G++ in the openwrt
toolchain in staging_dir to compile and link against. (This is gcc
13.2, with libstdc++.so.6.0.32) - because it just picks up whatever
is on the PATH, which is set by the openwrt build's standard include
Makefiles.
However, the bootstrap step in rust builds a binary called
"libcxx-version", and attempts to run it without passing an
appropriate LD_LIBRARY_PATH or interpreter (ld-linux.so.2), so it
chokes with the message (trimmed):
..../libcxx-version: /lib/x86_64-linux-gnu/libstdc++.so.6: version
`GLIBCXX_3.4.32' not found (required by
.../host/rustc-1.84.0-src/build/x86_64-unknown-linux-gnu/libcxx-version/libcxx-version)
This is because it's built against the latest glibc, but is attempting
to run against the Ubuntu 22.04 system libstdc++ in
/lib/x86_64-linux-gnu/libstdc++.so.6.0.30.
Has anyone build 24.10 with rust on Ubuntu 22.04 (LTS)?
(Unfortunately we can't move forward yet, because we also have to
build for our current standard environment which is still on 22.04,
and won't move to 24.04 for a few months).
Thanks!
--
Shankar Unni
shankar.unni at gmail.com
Attached: .config (as "openwrt.config") and Rust host-compile.txt.
-------------- next part --------------
+ curl -f --connect-timeout 20 --retry 5 --location https://static.rust-lang.org/dist/rustc-1.81.0-src.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
1 414M 1 7328k 0 0 3840k 0 0:01:50 0:00:01 0:01:49 3838k
10 414M 10 43.9M 0 0 15.1M 0 0:00:27 0:00:02 0:00:25 15.1M
23 414M 23 97.3M 0 0 24.9M 0 0:00:16 0:00:03 0:00:13 24.9M
36 414M 36 151M 0 0 30.9M 0 0:00:13 0:00:04 0:00:09 30.9M
52 414M 52 216M 0 0 36.7M 0 0:00:11 0:00:05 0:00:06 43.8M
64 414M 64 267M 0 0 38.7M 0 0:00:10 0:00:06 0:00:04 52.1M
77 414M 77 322M 0 0 40.8M 0 0:00:10 0:00:07 0:00:03 55.7M
92 414M 92 384M 0 0 43.2M 0 0:00:09 0:00:08 0:00:01 57.4M
100 414M 100 414M 0 0 43.5M 0 0:00:09 0:00:09 --:--:-- 56.8M
Applying /home/shankar/openwrt/openwrt-2410/packages/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch using plaintext:
patching file src/bootstrap/Cargo.toml
Applying /home/shankar/openwrt/openwrt-2410/packages/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch using plaintext:
patching file vendor/elasticlunr-rs-3.0.2/Cargo.lock
patching file vendor/libffi-3.2.0/Cargo.lock
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--target ...
configure: build.build := x86_64-unknown-linux-gnu
configure: build.target := ['x86_64-unknown-linux-gnu', 'x86_64-unknown-l ...
configure: build.host := ['x86_64-unknown-linux-gnu']
configure: install.prefix := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: install.bindir := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: install.libdir := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: install.sysconfdir := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: install.datadir := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: install.mandir := /home/shankar/openwrt/openwrt-2410/openwrt/sta ...
configure: dist.compression-formats := ['gz']
configure: build.sanitizers := False
configure: rust.channel := stable
configure: build.cargo-native-static := True
configure: build.bootstrap-cache-path := /home/shankar/openwrt/openwrt-2410/openw ...
configure: llvm.download-ci-llvm := True
configure: target.x86_64-unknown-linux-gnu.ar := x86_64-openwrt-linux-gnu-gcc-ar
configure: target.x86_64-unknown-linux-gnu.cc := x86_64-openwrt-linux-gnu-gcc
configure: target.x86_64-unknown-linux-gnu.cxx := x86_64-openwrt-linux-gnu-g++
configure: target.x86_64-unknown-linux-gnu.linker := x86_64-openwrt-linux-gnu-gcc ...
configure: target.x86_64-unknown-linux-gnu.ranlib := x86_64-openwrt-linux-gnu-gcc ...
configure: target.x86_64-unknown-linux-gnu.crt-static := False
configure: profile := dist
configure:
configure: writing `config.toml` in current directory
configure:
configure: run `python /home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/x.py --help`
downloading https://static.rust-lang.org/dist/2024-08-08/rust-std-1.80.1-x86_64-unknown-linux-gnu.tar.xz
#=#=#
##### 7.6%
########################### 38.3%
############################################### 65.5%
#################################################################### 95.2%
######################################################################## 100.0%
downloading https://static.rust-lang.org/dist/2024-08-08/rustc-1.80.1-x86_64-unknown-linux-gnu.tar.xz
0.8%
######### 13.3%
################# 24.9%
######################## 34.3%
############################## 42.3%
################################### 49.9%
########################################### 60.5%
#################################################### 72.7%
############################################################# 85.7%
######################################################################## 100.0%
downloading https://static.rust-lang.org/dist/2024-08-08/cargo-1.80.1-x86_64-unknown-linux-gnu.tar.xz
### 5.5%
######################################################################## 100.0%
extracting /home/shankar/openwrt/openwrt-2410/openwrt/dl/rustc/2024-08-08/rust-std-1.80.1-x86_64-unknown-linux-gnu.tar.xz
extracting /home/shankar/openwrt/openwrt-2410/openwrt/dl/rustc/2024-08-08/rustc-1.80.1-x86_64-unknown-linux-gnu.tar.xz
extracting /home/shankar/openwrt/openwrt-2410/openwrt/dl/rustc/2024-08-08/cargo-1.80.1-x86_64-unknown-linux-gnu.tar.xz
Building bootstrap
Updating crates.io index
Downloading crates ...
Downloaded block-buffer v0.10.4
Downloaded bitflags v2.4.1
Downloaded anstyle v1.0.4
Downloaded crossbeam-deque v0.8.5
Downloaded ignore v0.4.21
Downloaded home v0.5.9
Downloaded clap v4.4.13
Downloaded same-file v1.0.6
Downloaded version_check v0.9.4
Downloaded itoa v1.0.10
Downloaded termcolor v1.4.0
Downloaded clap_lex v0.6.0
Downloaded heck v0.4.1
Downloaded xz2 v0.1.7
Downloaded walkdir v2.4.0
Downloaded semver v1.0.21
Downloaded filetime v0.2.23
Downloaded toml v0.5.11
Downloaded pkg-config v0.3.28
Downloaded typenum v1.17.0
Downloaded serde_derive v1.0.195
Downloaded xattr v1.2.0
Downloaded sha2 v0.10.8
Downloaded unicode-ident v1.0.12
Downloaded tar v0.4.40
Downloaded serde v1.0.195
Downloaded memchr v2.7.1
Downloaded clap_builder v4.4.12
Downloaded bstr v1.9.0
Downloaded serde_json v1.0.111
Downloaded proc-macro2 v1.0.76
Downloaded crossbeam-epoch v0.9.18
Downloaded globset v0.4.14
Downloaded syn v2.0.48
Downloaded object v0.32.2
Downloaded rustix v0.38.28
Downloaded regex-syntax v0.8.2
Downloaded crossbeam-utils v0.8.20
Downloaded regex-automata v0.4.3
Downloaded libc v0.2.155
Downloaded lzma-sys v0.1.20
Downloaded ryu v1.0.16
Downloaded quote v1.0.35
Downloaded log v0.4.20
Downloaded linux-raw-sys v0.4.12
Downloaded cmake v0.1.48
Downloaded clap_derive v4.4.7
Downloaded errno v0.3.8
Downloaded fd-lock v4.0.2
Downloaded clap_complete v4.4.6
Downloaded generic-array v0.14.7
Downloaded crypto-common v0.1.6
Downloaded cpufeatures v0.2.12
Downloaded digest v0.10.7
Downloaded opener v0.5.2
Downloaded cc v1.0.97
Downloaded cfg-if v1.0.0
Downloaded aho-corasick v1.1.2
Compiling proc-macro2 v1.0.76
Compiling unicode-ident v1.0.12
Compiling memchr v2.7.1
Compiling typenum v1.17.0
Compiling version_check v0.9.4
Compiling libc v0.2.155
Compiling rustix v0.38.28
Compiling serde v1.0.195
Compiling cc v1.0.97
Compiling regex-syntax v0.8.2
Compiling crossbeam-utils v0.8.20
Compiling cfg-if v1.0.0
Compiling pkg-config v0.3.28
Compiling bitflags v2.4.1
Compiling linux-raw-sys v0.4.12
Compiling clap_lex v0.6.0
Compiling anstyle v1.0.4
Compiling heck v0.4.1
Compiling semver v1.0.21
Compiling serde_json v1.0.111
Compiling same-file v1.0.6
Compiling log v0.4.20
Compiling bootstrap v0.0.0 (/home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/src/bootstrap)
Compiling ryu v1.0.16
Compiling cpufeatures v0.2.12
Compiling itoa v1.0.10
Compiling home v0.5.9
Compiling termcolor v1.4.0
Compiling walkdir v2.4.0
Compiling generic-array v0.14.7
Compiling clap_builder v4.4.12
Compiling aho-corasick v1.1.2
Compiling object v0.32.2
Compiling cmake v0.1.48
Compiling quote v1.0.35
Compiling crossbeam-epoch v0.9.18
Compiling syn v2.0.48
Compiling filetime v0.2.23
Compiling lzma-sys v0.1.20
Compiling crossbeam-deque v0.8.5
Compiling block-buffer v0.10.4
Compiling crypto-common v0.1.6
Compiling regex-automata v0.4.3
Compiling digest v0.10.7
Compiling sha2 v0.10.8
Compiling xattr v1.2.0
Compiling fd-lock v4.0.2
Compiling tar v0.4.40
Compiling toml v0.5.11
Compiling clap_derive v4.4.7
Compiling serde_derive v1.0.195
Compiling bstr v1.9.0
Compiling globset v0.4.14
Compiling opener v0.5.2
Compiling ignore v0.4.21
Compiling clap v4.4.13
Compiling clap_complete v4.4.6
Compiling xz2 v0.1.7
Compiling build_helper v0.1.0 (/home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/src/tools/build_helper)
Finished `dev` profile [unoptimized] target(s) in 18.66s
WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
NOTE: to silence this warning, add `change-id = 127866` at the top of `config.toml`
/home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/build/x86_64-unknown-linux-gnu/libcxx-version/libcxx-version: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/build/x86_64-unknown-linux-gnu/libcxx-version/libcxx-version)
Command "/home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/build/x86_64-unknown-linux-gnu/libcxx-version/libcxx-version" (failure_mode=Exit, stdout_mode=Capture, stderr_mode=Print) did not execute successfully.
Expected success, got exit status: 1
Created at: src/core/build_steps/tool.rs:985:30
Executed at: src/core/build_steps/tool.rs:985:67
STDOUT ----
Build completed unsuccessfully in 0:00:33
make[3]: *** [Makefile:109: /home/shankar/openwrt/openwrt-2410/openwrt/build_dir/target-x86_64_glibc/host/rustc-1.81.0-src/.built] Error 1
time: package/feeds/packages/rust/host-compile#99.21#22.50#56.83
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openwrt.config
Type: application/octet-stream
Size: 310263 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20250210/8db83750/attachment-0001.obj>
More information about the openwrt-devel
mailing list