[PATCH] D68177: compiler-rt: move all __GLIBC_PREREQ into own header file

Hal Gentz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 01:29:23 PDT 2019


ZeGentzy requested changes to this revision.
ZeGentzy added a comment.
This revision now requires changes to proceed.

Hello folks!

After an hour and a half of git bisecting, this commit appears to have broken my 32-bit LLVM builds.

  ==> Starting build()...
  -- clang project is enabled
  -- clang-tools-extra project is disabled
  -- compiler-rt project is enabled
  -- debuginfo-tests project is disabled
  -- libclc project is disabled
  -- libcxx project is disabled
  -- libcxxabi project is disabled
  -- libunwind project is disabled
  -- lld project is disabled
  -- lldb project is disabled
  -- llgo project is disabled
  -- openmp project is disabled
  -- parallel-libs project is disabled
  -- polly project is disabled
  -- pstl project is disabled
  -- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
  -- Native target architecture is X86
  -- Threads enabled.
  -- Doxygen disabled.
  -- Go bindings disabled.
  -- Ninja version: 1.9.0
  -- OCaml bindings disabled.
  -- LLVM host triple: x86_64-pc-linux-gnu
  -- LLVM default target triple: i686-pc-linux-gnu
  -- Building with -fPIC
  -- Constructing LLVMBuild project information
  -- Linker detection: LLD
  -- Targeting AMDGPU
  -- Targeting X86
  -- Compiler-RT supported architectures: x86_64;i386
  -- Builtin supported architectures: i386;x86_64
  -- Linker detection: LLD
  -- Linker detection: LLD
  -- Builtin supported architectures: i386;x86_64
  -- Generated Sanitizer SUPPORTED_TOOLS list on "Linux" is "asan;lsan;msan;tsan;ubsan"
  -- sanitizer_common tests on "Linux" will run against "asan;lsan;msan;tsan;ubsan"
  -- check-shadowcallstack does nothing.
  -- Clang version: 10.0.0
  -- Version: 0.0.0
  -- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile
  -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
  -- Performing Test HAVE_POSIX_REGEX -- success
  -- Performing Test HAVE_STEADY_CLOCK -- success
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /build/llvm-git-gentz/src/_build32_final
  [1/2530] Generating VCSRevision.h
  -- Found Git: /usr/bin/git (found version "2.23.0") 
  [2/2530] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o
  FAILED: projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o 
  CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++  -DHAVE_RPC_XDR_H=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/sanitizer_common -I/build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common -I/usr/include/libxml2 -Iinclude -I/build/llvm-git-gentz/src/llvm-project32/llvm/include -I/build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/.. -O3 -pipe -ffast-math -funroll-loops -fstack-protector-strong -fno-plt -m32 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++14 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -std=c++14 -Wno-unused-parameter -O3 -DNDEBUG    -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o -MF projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o.d -o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cpp.o -c /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1016:1: error: 'assertion_failed__1016' declared as an array with a negative size
  CHECK_SIZE_AND_OFFSET(dirent, d_ino);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1438:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
    COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
  #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
      typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                          ^~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1022:1: error: 'assertion_failed__1022' declared as an array with a negative size
  CHECK_SIZE_AND_OFFSET(dirent, d_off);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1438:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
    COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
  #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
      typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                          ^~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1022:1: error: 'assertion_failed__1022' declared as an array with a negative size
  CHECK_SIZE_AND_OFFSET(dirent, d_off);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1440:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
    COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==         \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
  #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
      typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                          ^~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1024:1: error: 'assertion_failed__1024' declared as an array with a negative size
  CHECK_SIZE_AND_OFFSET(dirent, d_reclen);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1440:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
    COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==         \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
  #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /build/llvm-git-gentz/src/llvm-project32/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
      typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                          ^~~~~~~~~~~~~~~
  4 errors generated.
  [3/2530] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_tls_get_addr.cpp.o
  [4/2530] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.i386.dir/sanitizer_stacktrace_printer.cpp.o
  [5/2530] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.i386.dir/sanitizer_stacktrace_libcdep.cpp.o

I'm using this PKGBUILD: https://github.com/ZeGentzy/aur-buildscripts/blob/master/llvm-git-gentz/PKGBUILD#L376

I'm building with the following:

  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
  export CFLAGS="$CFLAGS -m32"
  export CXXFLAGS="$CXXFLAGS -m32"
  export LDFLAGS="$LDFLAGS -m32"
  
  cmake /build/llvm-git-gentz/src/llvm-project32/llvm -G Ninja \
      -D CMAKE_BUILD_TYPE="Release" \
      -D LLVM_DEFAULT_TARGET_TRIPLE="i686-pc-linux-gnu" \
      -D LLVM_LIBDIR_SUFFIX=32 \
      -D LLVM_TARGET_ARCH:STRING=i686 \
      -D LLVM_CONFIG="/usr/bin/llvm-config32" \
      -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
      -D LLVM_ENABLE_BINDINGS=OFF \
      -D PYTHON_EXECUTABLE=/usr/bin/python-32 \
      -D CMAKE_CXX_COMPILER="/usr/bin/clang++" \
      -D CMAKE_C_COMPILER="/usr/bin/clang" \
      -D LLVM_USE_LINKER="/usr/bin/ld.lld" \
      -D CMAKE_RANLIB="/usr/bin/llvm-ranlib" \
      -D CMAKE_AR="/usr/bin/llvm-ar" \
      -D LLVM_ENABLE_LTO=OFF \
      -D LLVM_BUILD_LLVM_DYLIB=ON \
      -D LLVM_LINK_LLVM_DYLIB=ON \
      -D LLVM_ENABLE_PROJECTS="clang;compiler-rt;lld;lldb;clang-tools-extra" \
      -D LLVM_APPEND_VC_REV=ON \
      -D LLVM_HOST_TRIPLE="x86_64-pc-linux-gnu" \
      -D LLVM_ENABLE_RTTI=ON \
      -D LLVM_ENABLE_FFI=ON \
      -D FFI_INCLUDE_DIR="/usr/lib32/libffi-3.2.1/include" \
      -D LLVM_BUILD_TESTS=ON \
      -D LLVM_VERSION_SUFFIX= \
      -D CMAKE_POLICY_DEFAULT_CMP0075=NEW \
      -D LLVM_OPTIMIZED_TABLEGEN=ON \
      -D LLVM_CCACHE_BUILD=ON \
      -D CMAKE_POLICY_DEFAULT_CMP0075=NEW \
      -D CMAKE_C_FLAGS="-O3 -pipe -ffast-math -funroll-loops -fstack-protector-strong -fno-plt -m32" \
      -D CMAKE_CXX_FLAGS="-O3 -pipe -ffast-math -funroll-loops -fstack-protector-strong -fno-plt -m32" \
      -D LLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
      -D LLVM_BINUTILS_INCDIR=/usr/include \
      -D LLVM_EXTERNAL_LIT="/usr/bin/lit" \
      -D LLVM_BUILD_DOCS=OFF \
      -D LLVM_INCLUDE_DOCS=OFF \
      -D LLVM_ENABLE_SPHINX=OFF \
      -D LLVM_ENABLE_DOXYGEN=OFF \
      -D LLVM_INSTALL_UTILS=ON \
      -D LLVM_PARALLEL_LINK_JOBS=1 \
      -D CMAKE_INSTALL_PREFIX="/opt/llvm32"
  ninja -j4 all
  DESTDIR=/build/llvm-git-gentz/pkg/lib32-llvm-git-gentz ninja -j4 install

@vitalybuka Could you please revisit this revision so that it doesn't break 32-bit builds and revert this revision until then?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D68177





More information about the llvm-commits mailing list