Skip to content

V8 gets incorrect compiler and/or arguments when cross compiling macOS x86_64 -> arm64 #40350

Closed
@djmarcin

Description

@djmarcin

Version

16.10.0 source

Platform

Darwin mbp.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Subsystem

v8

What steps will reproduce the bug?

check out 16.10.0 sources

CC_host="ccache clang" CXX_host="ccache clang++" \
  CC_target="ccache clang -arch arm64" CXX_target="ccache clang++ -arch arm64" \
  CC="ccache clang -arch arm64" CXX="ccache clang++ -arch arm64" \
  ./configure --dest-cpu=arm64
mkdir -p /tmp/node-install
make -j$(nproc) install V=0 DESTDIR=/tmp/node-install

Eventually:

../deps/v8/src/trap-handler/handler-inside-posix.cc:108:47: error: no member named '__pc' in '__darwin_x86_thread_state64'
    auto* context_ip = &uc->uc_mcontext->__ss.__pc;
                        ~~~~~~~~~~~~~~~~~~~~~ ^
1 error generated.

The command line for this compilation stage appears to be:

$CC_host ... '-DV8_TARGET_ARCH_ARM64' ...

Since $CC_host (x86_64) and the define (arm64) are mismatched, compilation produces the above error.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

The compiler and define should be matched properly and the compile should succeed.

What do you see instead?

compilation fails

Additional information

Offshoot of comment in #40302

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions