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

[boost-context] build failure on unified builds #25294

Closed
simtind opened this issue Jun 17, 2022 · 0 comments · Fixed by #25299
Closed

[boost-context] build failure on unified builds #25294

simtind opened this issue Jun 17, 2022 · 0 comments · Fixed by #25299
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team.

Comments

@simtind
Copy link
Contributor

simtind commented Jun 17, 2022

Host Environment

  • OS: Mac OS 11.6
  • Compiler: XCode 12.4

To Reproduce
With the following triplet available as arm64-x64-osx:

# Creates unified MacOS binaries supporting both Arm64 and Intel X64 processors.
set(VCPKG_TARGET_ARCHITECTURE x86_64 arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64 arm64)

Execute
./vcpkg install boost-context:arm64-x64-osx

Failure logs
From a manifest install that includes boost-context:


Installing 21/21 boost-context:arm64-x64-osx...
Building boost-context[core]:arm64-x64-osx...
-- [OVERLAY] Loading triplet configuration from: /opt/vcpkg_git/vcpkg-overlay-ports/triplets/arm64-x64-osx.cmake
-- Using cached boostorg-context-boost-1.79.0.tar.gz.
-- Cleaning sources at /Users/buran_ci/vcpkg/buildtrees/boost-context/src/ost-1.79.0-c7ed8111f4.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /Users/buran_ci/vcpkg/downloads/boostorg-context-boost-1.79.0.tar.gz
-- Using source at /Users/buran_ci/vcpkg/buildtrees/boost-context/src/ost-1.79.0-c7ed8111f4.clean
-- Including /Users/buran_ci/vcpkg/buildtrees/boost-context/vcpkg-b2-options.cmake
-- Found external ninja('1.10.2').
-- Getting CMake variables for arm64-x64-osx-dbg
-- Getting CMake variables for arm64-x64-osx-rel
-- Configuring arm64-x64-osx-dbg
-- Configuring arm64-x64-osx-rel
-- Building arm64-x64-osx-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:129 (message):
    Command failed: /Users/buran_ci/vcpkg/downloads/tools/cmake-3.22.2-osx/cmake-3.22.2-macos-universal/CMake.app/Contents/bin/cmake --build . --config Debug --target install -- -v -j9
    Working Directory: /Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg
    See logs for more information:
      /Users/buran_ci/vcpkg/buildtrees/boost-context/install-arm64-x64-osx-dbg-out.log

Call Stack (most recent call first):
  installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/arm64-osx/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  installed/arm64-osx/share/boost-build/boost-modular-build.cmake:136 (vcpkg_cmake_install)
  ports/boost-context/portfile.cmake:22 (boost_modular_build)
  scripts/ports.cmake:146 (include)


error: building boost-context:arm64-x64-osx failed with: BUILD_FAILED
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+boost-context
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[boost-context]+Build+error
Include '[boost-context] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-06-15-b0f08e40f8e8752dd0b260138ee078bd9599559c
    vcpkg-scripts version: 3d8f78171 2022-06-15 (12 hours ago)

You can also use the prefilled template from /Users/buran_ci/vcpkg/installed/vcpkg/issue_body.md.

cat /Users/buran_ci/vcpkg/buildtrees/boost-context/install-arm64-x64-osx-dbg-out.log
[1/2] cd /Users/buran_ci/vcpkg/buildtrees/boost-context/src/ost-1.79.0-c7ed8111f4.clean/build && /Users/buran_ci/vcpkg/installed/arm64-osx/tools/boost-build/b2 toolset=clang --user-config=/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/user-config.jam --stagedir=/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/stage --build-dir=/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg runtime-link=shared link=static address-model=64 architecture=x86 target-os=darwin threadapi=pthread variant=debug --layout=system -sICU_PATH="ICU_PATH-NOTFOUND" abi=sysv binary-format=mach-o --with-atomic --with-random --with-date_time --with-filesystem --with-system --with-thread --with-chrono -j8 -sBOOST_ROOT=/Users/buran_ci/vcpkg/installed/arm64-osx/tools/boost-build -sBOOST_BUILD_PATH=/Users/buran_ci/vcpkg/installed/arm64-osx/tools/boost-build --debug-configuration --debug-building --debug-generators --ignore-site-config --hash -q debug-symbols=on -d +2 threading=multi stage

...


    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" -x assembler-with-cpp -fPIC -g -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk" -arch x86_64 -arch arm64 -D_DARWIN_C_SOURCE -m64 -O0 -fno-inline -Wall -g  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -I"../include" -I"/Users/buran_ci/vcpkg/installed/arm64-x64-osx/include" -c -o "/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/boost/build/c6e7fa824b7fcb2640207cf1bd4ce369/asm/ontop_x86_64_sysv_macho_gas.o" "../src/asm/ontop_x86_64_sysv_macho_gas.S"

../src/asm/ontop_x86_64_sysv_macho_gas.S:32:10: error: unknown token in expression
    movq %rdx, %r8
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:32:10: error: invalid operand
    movq %rdx, %r8
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:34:15: error: unexpected token in argument list
    leaq -0x38(%rsp), %rsp
              ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:37:14: error: unknown token in expression
    stmxcsr (%rsp)
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:37:13: error: invalid operand
    stmxcsr (%rsp)
            ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:38:15: error: unexpected token in argument list
    fnstcw 0x4(%rsp)
              ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:41:10: error: unknown token in expression
    movq %r12, 0x8(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:41:10: error: invalid operand
    movq %r12, 0x8(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:42:10: error: unknown token in expression
    movq %r13, 0x10(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:42:10: error: invalid operand
    movq %r13, 0x10(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:43:10: error: unknown token in expression
    movq %r14, 0x18(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:43:10: error: invalid operand
    movq %r14, 0x18(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:44:10: error: unknown token in expression
    movq %r15, 0x20(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:44:10: error: invalid operand
    movq %r15, 0x20(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:45:10: error: unknown token in expression
    movq %rbx, 0x28(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:45:10: error: invalid operand
    movq %rbx, 0x28(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:46:10: error: unknown token in expression
    movq %rbp, 0x30(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:46:10: error: invalid operand
    movq %rbp, 0x30(%rsp)
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:49:10: error: unknown token in expression
    movq %rsp, %rax
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:49:10: error: invalid operand
    movq %rsp, %rax
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:52:10: error: unknown token in expression
    movq %rdi, %rsp
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:52:10: error: invalid operand
    movq %rdi, %rsp
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:55:14: error: unknown token in expression
    ldmxcsr (%rsp)
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:55:13: error: invalid operand
    ldmxcsr (%rsp)
            ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:56:14: error: unexpected token in argument list
    fldcw 0x4(%rsp)
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:59:13: error: unexpected token in argument list
    movq 0x8(%rsp), %r12
            ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:60:14: error: unexpected token in argument list
    movq 0x10(%rsp), %r13
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:61:14: error: unexpected token in argument list
    movq 0x18(%rsp), %r14
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:62:14: error: unexpected token in argument list
    movq 0x20(%rsp), %r15
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:63:14: error: unexpected token in argument list
    movq 0x28(%rsp), %rbx
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:64:14: error: unexpected token in argument list
    movq 0x30(%rsp), %rbp
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:66:14: error: unexpected token in argument list
    leaq 0x38(%rsp), %rsp
             ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:70:10: error: unknown token in expression
    movq %rsi, %rdx
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:70:10: error: invalid operand
    movq %rsi, %rdx
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:73:10: error: unknown token in expression
    movq %rax, %rdi
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:73:10: error: invalid operand
    movq %rax, %rdi
         ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:78:9: error: unknown token in expression
    jmp *%r8
        ^
../src/asm/ontop_x86_64_sysv_macho_gas.S:78:9: error: invalid operand
    jmp *%r8
        ^
clang-darwin.compile.asm /Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/boost/build/c6e7fa824b7fcb2640207cf1bd4ce369/asm/make_x86_64_sysv_macho_gas.o

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" -x assembler-with-cpp -fPIC -g -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk" -arch x86_64 -arch arm64 -D_DARWIN_C_SOURCE -m64 -O0 -fno-inline -Wall -g  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -I"../include" -I"/Users/buran_ci/vcpkg/installed/arm64-x64-osx/include" -c -o "/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/boost/build/c6e7fa824b7fcb2640207cf1bd4ce369/asm/make_x86_64_sysv_macho_gas.o" "../src/asm/make_x86_64_sysv_macho_gas.S"

../src/asm/make_x86_64_sysv_macho_gas.S:32:10: error: unknown token in expression
    movq %rdi, %rax
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:32:10: error: invalid operand
    movq %rdi, %rax
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:35:10: error: invalid token in expression
    andq $-16, %rax
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:35:10: error: invalid operand
    andq $-16, %rax
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:39:15: error: unexpected token in argument list
    leaq -0x40(%rax), %rax
              ^
../src/asm/make_x86_64_sysv_macho_gas.S:43:10: error: unknown token in expression
    movq %rdx, 0x28(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:43:10: error: invalid operand
    movq %rdx, 0x28(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:46:14: error: unknown token in expression
    stmxcsr (%rax)
             ^
../src/asm/make_x86_64_sysv_macho_gas.S:46:13: error: invalid operand
    stmxcsr (%rax)
            ^
../src/asm/make_x86_64_sysv_macho_gas.S:48:15: error: unexpected token in argument list
    fnstcw 0x4(%rax)
              ^
../src/asm/make_x86_64_sysv_macho_gas.S:51:20: error: unexpected token in argument list
    leaq trampoline(%rip), %rcx
                   ^
../src/asm/make_x86_64_sysv_macho_gas.S:54:10: error: unknown token in expression
    movq %rcx, 0x38(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:54:10: error: invalid operand
    movq %rcx, 0x38(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:57:16: error: unexpected token in argument list
    leaq finish(%rip), %rcx
               ^
../src/asm/make_x86_64_sysv_macho_gas.S:60:10: error: unknown token in expression
    movq %rcx, 0x30(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:60:10: error: invalid operand
    movq %rcx, 0x30(%rax)
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:67:10: error: unknown token in expression
    push %rbp
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:67:10: error: invalid operand
    push %rbp
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:69:9: error: unknown token in expression
    jmp *%rbx
        ^
../src/asm/make_x86_64_sysv_macho_gas.S:69:9: error: invalid operand
    jmp *%rbx
        ^
../src/asm/make_x86_64_sysv_macho_gas.S:73:10: error: unknown token in expression
    xorq %rdi, %rdi
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:73:10: error: invalid operand
    xorq %rdi, %rdi
         ^
../src/asm/make_x86_64_sysv_macho_gas.S:75:5: error: unrecognized instruction mnemonic, did you mean: casl?
    call __exit
    ^
../src/asm/make_x86_64_sysv_macho_gas.S:76:5: error: too few operands for instruction
    hlt
    ^~~
clang-darwin.compile.c++ /Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/boost/build/c6e7fa824b7fcb2640207cf1bd4ce369/posix/stack_traits.o

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" -x c++ -fPIC -g -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk" -arch x86_64 -arch arm64 -std=c++11 -D_DARWIN_C_SOURCE -m64 -O0 -fno-inline -Wall -g  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -I"../include" -I"/Users/buran_ci/vcpkg/installed/arm64-x64-osx/include"  -c -o "/Users/buran_ci/vcpkg/buildtrees/boost-context/arm64-x64-osx-dbg/boost/build/c6e7fa824b7fcb2640207cf1bd4ce369/posix/stack_traits.o" "../src/posix/stack_traits.cpp"

...failed updating 2 targets...
ninja: build stopped: subcommand failed.

Additional context
Boost-build expects architecture=x86+arm64 to be set when compiling for unified binaries. Instead, vcpkg sets architeture=x86, and adds compile flags -arch x86 -arch arm64. Looks like this causes the x86 assembly files to be compiled for arm64.

simtind pushed a commit to simtind/vcpkg that referenced this issue Jun 17, 2022
@JonLiu1993 JonLiu1993 added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Jun 20, 2022
dan-shaw pushed a commit that referenced this issue Jun 23, 2022
…) (#25299)

* [boost-modular-build-helper] Support boost architecture arm+x86 (#25294)

* [boost-modular-build-helper] Update port version (#25294)

* [boost-modular-build-helper] Update boost dual architecture check (#25294)

* [boost-modular-build-helper] Update port version references(#25294)

Co-authored-by: Simen August Tinderholt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants