Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924396 - dev-lang/rust-1.75.0-r1[lto] fails to compile on ppc64le, ppc64, ppc: using uninitialized data, but this operation requires initialized memory
Summary: dev-lang/rust-1.75.0-r1[lto] fails to compile on ppc64le, ppc64, ppc: using u...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Randy Barlow
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2024-02-13 03:27 UTC by matoro
Modified: 2024-03-10 01:59 UTC (History)
3 users (show)

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


Attachments
build.log and emerge --info (build.log.xz,476.45 KB, application/x-xz)
2024-02-13 03:28 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-02-13 03:27:18 UTC
Completely broken on all powerpc platforms with USE=lto.  Tons of errors all over the place.

  --> /rust/deps/proc-macro2/build.rs:51:30
   |
51 |     let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs;
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: expected names are: `bootstrap`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
   = note: `#[warn(unexpected_cfgs)]` on by default

error[E0080]: evaluation of constant value failed
  --> /rust/deps/proc-macro2/build.rs:97:30
   |
97 |     if pieces.next() != Some("rustc 1") {
   |                              ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory

note: erroneous constant encountered
  --> /rust/deps/proc-macro2/build.rs:97:25
   |
97 |     if pieces.next() != Some("rustc 1") {
   |                         ^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0080`.

Did not run successfully: exit status: 1

error[E0080]: it is undefined behavior to use this value
 --> /rust/deps/serde/build.rs:8:1
  |
8 | fn main() {
  | ^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a reference
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
  = note: the raw bytes of the constant (size: 8, align: 8) {
              ╾───────alloc8────────╼                         │ ╾──────╼
          }

note: erroneous constant encountered
  --> /rust/deps/serde/build.rs:17:32
   |
17 |     let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0080]: it is undefined behavior to use this value
 --> /rust/deps/serde/build.rs:8:1
  |
8 | fn main() {
  | ^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a reference
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
  = note: the raw bytes of the constant (size: 8, align: 8) {
              ╾───────alloc48───────╼                         │ ╾──────╼
          }

note: erroneous constant encountered
  --> /rust/deps/serde/build.rs:17:72
   |
17 |     let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";
   |                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0080]: evaluation of constant value failed
  --> /rust/deps/serde/build.rs:86:30
   |
86 |     if pieces.next() != Some("rustc 1") {
   |                              ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory

note: erroneous constant encountered
  --> /rust/deps/serde/build.rs:86:25
   |
86 |     if pieces.next() != Some("rustc 1") {
   |                         ^^^^^^^^^^^^^^^


Did not run successfully: exit status: 1                                                 

Reproducible: Always
Comment 1 matoro archtester 2024-02-13 03:28:30 UTC
Created attachment 884824 [details]
build.log and emerge --info
Comment 2 Larry the Git Cow gentoo-dev 2024-02-15 13:56:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aea8218e7503d79ec9e0f5e3c571322a8f7effe9

commit aea8218e7503d79ec9e0f5e3c571322a8f7effe9
Author:     Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
AuthorDate: 2024-02-14 23:10:02 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-02-15 13:52:42 +0000

    profiles/arch/powerpc/package.use.mask: Mask lto in profiles/arch/powerpc/package.use.mask
    
    Bug: https://bugs.gentoo.org/924396
    Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
    Closes: https://github.com/gentoo/gentoo/pull/35334
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/powerpc/package.use.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 3 matoro archtester 2024-03-09 17:52:04 UTC
This affects 1.76.0 as well, please extend mask.
Comment 4 matoro archtester 2024-03-09 18:25:14 UTC
Actually, only seems to affect ppc64le for 1.76.0.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-10 01:48:24 UTC
I'm just going to mask it in arch/base and unmask it on amd64. It's way too brittle.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-10 01:49:06 UTC
(In reply to Sam James from comment #5)
> I'm just going to mask it in arch/base and unmask it on amd64. It's way too
> brittle.

Eh, or maybe not, given it'll be a pain to undo then. I will think about it.
Comment 7 Larry the Git Cow gentoo-dev 2024-03-10 01:59:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4fea4d54461547fd1af6fb60796b99778a3d694

commit c4fea4d54461547fd1af6fb60796b99778a3d694
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-03-10 01:48:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-03-10 01:48:12 +0000

    profiles/arch: broaden the Rust LTO mask for arm64 & powerpc
    
    matoro reports 1.76.0 is still hosed.
    
    Bug: https://bugs.gentoo.org/924301
    Bug: https://bugs.gentoo.org/924396
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/arm64/package.use.mask   | 2 +-
 profiles/arch/powerpc/package.use.mask | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)