[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 4 11:28:18 PDT 2021


nickdesaulniers added a comment.

This seems to be causing build errors for the linux kernel (which uses `-mno-x87`) for expressions like: `unsigned long foo = 300L * 1E6L;`
https://github.com/ClangBuiltLinux/linux/issues/1497

  // clang -O2 -mno-x87
  void foo (unsigned long);
  void bar (void) { foo(1 * 1E6L); }

  <source>:3:25: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
  void bar (void) { foo(1 * 1E6L); }
                          ^

While we can change kernel sources to not use `L` suffixes for floating point literals, this is a curious difference from GCC and may lead to compatibility issues with other code bases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98895/new/

https://reviews.llvm.org/D98895



More information about the cfe-commits mailing list