Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 2026 14:20:03 +0000
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 718e5874be03 - main - llvm-libc-macros: work around gcc defining LDBL_MANT_DIG as 53 on i386
Message-ID:  <69eccd93.37ac5.26148e96@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=718e5874be0306ea302fd2b8e1d97fc79682abbe

commit 718e5874be0306ea302fd2b8e1d97fc79682abbe
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-02 20:32:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-04-25 14:14:11 +0000

    llvm-libc-macros: work around gcc defining LDBL_MANT_DIG as 53 on i386
    
    Otherwise, gcc will not be able to compile parts of libc++ 21 in -m32
    mode, resulting in errors similar to:
    
        In file included from /usr/src/contrib/llvm-project/libc/shared/str_to_float.h:13,
                         from /usr/src/contrib/llvm-project/libcxx/src/include/from_chars_floating_point.h:14,
                         from /usr/src/contrib/llvm-project/libcxx/src/charconv.cpp:12:
        /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h: In function 'void __llvm_libc::internal::set_implicit_bit(__llvm_libc::fputil::FPBits<T>&) [with T = long double]':
        /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h:77:10: error: 'struct __llvm_libc::fputil::FPBits<long double>' has no member named 'set_implicit_bit'
           77 |   result.set_implicit_bit(result.get_biased_exponent() != 0);
              |          ^~~~~~~~~~~~~~~~
    
    PR:             292067
    MFC after:      1 month
---
 contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h b/contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h
index a25ef60a293d..3bf92bc7b6c9 100644
--- a/contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h
+++ b/contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h
@@ -61,6 +61,11 @@
 #define DBL_MANT_DIG __DBL_MANT_DIG__
 #endif // DBL_MANT_DIG
 
+// Kludge for gcc defining LDBL_MANT_DIG as 53 on i386
+#if defined(LDBL_MANT_DIG) && defined(__GNUC__) && !defined(__clang__) && defined(__i386__)
+#undef LDBL_MANT_DIG
+#endif
+
 #ifndef LDBL_MANT_DIG
 #define LDBL_MANT_DIG __LDBL_MANT_DIG__
 #endif // LDBL_MANT_DIG


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69eccd93.37ac5.26148e96>