Skip to content

Installation issue: LLVM 19 does not compile with glibc-2.42 because of missing termio.h #5287

Description

@SimeonEhrig

Steps to reproduce the issue

Run on a Fedora 43 with glibc 2.42

# gcc 15 is the system compiler
$ spack install llvm@19 %gcc@15

ping @haampie @skosukhin @trws

Error message

Error message
[1716/2583] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o
FAILED: [code=1] compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o 
/var/tmp/simeon/spack-stage/spack-stage-llvm-19.1.7-ye6h7qvwaqtzpsio4pkxgtehnlxqffwm/spack-build-ye6h7qv/bin/clang++ --target=x86_64-unknown-linux-gnu -DHAVE_RPC_XDR_H=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/simeon/spack-stage/spack-stage-llvm-19.1.7-ye6h7qvwaqtzpsio4pkxgtehnlxqffwm/spack-src/compiler-rt/lib/sanitizer_common/.. --gcc-install-dir=/usr/lib/gcc/x86_64-redhat-linux/15 -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 -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 -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o -c /var/tmp/simeon/spack-stage/spack-stage-llvm-19.1.7-ye6h7qvwaqtzpsio4pkxgtehnlxqffwm/spack-src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
/var/tmp/simeon/spack-stage/spack-stage-llvm-19.1.7-ye6h7qvwaqtzpsio4pkxgtehnlxqffwm/spack-src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:483:31: error: invalid application of 'sizeof' to an incomplete type 'struct termio'
  483 |   unsigned struct_termio_sz = sizeof(struct termio);
      |                               ^     ~~~~~~~~~~~~~~~
/var/tmp/simeon/spack-stage/spack-stage-llvm-19.1.7-ye6h7qvwaqtzpsio4pkxgtehnlxqffwm/spack-src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:483:45: note: forward declaration of '__sanitizer::termio'
  483 |   unsigned struct_termio_sz = sizeof(struct termio);
      |                                             ^
1 error generated.

Information on your system

Fedora 43 with GCC 15.2 and glibc 2.42

Additional information

The bug is fixed in LLVM 20: llvm/llvm-project#137321
There is a workaround for the GCC package, which have the same problem: 9a7f32a

spack-build-out.txt

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions