-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Enable the mono subset to build on FreeBSD x64 #57027
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
Conversation
|
I get a build error without the explicit setting:
From here #if == 1
#define G_HAVE_ALLOCA_H
#endif |
ah! Speaking of... would it be better/cleaner to move:
into its own the
after the SOLARIS elseif if following the same pattern. (might not need the
|
OK this needs a little more discussion. It turns out all but one use of HAVE_ALLOCA_H are #ifdefs. So setting it to be 0 doesn't help there - any value satisfies an #ifdef. The only other use case is to set up G_HAVE_ALLOCA_H for just a single reference in #ifdef G_HAVE_ALLOCA_H
#include <alloca.h>
#endif If that's not desirable, then can we change
to
Does |
Following up on my last question, if the variable is set to 0 in the cmake file |
The way that This is why FreeBSD gets that strange |
In my testing I found this works fine on Linux (native), on FreeBSD (native) and on Linux (cross-building FreeBSD) for #ifdef HAVE_ALLOCA_H
#define G_HAVE_ALLOCA_H
#endif |
At this point ill take what I can get. The CI system will let us know if anything explodes [it shouldn't]. |
6136810
to
71e9804
Compare
I have refined the changes to be more complete. I can remove the changes to find-native-compiler.sh and init-compiler.sh if they shouldn't be done here - I have been using clang-12 on Linux and FreeBSD without issue. I have made the change to |
The cross-build in CI failed because the container is missing or can't find lld. We'll need to update some of the dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Hope someone can get that container fixed.
71e9804
to
2ecc30c
Compare
This container |
It does appear that the freebsd12 container is still on 12.1. |
The 3 FreeBSD cross-builds in the checks succeeded but FreeBSD/mono isn't actually included in runtime.yml yet. That can go in a separate change set as it affects all build-runs in the CI system and there might be additional devops decisions around it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Cross-build on Linux for FreeBSD x64 now uses LLVM provided lld linker to create valid FreeBSD binaries. find-native-compiler.sh will now look for clang versions 10, 11 and 12. init-compiler.sh will also look for version 12. The cmake test for HAVE_ALLOC_H in eglib-config.h.cmake.in would fail if it wasn't defined. The fix was to convert to an normal C preprocessor #ifdef Update the docker container to use the most recent version of ubuntu-18.04-cross-freebsd-12
Adjusted CMake settings to search the crossrootfs path for libinotify.so
2ecc30c
to
6893025
Compare
I noticed libinotify wasn't being found on the cross builds so I've fixed that now. |
If/when this gets merged, it will need a backport to |
any thoughts on 6.0 @danmoseley? Risk for other supported platforms should be really small IMHO and it would allow community to but 6.0 on their own. |
@jkotas you are more involved with efforts to bring up/maintain other platforms. does this seem a reasonable change to take at the moment? I see no problem if there is negligible risk to anything else. |
This is in the same category as #58085 (comment) . There are likely more changes needed to make FreeBSD work well. It is unlikely we will be able to port them all to the release branch. After thinking about it a bit, I would recommend to keep the policy simple and only backport changes for officially supported OSes and architectures to the release branches. If somebody wants to build OSes that are not officially supported by the .NET team, they can do it either from main or release branch w/ local patch. Tizen OS has been on this plan too. |
I assume that includes changes to RIDs? |
Where does that leave FreeBSD (and also illumos) for net6? Currently under net5: I was recently able to make a usable net6-preview7 but it required 3 freebsd-based patches, or 5 total patches as two of the three freebsd ones require earlier illumos-based patches (cherry-pick did not work otherwise). While this is annoying, having the 3(5?) patches backported into net6 will make it much easier for the freebsd community to build/help support net6 during its lifetime. I understand if a backport will not be suitable here, but I can list all of the needed patches if it will help. Finally, I would like to thank the dotnet team for allowing unofficial platforms/arches to be added into dotnet :) |
Add the necessary CMake settings to detect the CPU and
reference the correct libraries when the build host is FreeBSD.
These changes allow me to build the mono subset on FreeBSD 12.2
There shouldn't be any impact when building on other hosts. I also did a cross-build
of FreeBSD on Linux and that completed successfully (it already builds correctly there).
#14537 (comment)