Skip to content

Conversation

hjyamauchi
Copy link

Disable the LSE files if COMPILER_RT_HAS_ASM_LSE failed as MSVC cannot seem to handle .S input files.

[258/401] Building ASM object CMakeFiles\clang_rt.builtins-aarch64.dir\outline_atomic_helpers.dir\outline_atomic_cas1_3.S.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33135 for ARM64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9024 : unrecognized source file type 'S:\b\5\runtimes\builtins-aarch64-unknown-windows-msvc-bins\outline_atomic_helpers.dir\outline_atomic_cas1_3.S', object file assumed
cl : Command line warning D9027 : source file 'S:\b\5\runtimes\builtins-aarch64-unknown-windows-msvc-bins\outline_atomic_helpers.dir\outline_atomic_cas1_3.S' ignored
cl : Command line warning D9021 : no action performed

Disable the LSE files if COMPILER_RT_HAS_ASM_LSE failed as MSVC cannot
seem to handle .S input files.

```
[258/401] Building ASM object CMakeFiles\clang_rt.builtins-aarch64.dir\outline_atomic_helpers.dir\outline_atomic_cas1_3.S.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33135 for ARM64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9024 : unrecognized source file type 'S:\b\5\runtimes\builtins-aarch64-unknown-windows-msvc-bins\outline_atomic_helpers.dir\outline_atomic_cas1_3.S', object file assumed
cl : Command line warning D9027 : source file 'S:\b\5\runtimes\builtins-aarch64-unknown-windows-msvc-bins\outline_atomic_helpers.dir\outline_atomic_cas1_3.S' ignored
cl : Command line warning D9021 : no action performed
```
@hjyamauchi
Copy link
Author

@hjyamauchi
Copy link
Author

@swift-ci please test

@hjyamauchi
Copy link
Author

@compnerd This should fix the arm64 rebranch issue

@hjyamauchi
Copy link
Author

Upstream PR: #9394

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not work - the condition should be true, but the problem is that the Microsoft ASM compiler uses a different syntax and they don't usually do CPP+ASM so it won't process the file correctly.

@hjyamauchi
Copy link
Author

hjyamauchi commented Oct 8, 2024

In my local build and the CI, the condition is false when MSVC is used and this seems to work. The CI will tell us?

-- The C compiler identification is MSVC 19.39.33523.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/arm64/cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/arm64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for unwind.h
-- Looking for unwind.h - not found
-- Looking for rpc/xdr.h
-- Looking for rpc/xdr.h - not found
CMake Warning at C:/Users/swift-ci/jenkins/workspace/swift-rebranch-windows-toolchain-arm64/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:290 (message):
  LLVM_CONFIG_PATH is deprecated, please use LLVM_CMAKE_DIR instead
Call Stack (most recent call first):
  CMakeLists.txt:29 (load_llvm_config)


CMake Warning at C:/Users/swift-ci/jenkins/workspace/swift-rebranch-windows-toolchain-arm64/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:335 (message):
  LLVMTestingSupport not found in LLVM_AVAILABLE_LIBS
Call Stack (most recent call first):
  CMakeLists.txt:29 (load_llvm_config)


-- LLVM_MAIN_SRC_DIR: "C:/Users/swift-ci/jenkins/workspace/swift-rebranch-windows-toolchain-arm64/llvm-project/llvm"
-- cmake c compiler target: aarch64-unknown-windows-msvc
-- Performing Test COMPILER_RT_HAS_FPIC_FLAG
-- Performing Test COMPILER_RT_HAS_FPIC_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FPIE_FLAG
-- Performing Test COMPILER_RT_HAS_FPIE_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG
-- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_STD_C11_FLAG
-- Performing Test COMPILER_RT_HAS_STD_C11_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG
-- Performing Test COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG
-- Performing Test COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FFREESTANDING_FLAG
-- Performing Test COMPILER_RT_HAS_FFREESTANDING_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_XRAY_COMPILER_FLAG
-- Performing Test COMPILER_RT_HAS_XRAY_COMPILER_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FNO_LTO_FLAG
-- Performing Test COMPILER_RT_HAS_FNO_LTO_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_GENERATE_FLAG
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_GENERATE_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG
-- Performing Test COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_WNO_PEDANTIC
-- Performing Test COMPILER_RT_HAS_WNO_PEDANTIC - Failed
-- Performing Test COMPILER_RT_HAS_NOGPULIB_FLAG
-- Performing Test COMPILER_RT_HAS_NOGPULIB_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FLTO_FLAG
-- Performing Test COMPILER_RT_HAS_FLTO_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG
-- Performing Test COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG
-- Performing Test COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG
-- Performing Test COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_ZL_FLAG
-- Performing Test COMPILER_RT_HAS_ZL_FLAG - Failed
-- Performing Test COMPILER_RT_HAS_ATOMIC_KEYWORD
-- Performing Test COMPILER_RT_HAS_ATOMIC_KEYWORD - Failed
-- Performing Test COMPILER_RT_HAS_ASM_LSE
-- Performing Test COMPILER_RT_HAS_ASM_LSE - Failed
-- Performing Test COMPILER_RT_HAS_AARCH64_SME
-- Performing Test COMPILER_RT_HAS_AARCH64_SME - Failed
-- Looking for include file sys/auxv.h
-- Looking for include file sys/auxv.h - not found
-- Builtin supported architectures: aarch64
-- Performing additional configure checks with target flags: 
-- Performing Test COMPILER_RT_HAS_aarch64_FLOAT16
-- Performing Test COMPILER_RT_HAS_aarch64_FLOAT16 - Failed
-- Performing Test COMPILER_RT_HAS_aarch64_BFLOAT16
-- Performing Test COMPILER_RT_HAS_aarch64_BFLOAT16 - Failed
-- For aarch64 builtins preferring aarch64/fp_mode.c to fp_mode.c
-- Configuring done (7.8s)
-- Generating done (0.4s)
-- Build files have been written to: T:/5/runtimes/builtins-aarch64-unknown-windows-msvc-bins

https://ci-external.swift.org/job/swift-rebranch-windows-toolchain-arm64/442/consoleText

@bnbarham
Copy link

bnbarham commented Oct 8, 2024

Hmm, from what I could tell from the logs it was enabled - see #9391. Or at least it is sometimes? I suppose the last before the failure is Performing Test COMPILER_RT_HAS_ASM_LSE - Failed. But there's also a few Performing Test COMPILER_RT_HAS_ASM_LSE - Success before that. I don't really mind which we take here, whichever works 😅I'm happy to take yours and see if it fixes things (especially if you tried locally, which I did not).

@hjyamauchi
Copy link
Author

@swift-ci please test Windows Platform

@hjyamauchi
Copy link
Author

@swift-ci please test macOS Platform

@hjyamauchi
Copy link
Author

hjyamauchi commented Oct 8, 2024

@bnbarham Yes, I locally reproduced the LSE error and confirmed a successful build with this patch. I think #9391 should work as well as I tried a similar one locally and it worked.
I don't care which fix, either. I'd say please go ahead and merge #9391 as the CI already passed on it. CC @compnerd

@bnbarham
Copy link

bnbarham commented Oct 8, 2024

Okay, merging that one then 🙇‍♂️

@hjyamauchi
Copy link
Author

@bnbarham I think #9391 fixed the issue.

I think the next issue with swift-rebranch-windows-toolchain-arm64 is errors like:

    6>C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain-arm64\swift-installer-scripts\platforms\Windows\shared\shared.wxs(143): error WIX0108: The UpgradeVersion/@Minimum attribute's value, 'null.65535', is not a valid version. Specify a four-part version or semantic version, such as '#.#.#.#' or '#.#.#-label.#'. [C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain-arm64\swift-installer-scripts\platforms\Windows\shared\shared.wixproj]

I think this may indicate that the ProductVersion in the build.ps1 command needs to be set to something like 0.0.0 (like swift-main-windows-toolchain-arm64), as opposed to null.

https://ci-external.swift.org/job/swift-rebranch-windows-toolchain-arm64/449/consoleText

wift-ci@EC2AMAZ-JCVOGM7 C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain-arm64>powershell.exe -ExecutionPolicy RemoteSigned -File C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain-arm64\swift\utils\build.ps1             -HostArchName ARM64             -SourceCache C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain-arm64             -BinaryCache T:             -ImageRoot T:             -ProductVersion null                           -Stage T:\artifacts   || (exit /b 1 ) 

https://ci-external.swift.org/job/swift-main-windows-toolchain-arm64/598/consoleText

wift-ci@EC2AMAZ-JCVOGM7 C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain-arm64>powershell.exe -ExecutionPolicy RemoteSigned -File C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain-arm64\swift\utils\build.ps1             -HostArchName ARM64             -SourceCache C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain-arm64             -BinaryCache T:             -ImageRoot T:             -ProductVersion 6.0.0                           -Stage T:\artifacts   || (exit /b 1 )

@shahmishal Would you mind setting the ProductVersion flag to 0.0.0 or 6.0.0 in swift-rebranch-windows-toolchain-arm64 like swift-main-windows-toolchain-arm64? CC @compnerd

@hjyamauchi hjyamauchi closed this Oct 10, 2024
@bnbarham
Copy link

Thanks @hjyamauchi! @shahmishal has already fixed that one, hopefully the next build passes.

@hjyamauchi
Copy link
Author

@bnbarham I see that now it's green. TY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants