Skip to content

[flang] Add cmake error if building with clang-cl and MSVC 17.12 #120114

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

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

DavidTruby
Copy link
Member

A bug in the C++ library in MSVC 17.12 prevents clang-cl from being able to build flang with that library version. This bug is not present in 17.11 or earlier, nor in 17.13. This patch adds a cmake error telling the user to either upgrade or downgrade to avoid the bug.

A bug in the C++ library in MSVC 17.12 prevents clang-cl from being able
to build flang with that library version. This bug is not present in
17.11 or earlier, nor in 17.13. This patch adds a cmake error telling
the user to either upgrade or downgrade to avoid the bug.
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Dec 16, 2024
@DavidTruby
Copy link
Member Author

DavidTruby commented Dec 16, 2024

@h-vetinari I couldn't ping you for review on this for some reason but thought you might have some input on it

@h-vetinari
Copy link
Contributor

@h-vetinari I couldn't ping you for review on this for some reason but thought you might have some input on it

Thanks. While I'm not excited about this, it does sound like a reasonable thing to avoid predictably falling over later. Hopefully 17.13 is out soon, because we can't really do compiler roll-backs in the images provided for GHA and azure pipelines (to my knowledge at least).

@CaseyCarter
Copy link
Member

For posterity: The underlying MSVC problem is microsoft/STL#4959.

@DavidTruby DavidTruby merged commit 4c6e13f into llvm:main Dec 18, 2024
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 18, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building flang at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/17905

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
PASS: UBSan-MemorySanitizer-x86_64 :: TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp (93034 of 97063)
PASS: UBSan-Minimal-x86_64 :: TestCases/nullptr-and-nonzero-offset.c (93035 of 97063)
PASS: UBSan-MemorySanitizer-x86_64 :: TestCases/Pointer/nullptr-and-nonzero-offset-summary.cpp (93036 of 97063)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Float/cast-overflow.cpp (93037 of 97063)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/ImplicitConversion/integer-sign-change-summary.cpp (93038 of 97063)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp (93039 of 97063)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/ImplicitConversion/signed-integer-truncation-summary.cpp (93040 of 97063)
PASS: UBSan-MemorySanitizer-x86_64 :: TestCases/Pointer/align-assume-ignorelist.cpp (93041 of 97063)
PASS: UBSan-MemorySanitizer-x86_64 :: TestCases/TypeCheck/Function/function.cpp (93042 of 97063)
TIMEOUT: MLIR :: Examples/standalone/test.toy (93043 of 97063)
******************** TEST 'MLIR :: Examples/standalone/test.toy' FAILED ********************
Exit Code: 1
Timeout: Reached timeout of 60 seconds

Command Output (stdout):
--
# RUN: at line 1
"/etc/cmake/bin/cmake" "/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone" -G "Ninja"  -DCMAKE_CXX_COMPILER=/usr/bin/clang++  -DCMAKE_C_COMPILER=/usr/bin/clang   -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir  -DLLVM_USE_LINKER=lld  -DPython3_EXECUTABLE="/usr/bin/python3.10"
# executed command: /etc/cmake/bin/cmake /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld -DPython3_EXECUTABLE=/usr/bin/python3.10
# .---command stdout------------
# | -- The CXX compiler identification is Clang 16.0.6
# | -- The C compiler identification is Clang 16.0.6
# | -- Detecting CXX compiler ABI info
# | -- Detecting CXX compiler ABI info - done
# | -- Check for working CXX compiler: /usr/bin/clang++ - skipped
# | -- Detecting CXX compile features
# | -- Detecting CXX compile features - done
# | -- Detecting C compiler ABI info
# | -- Detecting C compiler ABI info - done
# | -- Check for working C compiler: /usr/bin/clang - skipped
# | -- Detecting C compile features
# | -- Detecting C compile features - done
# | -- Looking for histedit.h
# | -- Looking for histedit.h - found
# | -- Found LibEdit: /usr/include (found version "2.11") 
# | -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
# | -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13") 
# | -- Using MLIRConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir
# | -- Using LLVMConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/llvm
# | -- Linker detection: unknown
# | -- Performing Test LLVM_LIBSTDCXX_MIN
# | -- Performing Test LLVM_LIBSTDCXX_MIN - Success
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
# | -- Performing Test C_SUPPORTS_FPIC
# | -- Performing Test C_SUPPORTS_FPIC - Success
# | -- Performing Test CXX_SUPPORTS_FPIC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants