-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
CustomMain NativeAot test doesn't support cross-arch compilation #82320
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsThe testcase added in #81873 doesn't currently work when cross-building tests from x64 for arm64. When I do a cross-build of the tests, this is the command-line that gets used to compile the native object: Notice the
which results in downstream errors later in the build:
|
Same issue for the SharedLibrary nativeaot test: This one fails not when building tests (since this just builds the shared library, and doesn't need to statically link it), but when running the:
And similar for the
|
Missing ROOTFS_DIR=/crossrootfs/arm64 ./src/tests/build.sh -cross -arm64 nativeaot Release test nativeaot/CustomMain/CustomMain.csproj ( |
btw, this define by itself is not the indicator of cross compilation. In the context of clang (as linker driver) command line, the argument for cross target to look for is |
Seems this was a user error - this now seems to work if I pass the right |
The testcase added in #81873 doesn't currently work when cross-building tests from x64 for arm64.
When I do a cross-build of the tests, this is the command-line that gets used to compile the native object:
cd /home/svbomer/src/runtime/artifacts/tests/coreclr/obj/linux.arm64.Release/Native/nativeaot/CustomMain && /usr/bin/clang++-15 -DDISABLE_CONTRACTS -DHOST_64BIT -DHOST_AMD64 -DHOST_UNIX -DNDEBUG -DTARGET_64BIT -DTARGET_AMD64 -DTARGET_LINUX -DTARGET_UNIX -DURTBLDENV_FRIENDLY=Retail -D_FILE_OFFSET_BITS=64 -I/home/svbomer/src/runtime/src/native -I/home/svbomer/src/runtime/src/tests/Common/Platform -O3 -DNDEBUG -fPIC -O3 -g -Wall -Wno-null-conversion -fno-omit-frame-pointer -fms-extensions -fwrapv -fstack-protector-strong -Werror -Wno-unused-variable -Wno-unused-value -Wno-unused-function -Wno-tautological-compare -Wno-unknown-pragmas -Wimplicit-fallthrough -Wno-invalid-offsetof -Wno-unused-but-set-variable -ffp-contract=off -fno-rtti -Wno-unknown-warning-option -ferror-limit=4096 -Wno-unused-private-field -Wno-constant-logical-operand -Wno-pragma-pack -Wno-incompatible-ms-struct -Wno-reserved-identifier -Wno-unsafe-buffer-usage -Wno-single-bit-bitfield-constant-conversion -Wno-cast-function-type-strict -fsigned-char -fvisibility=hidden -ffunction-sections -std=gnu++11 -MD -MT nativeaot/CustomMain/CMakeFiles/CustomMainNative.dir/CustomMainNative.cpp.o -MF CMakeFiles/CustomMainNative.dir/CustomMainNative.cpp.o.d -o CMakeFiles/CustomMainNative.dir/CustomMainNative.cpp.o -c /home/svbomer/src/runtime/src/tests/nativeaot/CustomMain/CustomMainNative.cpp
Notice the
-DTARGET_AMD64
. The test gets compiled for amd64 even though I am asking to build for arm64:which results in downstream errors later in the build:
The text was updated successfully, but these errors were encountered: