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

libc: FEnvImpl.h error: static assertion failed due to requirement #118964

Open
sylvestre opened this issue Dec 6, 2024 · 8 comments
Open

libc: FEnvImpl.h error: static assertion failed due to requirement #118964

sylvestre opened this issue Dec 6, 2024 · 8 comments

Comments

@sylvestre
Copy link
Collaborator

sylvestre commented Dec 6, 2024

on i386

FAILED: projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o
/opt/sccache//sccache /build/source/build-llvm/bin/clang++ -DLIBC_COPT_ARRAY_ARG_LIST -DLIBC_COPT_MEMCPY_USE_EMBEDDED_TINY -DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE -DLIBC_COPT_PRINTF_DISABLE_STRERROR -DLIBC_COPT_PRINTF_DISABLE_WRITE_INT -DLIBC_COPT_USE_C_ASSERT -DLIBC_NAMESPACE=__llvm_libc_20_0_0_ -DLIBC_TYPES_LONG_DOUBLE_IS_FLOAT64 -I/build/source/build-llvm/tools/clang/stage2-bins/projects/libc/utils/gpu/server -I/build/source/libc/utils/gpu/server -I/build/source/libc -I/build/source/libc/include -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=../../../../ -ffile-prefix-map=/build/source/= -no-canonical-prefixes -O2 -DNDEBUG -g1 -std=c++17 -MD -MT projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o -MF projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o.d -o projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o -c /build/source/libc/src/stdio/printf_core/converter.cpp
In file included from /build/source/libc/src/stdio/printf_core/converter.cpp:20:
In file included from /build/source/libc/src/stdio/printf_core/converter_atlas.h:29:
In file included from /build/source/libc/src/stdio/printf_core/float_dec_converter.h:17:
In file included from /build/source/libc/src/__support/float_to_string.h:17:
In file included from /build/source/libc/src/__support/FPUtil/dyadic_float.h:12:
In file included from /build/source/libc/src/__support/FPUtil/FEnvImpl.h:31:
/build/source/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:377:5: error: static assertion failed due to requirement 'sizeof(fenv_t) == sizeof(__llvm_libc_20_0_0_::fputil::internal::FPState)': Internal floating point state does not match the public fenv_t type.
  377 |     sizeof(fenv_t) == sizeof(internal::FPState),
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:377:20: note: expression evaluates to '28 == 32'
  377 |     sizeof(fenv_t) == sizeof(internal::FPState),
      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

full log: https://llvm-jenkins.debian.net/job/llvm-toolchain-binaries/architecture=i386,distribution=unstable,label=i386/2194/console
Regression range: 9a4c5a5..dd7a3d4

@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/issue-subscribers-libc

Author: Sylvestre Ledru (sylvestre)

``` FAILED: projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o /opt/sccache//sccache /build/source/build-llvm/bin/clang++ -DLIBC_COPT_ARRAY_ARG_LIST -DLIBC_COPT_MEMCPY_USE_EMBEDDED_TINY -DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE -DLIBC_COPT_PRINTF_DISABLE_STRERROR -DLIBC_COPT_PRINTF_DISABLE_WRITE_INT -DLIBC_COPT_USE_C_ASSERT -DLIBC_NAMESPACE=__llvm_libc_20_0_0_ -DLIBC_TYPES_LONG_DOUBLE_IS_FLOAT64 -I/build/source/build-llvm/tools/clang/stage2-bins/projects/libc/utils/gpu/server -I/build/source/libc/utils/gpu/server -I/build/source/libc -I/build/source/libc/include -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=../../../../ -ffile-prefix-map=/build/source/= -no-canonical-prefixes -O2 -DNDEBUG -g1 -std=c++17 -MD -MT projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o -MF projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o.d -o projects/libc/utils/gpu/server/CMakeFiles/llvmlibc_rpc_server.dir/build/source/libc/src/stdio/printf_core/converter.cpp.o -c /build/source/libc/src/stdio/printf_core/converter.cpp In file included from /build/source/libc/src/stdio/printf_core/converter.cpp:20: In file included from /build/source/libc/src/stdio/printf_core/converter_atlas.h:29: In file included from /build/source/libc/src/stdio/printf_core/float_dec_converter.h:17: In file included from /build/source/libc/src/__support/float_to_string.h:17: In file included from /build/source/libc/src/__support/FPUtil/dyadic_float.h:12: In file included from /build/source/libc/src/__support/FPUtil/FEnvImpl.h:31: /build/source/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:377:5: error: static assertion failed due to requirement 'sizeof(fenv_t) == sizeof(__llvm_libc_20_0_0_::fputil::internal::FPState)': Internal floating point state does not match the public fenv_t type. 377 | sizeof(fenv_t) == sizeof(internal::FPState), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /build/source/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:377:20: note: expression evaluates to '28 == 32' 377 | sizeof(fenv_t) == sizeof(internal::FPState), | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ```

full log: https://llvm-jenkins.debian.net/job/llvm-toolchain-binaries/architecture=i386,distribution=unstable,label=i386/2194/console
Regression range: 9a4c5a5..dd7a3d4

@sylvestre
Copy link
Collaborator Author

@nickdesaulniers rings a bell ?

@michaelrj-google
Copy link
Contributor

Since this is a GPU build @jhuber6 is more likely to have information.

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 7, 2024

Yeah, this seems to just be a lack of support for this target on the CPU side so when it gets included to build the server it freaks out. probably just need a few tweaks to make it work correctly.

@nickdesaulniers
Copy link
Member

We also don't yet fully support i386 for llvm-libc. I have a patch series to do that, but finishing the port has been deprioritized (by me). I recommend @sylvestre disable the llvm-libc build on i386 for now.

@sylvestre
Copy link
Collaborator Author

@nickdesaulniers i could not find the list of supported archs in the doc. Is there something?
thanks

@nickdesaulniers
Copy link
Member

@lntue
Copy link
Contributor

lntue commented Dec 16, 2024

A temporary workaround while waiting for @nickdesaulniers 's i386 proper support is to replace LIBC_TARGET_ARCH_IS_X86 in https://github.com/llvm/llvm-project/blob/main/libc/src/__support/FPUtil/FEnvImpl.h#L30 with LIBC_TARGET_ARCH_IS_X86_64.

nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Dec 16, 2024
Creates a new toctree "Support" under which we have distinct links to arch,
platform, and compiler support.

* Moved "Platform Support" from index landing page to new doc.
* Created explicit "Architecture Support". Requested in
  llvm#118964 (comment).
* Moved "Compiler Support" from Status toctree to new Support toctree.
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Dec 16, 2024
Creates a new toctree "Support" under which we have distinct links to arch,
platform, and compiler support.

* Moved "Platform Support" from index landing page to new doc.
* Created explicit "Architecture Support". Requested in
  llvm#118964 (comment).
* Moved "Compiler Support" from Status toctree to new Support toctree.
nickdesaulniers added a commit that referenced this issue Dec 16, 2024
Creates a new toctree "Support" under which we have distinct links to arch,
platform, and compiler support.

* Moved "Platform Support" from index landing page to new doc.
* Created explicit "Architecture Support". Requested in #118964 (comment).
* Moved "Compiler Support" from Status toctree to new Support toctree.

---------

Co-authored-by: Carlo Cabrera <github@carlo.cab>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants