Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors setting of FMT_USE_FLOAT128 #3259

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Conversation

Roman-Koshelev
Copy link
Contributor

@Roman-Koshelev Roman-Koshelev commented Jan 1, 2023

Target=x86_64-linux-gnu

ld.lld: error: undefined symbol: __extenddftf2
>>> referenced by format-test.cc:89 (.../contrib/libs/fmt/test/format-test.cc:89)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(void check_isfinite<__float128>())
>>> referenced by format-test.cc:94 (.../contrib/libs/fmt/test/format-test.cc:94)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(void check_isfinite<__float128>())
>>> referenced by format-test.cc:95 (.../contrib/libs/fmt/test/format-test.cc:95)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(void check_isfinite<__float128>())
>>> referenced 8 more times

ld.lld: error: undefined symbol: __eqtf2
>>> referenced by format.h:2491 (.../contrib/libs/fmt/include/fmt/format.h:2491)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(bool fmt::v9::detail::isfinite<__float128, 0>(__float128))

ld.lld: error: undefined symbol: __netf2
>>> referenced by format.h:2491 (.../contrib/libs/fmt/include/fmt/format.h:2491)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(bool fmt::v9::detail::isfinite<__float128, 0>(__float128))

ld.lld: error: undefined symbol: __unordtf2
>>> referenced by format.h:2469 (.../contrib/libs/fmt/include/fmt/format.h:2469)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(bool fmt::v9::detail::isnan<__float128>(__float128))

ld.lld: error: undefined symbol: __trunctfdf2
>>> referenced by format.h:2504 (.../contrib/libs/fmt/include/fmt/format.h:2504)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(std::__y1::back_insert_iterator<std::__y1::basic_string<char, std::__y1::char_traits<char>, std::__y1::allocator<char> > > fmt::v9::detail::write<char, std::__y1::back_insert_iterator<std::__y1::basic_string<char, std::__y1::char_traits<char>, std::__y1::allocator<char> > >, __float128, 0>(std::__y1::back_insert_iterator<std::__y1::basic_string<char, std::__y1::char_traits<char>, std::__y1::allocator<char> > >, __float128, fmt::v9::basic_format_specs<char>, fmt::v9::detail::locale_ref))

ld.lld: error: undefined symbol: __getf2
>>> referenced by format.h:3077 (.../contrib/libs/fmt/include/fmt/format.h:3077)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(int fmt::v9::detail::format_float<__float128>(__float128, int, fmt::v9::detail::float_specs, fmt::v9::detail::buffer<char>&))

ld.lld: error: undefined symbol: __letf2
>>> referenced by format.h:3081 (.../contrib/libs/fmt/include/fmt/format.h:3081)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(int fmt::v9::detail::format_float<__float128>(__float128, int, fmt::v9::detail::float_specs, fmt::v9::detail::buffer<char>&))

ld.lld: error: undefined symbol: __trunctfsf2
>>> referenced by format.h:3138 (.../contrib/libs/fmt/include/fmt/format.h:3138)
>>>               /home/romankoshelev/.ya/build/build_root/zb02/000035/contrib/libs/fmt/test/format-test/__/format-test.cc.o:(int fmt::v9::detail::format_float<__float128>(__float128, int, fmt::v9::detail::float_specs, fmt::v9::detail::buffer<char>&))
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
Failed

@vitaut
Copy link
Contributor

vitaut commented Jan 1, 2023

Thanks for the PR but please provide full repro details for the issue you are trying to fix, ideally on godbolt.

@vitaut
Copy link
Contributor

vitaut commented Jan 15, 2023

Closing since it is unclear under which conditions the errors occur and I wasn't able to reproduce them on the x86_64-linux-gnu target. Feel free to reopen with more repro details.

@vitaut vitaut closed this Jan 15, 2023
@michaelsiegrist
Copy link

I encountered the same issue when compiling within an Ubuntu 22.04 Docker container using clang 15.0.2. I resolved the issue by defining FMT_USE_FLOAT128=0 during cmake configuration, so my full configuration looks like this:

cmake \
    -B build \
    -S . \
    -G Ninja \
    -DCMAKE_CXX_FLAGS="-DFMT_USE_FLOAT128=0" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CXX_COMPILER=clang++

However, this patch fixes the issue for me. It would be great to have it merged in.

@phprus
Copy link
Contributor

phprus commented Feb 8, 2023

@vitaut
This PR fixes OpenBSD issue #3297

@vitaut vitaut merged commit 9907089 into fmtlib:master Feb 8, 2023
@vitaut
Copy link
Contributor

vitaut commented Feb 8, 2023

Merged, thanks!

@brad0
Copy link

brad0 commented Nov 27, 2023

The root issue of this should be fixed by..

llvm/llvm-project@d2ce3e9

Looking at the patch that went in that will have to be adjusted now that compiler-rt has been fixed. quadmath.h will not exist on a Clang + libc++ environment like FreeBSD and OpenBSD.

This will be released with LLVM / Clang 18.

I enabled __float128 support on FreeBSD and NetBSD.

llvm/llvm-project@23c47eb

This will be released with LLVM / Clang 17.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants