-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Haiku: Initial NativeAOT and Crossgen2 support #127431
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
base: main
Are you sure you want to change the base?
Changes from all commits
3aff3f3
9f000ec
ea0ecb3
2829aa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -65,6 +65,7 @@ The .NET Foundation licenses this file to you under the MIT license. | |||||||||||||||||
| <TargetTriple Condition="'$(CrossCompileArch)' != '' and '$(_IsAlpineExitCode)' != '0'">$(CrossCompileArch)-linux-$(CrossCompileAbi)</TargetTriple> | ||||||||||||||||||
| <TargetTriple Condition="'$(CrossCompileArch)' != '' and '$(_IsAlpineExitCode)' == '0'">$(CrossCompileArch)-alpine-linux-$(CrossCompileAbi)</TargetTriple> | ||||||||||||||||||
| <TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('freebsd')))">$(CrossCompileArch)-unknown-freebsd12</TargetTriple> | ||||||||||||||||||
| <TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('haiku')))">$(CrossCompileArch)-unknown-haiku</TargetTriple> | ||||||||||||||||||
|
|
||||||||||||||||||
| <SharedLibraryInstallName Condition="'$(SharedLibraryInstallName)' == '' and '$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">@rpath/$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt)</SharedLibraryInstallName> | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -222,17 +223,19 @@ The .NET Foundation licenses this file to you under the MIT license. | |||||||||||||||||
|
|
||||||||||||||||||
| <ItemGroup> | ||||||||||||||||||
| <NativeSystemLibrary Include="stdc++" Condition="'$(LinkStandardCPlusPlusLibrary)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="dl" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="dl" Condition="'$(_targetOS)' != 'haiku'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="objc" Condition="'$(_IsApplePlatform)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="swiftCore" Condition="'$(_IsApplePlatform)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="swiftFoundation" Condition="'$(_IsApplePlatform)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="z" Condition="'$(UseSystemZlib)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="brotlienc;brotlidec;brotlicommon" Condition="'$(UseSystemBrotli)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="zstd" Condition="'$(UseSystemZstd)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="rt" Condition="'$(_IsApplePlatform)' != 'true' and '$(_linuxLibcFlavor)' != 'bionic'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="rt" Condition="'$(_IsApplePlatform)' != 'true' and '$(_linuxLibcFlavor)' != 'bionic' and '$(_targetOS)' != 'haiku'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="log" Condition="'$(_linuxLibcFlavor)' == 'bionic'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="icucore" Condition="'$(_IsApplePlatform)' == 'true'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="m" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="bsd" Condition="'$(_targetOS)' == 'haiku'" /> | ||||||||||||||||||
| <NativeSystemLibrary Include="network" Condition="'$(_targetOS)' == 'haiku'" /> | ||||||||||||||||||
|
trungnt2910 marked this conversation as resolved.
trungnt2910 marked this conversation as resolved.
|
||||||||||||||||||
| <!-- See the comment in PalInterlockedCompareExchange128 for details. --> | ||||||||||||||||||
| <NativeSystemLibrary Include="atomic" Condition="'$(_targetArchitecture)' == 'riscv64' or '$(_targetArchitecture)' == 'loongarch64'" /> | ||||||||||||||||||
| </ItemGroup> | ||||||||||||||||||
|
|
@@ -250,7 +253,7 @@ The .NET Foundation licenses this file to you under the MIT license. | |||||||||||||||||
| <LinkerArg Include="-Wl,--build-id=sha1" Condition="'$(_IsApplePlatform)' != 'true'" /> | ||||||||||||||||||
| <LinkerArg Include="-Wl,--as-needed" Condition="'$(_IsApplePlatform)' != 'true'" /> | ||||||||||||||||||
| <LinkerArg Include="-Wl,-e,0x0" Condition="'$(NativeLib)' == 'Shared' and '$(_IsApplePlatform)' != 'true'" /> | ||||||||||||||||||
| <LinkerArg Include="-pthread" Condition="'$(_IsApplePlatform)' != 'true'" /> | ||||||||||||||||||
| <LinkerArg Include="-pthread" Condition="'$(_IsApplePlatform)' != 'true' and '$(_targetOS)' != 'haiku'" /> | ||||||||||||||||||
| <LinkerArg Include="@(NativeSystemLibrary->'-l%(Identity)')" /> | ||||||||||||||||||
| <LinkerArg Include="-L/usr/lib/swift" Condition="'$(_IsApplePlatform)' == 'true'" /> | ||||||||||||||||||
| <LinkerArg Include="@(StaticICULibs)" Condition="'$(StaticICULinking)' == 'true'" /> | ||||||||||||||||||
|
|
@@ -260,8 +263,8 @@ The .NET Foundation licenses this file to you under the MIT license. | |||||||||||||||||
| <LinkerArg Include="-dynamiclib" Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'" /> | ||||||||||||||||||
| <LinkerArg Include="-shared" Condition="'$(_IsApplePlatform)' != 'true' and '$(NativeLib)' == 'Shared'" /> | ||||||||||||||||||
| <!-- binskim warning BA3001 PIE disabled on executable --> | ||||||||||||||||||
| <LinkerArg Include="-pie -Wl,-pie" Condition="'$(_IsApplePlatform)' != 'true' and '$(NativeLib)' == '' and '$(StaticExecutable)' != 'true' and '$(PositionIndependentExecutable)' != 'false'" /> | ||||||||||||||||||
| <LinkerArg Include="-Wl,-no-pie" Condition="'$(_IsApplePlatform)' != 'true' and '$(NativeLib)' == '' and '$(StaticExecutable)' != 'true' and '$(PositionIndependentExecutable)' == 'false'" /> | ||||||||||||||||||
| <LinkerArg Include="-pie -Wl,-pie" Condition="'$(_IsApplePlatform)' != 'true' and '$(_targetOS)' != 'haiku' and '$(NativeLib)' == '' and '$(StaticExecutable)' != 'true' and '$(PositionIndependentExecutable)' != 'false'" /> | ||||||||||||||||||
| <LinkerArg Include="-Wl,-no-pie" Condition="'$(_IsApplePlatform)' != 'true' and '$(_targetOS)' != 'haiku' and '$(NativeLib)' == '' and '$(StaticExecutable)' != 'true' and '$(PositionIndependentExecutable)' == 'false'" /> | ||||||||||||||||||
|
Comment on lines
+266
to
+267
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to yesterday's patch https://github.com/dotnet/runtime/pull/127392/changes#diff-0ed6f3997357a6ff6652a7509482b05370b67e8e3041eecfd89f9556e7b59313R495
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have the exact error here, but it had something to do with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, during the build, it should've published
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I'm waiting for the other PRs (especially the approved ones) to get merged before continuing. Right now I'm running it on disposable GitHub Actions machines and it's becoming cherry-pick hell.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most are passing, except: My CPU is:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is fine, you can ignore that test. Those tests are specifically publishing with explicit
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems a bit suspicious though, since I ran this on a i7-1165G7, which should support AVX-512 according to Intel.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to GDB it is due to this returning runtime/src/native/minipal/cpufeatures.c Lines 148 to 155 in 9806aba
So it's a Haiku issue, not an issue with this PR.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So should this be in sync with what was done in #127392 ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am pretty sure
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the LLVM project, on Haiku:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Therefore, replacing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, I think @jkotas point is to keep them in sync so it can be reasoned about. If it works without those flags, then omitting on both sides sounds good. We can validate
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See: #127443.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, with the argument, it works without With
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can ignore gcc error. We support clang or gcc for "host=target" and host clang and gcc with sysroot for cross / "host!=target". In case of haiku (and illumos), we are using gcc from sysroot built for host, it's different than using host gcc with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, it's actually more simpler, we don't support cross (when |
||||||||||||||||||
| <!-- binskim warning BA3010 The GNU_RELRO segment is missing --> | ||||||||||||||||||
| <LinkerArg Include="-Wl,-z,relro" Condition="'$(_IsApplePlatform)' != 'true'" /> | ||||||||||||||||||
| <!-- binskim warning BA3011 The BIND_NOW flag is missing --> | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ public enum TargetOS | |
| FreeBSD, | ||
| NetBSD, | ||
| SunOS, | ||
| Haiku, | ||
| Browser, | ||
| Wasi | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.