Skip to content

Unable to find long double symbols on aarch64-apple-darwin #567

Closed
@tgross35

Description

@tgross35
Contributor

I am working on rust-lang/rust#114607 and unfortunately can't build on my system due to linker errors:

  = note: ld: warning: ignoring duplicate libraries: '-lSystem'
          ld: Undefined symbols:
            ___addtf3, referenced from:
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
            ___divtf3, referenced from:
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
            ___multf3, referenced from:
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
            ___subtf3, referenced from:
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
            ___trunctfdf2, referenced from:
                _$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$::fmt::h8dd8a3b2b4bc54ac in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.06.rcgu.o
                core::fmt::float::_$LT$impl$u20$core..fmt..Debug$u20$for$u20$f128$GT$::fmt::h0686fe3ef7164d45 in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.10.rcgu.o
            ___unordtf2, referenced from:
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
                std::num::test_num::h83194c034ce7125a in std-a7f7c4c812353510.std.3e4ab7aa3f61e492-cgu.12.rcgu.o
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
---
          ld: Undefined symbols:
            ___extenddftf2, referenced from:
                __RNvNtCsgSq1suy33ib_12clippy_utils6consts19lit_to_mir_constant in libclippy_utils-52261686d0193f09.rlib[10](clippy_utils-52261686d0193f09.clippy_utils.c495e003dc0e053d-cgu.07.rcgu.o)
            ___trunctfdf2, referenced from:
                __RINvXs1_NtCsgSq1suy33ib_12clippy_utils6constsNtB6_8ConstantNtNtCsdSdPP26wXhD_4core4hash4Hash4hashNtCsgzWzvnNrs6k_10rustc_hash8FxHasherEB8_ in libclippy_utils-52261686d0193f09.rlib[10](clippy_utils-52261686d0193f09.clippy_utils.c495e003dc0e053d-cgu.07.rcgu.o)

It seems like a fix similar to rust-lang/libc#1034 may work, I can submit a PR if this seems correct. @Amanieu

Activity

Amanieu

Amanieu commented on Jan 8, 2024

@Amanieu
Member

If we are supporting these types directly in Rust then we should add these intrinsics to compiler-builtins. For now you can just change the compiler-builtins build script to include the versions from compiler-rt, but eventually we will want to have these fully implemented in Rust.

tgross35

tgross35 commented on Jan 12, 2024

@tgross35
ContributorAuthor

@Amanieu are you able to move this issue to compiler-builtins?

It seems like they should be getting included already, so I'm not sure what is going on https://github.com/rust-lang/compiler-builtins/blob/47e64bfa0a387c811e4c409959a4d2668f0b1c37/build.rs#L506C20-L512. This is on aarch64-apple-darwin, I don't have any reason to think +nofp is set

transferred this issue fromrust-lang/libcon Jan 16, 2024
Amanieu

Amanieu commented on Jan 16, 2024

@Amanieu
Member

Are you building with the "c" feature of compiler-builtins? We only enable this when building with x.py but not for -Zbuild-std.

tgross35

tgross35 commented on May 17, 2024

@tgross35
ContributorAuthor

This should be fixed by #593, #606, and others that are listed in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Amanieu@tgross35

      Issue actions

        Unable to find long double symbols on `aarch64-apple-darwin` · Issue #567 · rust-lang/compiler-builtins