Skip to content

powerpc64le_unknown_freebsd.rs: link with -lgcc#158646

Open
pkubaj wants to merge 1 commit into
rust-lang:mainfrom
pkubaj:patch-1
Open

powerpc64le_unknown_freebsd.rs: link with -lgcc#158646
pkubaj wants to merge 1 commit into
rust-lang:mainfrom
pkubaj:patch-1

Conversation

@pkubaj

@pkubaj pkubaj commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double. 128 bit arithmetics are implemented in LLVM's compiler_rt, which is FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0 succeeds - noop for earlier releases.

Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double. 128 bit arithmetics are implemented in LLVM's compiler_rt, which is FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0 succeeds - noop for earlier releases.
@rustbot

rustbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2026
@rustbot

rustbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

r? @camelid

rustbot has assigned @camelid.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 16 candidates
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 59.755
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs:9:
     base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
     // long double is IEEE-128; f128 soft-float ops emit the PPC __*kf* helpers,
     // which compiler_builtins lacks. Resolve them from base libgcc.
-    base.late_link_args.entry(LinkerFlavor::Gnu(Cc::Yes, Lld::No)).or_default().push("-lgcc".into());
-    base.late_link_args.entry(LinkerFlavor::Gnu(Cc::Yes, Lld::Yes)).or_default().push("-lgcc".into());
+    base.late_link_args
+        .entry(LinkerFlavor::Gnu(Cc::Yes, Lld::No))
+        .or_default()
+        .push("-lgcc".into());
+    base.late_link_args
+        .entry(LinkerFlavor::Gnu(Cc::Yes, Lld::Yes))
+        .or_default()
+        .push("-lgcc".into());
     base.max_atomic_width = Some(64);
     base.stack_probes = StackProbeType::Inline;
     base.cfg_abi = CfgAbi::ElfV2;
fmt: checked 6975 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:01:38
  local time: Wed Jul  1 08:33:18 UTC 2026
  network time: Wed, 01 Jul 2026 08:33:18 GMT
// long double is IEEE-128; f128 soft-float ops emit the PPC __*kf* helpers,
// which compiler_builtins lacks. Resolve them from base libgcc.
base.late_link_args.entry(LinkerFlavor::Gnu(Cc::Yes, Lld::No)).or_default().push("-lgcc".into());
base.late_link_args.entry(LinkerFlavor::Gnu(Cc::Yes, Lld::Yes)).or_default().push("-lgcc".into());

@bjorn3 bjorn3 Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe use add_link_args(&mut base.late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-lgcc"]);? That will add the args both with and without lld.

View changes since the review

@camelid camelid assigned bjorn3 and unassigned camelid Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

5 participants