Uh oh!
There was an error while loading. Please reload this page.
Haiku: Add Haiku support for CoreCLR/PAL - #93907
Conversation
Uh oh!
There was an error while loading. Please reload this page.
f98a038 to
3ff7e01CompareThere was a problem hiding this comment.
I would prefer the #elif defined(TARGET_LINUX) here and final #else with the posix fallback instead of hierarchical ifdef.
There was a problem hiding this comment.
Done. The final #else assigns the fd variable to -1 instead of doing the POSIX fallback itself, in case any of the platform-specific functions above return an error.
This should solve #72192 from the .NET 7 era.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Should we keep the old aborting code as a fallback and add separate #if for HAIKU instead? I am not familiar enough with the contract of this function though.
There was a problem hiding this comment.
I've added back the abort() logic, as an assertion that the function is unreachable.
This is true because on unsupported platforms, the higher-level C# libraries should already throw while trying to construct a network events socket.
Returning Error_SUCCESS does not make much sense though.
790029d to
2131127Comparetrungnt2910
commented
Oct 25, 2023
Strange, I'm not modifying any FreeBSD-related codepaths, what's wrong with the FreeBSD build? |
FreeBSD build error is: I guess you have introduced it by changing conditions around some of the includes. |
trungnt2910
commented
Oct 25, 2023
This is suspicious: I wonder how I could get more detailed CMake logs for the CI runs. |
ed1af42 to
4a8cc01Comparetrungnt2910
commented
Oct 25, 2023
When looking at other files, it seems like This time, instead of checking for this header during configuration as in #86391, a FreeBSD |
0a97fb8 to
f1f4369Compare| // POSIX fallback | ||
| if (fd == -1) | ||
| { | ||
| char name[24]; | ||
| sprintf(name, "/shm-dotnet-%d", getpid()); | ||
| name[sizeof(name) - 1] = '\0'; | ||
| shm_unlink(name); | ||
| fd = shm_open(name, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600); | ||
| shm_unlink(name); | ||
| } |
There was a problem hiding this comment.
Shouldn't this block be in #else?
There was a problem hiding this comment.
No, it should not, as stated in #93907 (comment).
Even for OSes with platform-specific ways to get a special memory file open, should their method fail, we can still always use the POSIX fallback.
| #ifdef TARGET_LINUX | ||
| #include <sys/syscall.h> | ||
| #endif |
There was a problem hiding this comment.
Is this used by other Unix systems?
There was a problem hiding this comment.
No, it is only used on Linux:
runtime/src/coreclr/gc/unix/numasupport.cpp
Lines 52 to 63 in e5c631d
and
runtime/src/coreclr/gc/unix/numasupport.cpp
Lines 81 to 83 in e5c631d
| #endif // !HOST_64BIT | ||
| #endif // !PAL_STDCPP_COMPAT | ||
| #define _SIZE_T_DEFINED | ||
| #endif // !PAL_STDCPP_COMPAT |
There was a problem hiding this comment.
What's the impact range of this?
There was a problem hiding this comment.
What do you mean by "impact range"?
The line should affect all platforms. However, I believe that this is how things should be, since with PAL_STDCPP_COMPAT the header should not define things that potentially mess up system headers.
Also, CoreCLR builds are working, so it should not break the definition on any other platforms.
Some more comments about this change here: #55803 (comment)
f1f4369 to
72e7cc3Comparea7afb88 to
c11ed1aCompareLatest Haiku builds are failing with this error: Seems like whoever included According to the POSIX Standard, however:
What should I do in this case? Removing |
jkotas
commented
Apr 30, 2024
Does anything break if our local wcsnlen implementation is deleted? |
ed24de7 to
56ff51fComparetrungnt2910
commented
Apr 30, 2024
Hasn't broken my local Linux build and moved my local Haiku build to a different error. Let the CI inform the rest of the answer. |
trungnt2910
commented
Apr 30, 2024
The next Haiku error is: Currently I am solving this by adding these lines to #include "mdfileformat.h"#include "stgpooli.h"+#ifdef _EXPORT+#undef _EXPORT+#endif+#ifdef _IMPORT+#undef _IMPORT+#endif#endifI wonder whether these lines should be put directly to |
mangod9
commented
Jul 29, 2024
Hey @trungnt2910, what is the status of this PR. Are you continuing to work on it? |
There's still an unanswered question from me above. When we have a solution for those macros, I can proceed to resolving the conflicts and the PR is ready for further review. |
mangod9
commented
Jul 30, 2024
ok, so the question is about whether to add the undefs in |
trungnt2910
commented
Jul 30, 2024
Yes, the question is related to where I should add the
Yeah. This has been waiting for quite a few months now, waiting a few more weeks wouldn't hurt. |
mangod9
commented
Sep 16, 2024
adding @janvorli on advise on #undefs in pal.h. |
janvorli
commented
Nov 5, 2024
This is strictly ilasm specific, so let's keep it where you have put it. |
janvorli
left a comment
There was a problem hiding this comment.
Besides the two comments, it all looks good.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
56ff51f to
7e63089CompareUh oh!
There was an error while loading. Please reload this page.
This contains a part of the code required to build CoreCLR and get `paltests` to pass on Haiku. This commit covers `src/coreclr/pal/**`. Co-authored-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Some OSes like Haiku define the `_EXPORT` and `_IMPORT` marcos. Symbols beginning with an underscore followed immediately by an uppercase letter are reserved anyway. Add the guards to get them out of the way.
This flag is a compatibility flag and not required on most OSes. Some, including Haiku, does not even define it.
7e63089 to
40b806aComparejanvorli
commented
Nov 5, 2024
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
janvorli
commented
Nov 6, 2024
The outerloop failure is a known crossgen2 issue #104340 |
trungnt2910
commented
Nov 6, 2024
Thanks for the review! Following up with #109580, hope you could have a look at that. |
This contains the code required to build this repo's native components and get
palteststo pass on Haiku.Most implementation details related to this commit are documented here.
Part of #55803.