runtime: Build of coreclr fails with musl 1.2.3
Description
Build of coreclr fails with musl 1.2.3 due to following error:
[ 14%] Building C object Native.Unix/System.Security.Cryptography.Native/CMakeFiles/objlib.dir/pal_x509_root.c.o
/home/buildozer/aports/community/dotnet6-stage0/src/source-build-tarball-6.0.102/src/runtime.839cdfb0ecca5e0be3dbccd926e7651ef50fdf10/artifacts/source-build/self/src/src/coreclr/pal/src/init/pal.cpp:350:24: error: no matching function for call to 'InterlockedCompareExchangePointerT'
if(NULL != InterlockedCompareExchangePointer(&init_critsec, &temp_critsec, NULL))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildozer/aports/community/dotnet6-stage0/src/source-build-tarball-6.0.102/src/runtime.839cdfb0ecca5e0be3dbccd926e7651ef50fdf10/artifacts/source-build/self/src/src/coreclr/pal/src/include/pal/palinternal.h:727:43: note: expanded from macro 'InterlockedCompareExchangePointer'
#define InterlockedCompareExchangePointer InterlockedCompareExchangePointerT
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildozer/aports/community/dotnet6-stage0/src/source-build-tarball-6.0.102/src/runtime.839cdfb0ecca5e0be3dbccd926e7651ef50fdf10/artifacts/source-build/self/src/src/coreclr/pal/src/include/pal/palinternal.h:715:11: note: candidate function template not viable: no known conversion from 'nullptr_t' to 'int' for 3rd argument
inline T* InterlockedCompareExchangePointerT(
^
/home/buildozer/aports/community/dotnet6-stage0/src/source-build-tarball-6.0.102/src/runtime.839cdfb0ecca5e0be3dbccd926e7651ef50fdf10/artifacts/source-build/self/src/src/coreclr/pal/src/include/pal/palinternal.h:684:4: note: candidate template ignored: could not match 'T *' against 'nullptr_t'
T* InterlockedCompareExchangePointerT(
^
/home/buildozer/aports/community/dotnet6-stage0/src/source-build-tarball-6.0.102/src/runtime.839cdfb0ecca5e0be3dbccd926e7651ef50fdf10/artifacts/source-build/self/src/src/coreclr/pal/src/include/pal/palinternal.h:705:11: note: candidate template ignored: could not match 'T *' against 'nullptr_t'
inline T* InterlockedCompareExchangePointerT(
^
1 error generated.
Caused by the following change in musl: https://git.musl-libc.org/cgit/musl/commit?id=98e688a9da5e7b2925dda17a2d6820dddf1fb287
Reproduction Steps
- Setup Alpine Edge environment with musl 1.2.3.
- Attempt a build
Expected behavior
Build should pass, as with musl 1.2.2
Actual behavior
Failure, as described in description.
Regression?
No response
Known Workarounds
Removing the problematic commit from musl does the trick.
Configuration
Alpine Edge Musl 1.2.3 installer version 6.0.102 with runtime 6.0.2 (as problematic files havn’t changed between 6.0.2 and 6.0.3, this issue should exist with current version)
Other information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (10 by maintainers)
Commits related to this issue
- fix build for musl 1.2.3 (#67763) — committed to ayakael/runtime by ayakael 2 years ago
- fix build for musl 1.2.3 (#67763) — committed to ayakael/runtime by ayakael 2 years ago
- fix build for musl 1.2.3 (#67763) — committed to ayakael/runtime by ayakael 2 years ago
- backports #67763: fix build with musl 1.2.3 — committed to ayakael/runtime by ayakael 2 years ago
- fix build for musl 1.2.3 (#67763) (#67772) — committed to dotnet/runtime by ayakael 2 years ago
you are accidentally dropping an argument here
the fix is to change the
int
arguments tostd::nullptr_t
(ordecltype(nullptr)
); that way it will resolve the ambiguity and still allow taking both explicit NULL and nullptr constants