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

Cross-Compiling CoreCLR for ARM mfpu=vfpv4-d16 fails #113013

Open
hopix opened this issue Feb 28, 2025 · 6 comments
Open

Cross-Compiling CoreCLR for ARM mfpu=vfpv4-d16 fails #113013

hopix opened this issue Feb 28, 2025 · 6 comments

Comments

@hopix
Copy link

hopix commented Feb 28, 2025

Description

Cross-compiling .net 9 runtime for VFP Configuration ARM vfpv4-d16 (-mfpu=vfpv4-d16) fails.

Following doc at https://github.com/dotnet/runtime/blob/v9.0.2/docs/workflow/building/coreclr/cross-building.md#cross-compiling-coreclr-for-other-vfp-configurations

Reproduction Steps

Using build command line:

docker run --rm -v /home/devix/dotnet-build/runtime9:/runtime -w /runtime -e ROOTFS_DIR=/crossrootfs/arm
    mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-arm
    ./build.sh
    --subset clr+host.native+libs.native+Clr.Aot
    --os linux -runtimeFlavor CoreCLR --cross --arch arm
    --hostConfiguration Release --librariesConfiguration Release --runtimeConfiguration Release
    --verbosity detailed
    --cmakeargs -DCLR_ARM_FPU_CAPABILITY=0x3 --cmakeargs -DCLR_ARM_FPU_TYPE=vfpv4-d16

Expected behavior

Build should succeed.

Actual behavior

Build fails where 1st error in log is:
In file included from /runtime/src/native/external/zlib-ng/arch/arm/slide_hash_neon.c:12: /runtime/src/native/external/zlib-ng/arch/arm/neon_intrins.h:38:28: error: expected identifier or '(' 38 | static inline uint16x8x4_t vld1q_u16_x4(uint16_t const *a) {

It seems to wrongly compiling for NEON instead of vfpv4-d16.
And few lines above error I can see:
* NEON_ADLER32, Support NEON instructions in adler32, using "-mfpu=neon"

Regression?

Using this since .net 5, and I checked that clean compile still works in .net 8 branch.

Known Workarounds

None

Configuration

Version: .NET 9
Target architecture: ARM
Running build from WSL 2 Ubuntu with Docker Desktop.

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 28, 2025
Copy link
Contributor

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

@filipnavara
Copy link
Member

You can likely workaround it by changing this line:
https://github.com/dotnet/runtime/blob/main/src/native/external/zlib-ng/CMakeLists.txt#L104

The zlib-ng build includes some optimized code that's opportunistically enabled. .NET 8 and older didn't have the zlib-ng builds IIRC.

@hopix
Copy link
Author

hopix commented Feb 28, 2025

Build works ok, with workaround: option(WITH_NEON "Build with NEON intrinsics" OFF) . Thanks.

It would be great if you can make proper fix. Can you?

I am going to verify if runtime works on HW, but I first need to update to GLIBCXX_3.4.30 (from GLIBCXX_3.4.29) as .net9 requires.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

@MichalPetryka
Copy link
Contributor

It would be great if you can make proper fix. Can you?

I assume this should be fixed at the upstream repo.

@carlossanlop
Copy link
Member

@hopix would you like to propose a PR to fix it?

cc @jkoritzinsky

@carlossanlop carlossanlop removed the untriaged New issue has not been triaged by the area owner label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

5 participants