Skip to content

Commit

Permalink
lib.platform.loongnix: FIX gold linker not support
Browse files Browse the repository at this point in the history
  Debug:
    - BC configure-gold failure as a reason that gold linker haven't
      support loongarch architecture and i have check gold is not
      supporot it in every version.
    - According to `lib/systems/default.nix::linker`, the default choice
      of linker is `bdf` and shouldn't calling fo gold.
    - But according to `pkgs/development/tools/misc/binutils/default.nix` if the platform kernels execFormat was `elf` and platform wasn't RISCV then binusil will using gold as linker, which is different with prev.

  Action:
    1. since i haven't well understood the overall project structure,
       and the platform(loongarch64) seems haven't any kind of connection with kernel *(i haven't ideas about how to description it's kernel or os? )*, just adding another negation to avoid to using `gold` linker when architecture is `loongarch64`.
    2. adding a kind of document to helping latecommer to easy seem this
       situation.

  With-Bug:
    checking sysdep dirs... configure: error: The loongarch64 is not supported.
    error: builder for '/nix/store/qli5cbddq11gmjqwr4h5myj2iwjbbfqk-glibc-loongarch64-unknown-linux-gnu-2.35-224.drv' failed with exit code 1
    log: https://fars.ee/wBwd

  Others:
    Sorry, but seems that i haven't enough time to finish this...
    very appreciated about @K900:0upti.me help when i was confused.
  • Loading branch information
jackyliu16 committed Apr 22, 2023
1 parent 906bdc3 commit cbd2cbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ rec {
# "bfd" and "gold" both come from GNU binutils. The existence of Gold
# is why we use the more obscure "bfd" and not "binutils" for this
# choice.
# Note: The gold is been default using when kernel.execFormat = elf in `development/tools/misc/binutils/default.nix`
else "bfd";
extensions = rec {
sharedLibrary =
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/misc/binutils/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
withGold = platform: platform.parsed.kernel.execFormat.name == "elf" && !platform.isRiscV;
withGold = platform: platform.parsed.kernel.execFormat.name == "elf" && !platform.isRiscV && !platform.isLoongArch64;
in

{ stdenv
Expand Down

0 comments on commit cbd2cbd

Please sign in to comment.