-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update to 12.4 with clang #1
Comments
I'll take a look. I suspect the process of building Clang is fairly different from building GCC, so it may take me some time to figure out. |
I've rebuilt this image around the native cross-compilation capability in Clang/LLVM, and just pushed a new version targeting FreeBSD 11.4. My preference is to target a reasonably old OS version, as my own use case for the container is building the native portion of a Java serial communications library, and I think it's important to have low minimum requirements for a library that may be used in some very low-churn environments. Is there anything in particular that you wanted from FreeBSD 12 that isn't in 11? (Or have I misunderstood some aspect of FreeBSD's backwards compatibility, and should I be thinking about FreeBSD targets differently?) It may also be worth noting that this new version represents a departure from my previous tooling philosophy. I went to great lengths when targeting 9.3 to match the compiler version in the image to the compiler version that was distributed with the OS. I haven't done that this time; this new image uses the latest and greatest Clang (16) packaged by Alpine. IMO that's probably more useful than a newer base system target. |
Good reasoning, this image is also used for Jansi which is used in Maven, that is why I care as a Maven committer. I am totally fine with 11.4 and support your position as long as the following is met:
then this issue is satisfied. Is there any particular reason why you need latest clang and the base compiler won't do? Reported with Jansi: fusesource/jansi#257 PS: Thank you for the huge effort! |
Thank you for spelling out your prerequisites. I think both of them apply to me, too – I just don't know enough about FreeBSD to have been able to articulate them with such specificity. (I don't use FreeBSD, personally, so I find myself a bit off-kilter testing this project.) My understanding from little research is that FreeBSD supports binary compatibility with itself at two different levels: at the syscall level, and at the library level for select system libraries.
As an aside, I found it really difficult to search for this stuff, as Google thinks you want to know about FreeBSD's compatibility with Linux binaries, not binaries built for older versions of FreeBSD! I took this for a practical test by using this container to build
I don't need the latest Clang, per se, but because I'm now able to use a generic compiler built by someone else, it's more convenient to do that rather than build my own. Alpine 3.18 only packages Clang 14/15/16, while FreeBSD 11.4 included Clang 10, so I can't match even the major version; in which case, it's as easy to use the latest version as any other. I might look into compiling my own Clang, though; that would be one way to shed the useless inclusion of GCC and Thanks a lot for your interest and feedback. If this all adds up to you then I'll close this issue, but I'm also open to the possibility of generating separate images to support FreeBSD 12/13 as long as they'll get used. While I haven't tried it, I suspect the current Dockerfile would also be able to target those OSes without modification when built with an appropriate |
Let me get back to you next week. You wrote a high-quality answer, I want to reply to it decently! |
While I havn't yet processed the reply yet fully, I see already the first problem:
There is no qualified strip in this image. Output:
The bundled strip as well as the other tools which are missing aren't usable on FreeBSD binaries, of course. |
Ah, you're right, I didn't install the full I think, if I'm going to have to go down this road anyway, then I might try to do a custom build of LLVM/Clang after all. Mostly so that I can keep the size of the image down by avoiding the inclusion of target-incompatible Gnu Binutils. |
The first success after local hacks:
Left shared object produced on AL8 with your cross image, right compiled natively on FreeBSD 12-STABLE. At first glance, very nice. I am waiting for the fix in #2. |
Can this be updated to 12.4 with clang from base? 9.3 is dead for many many years and GCC is not the standard compiler anymore in base.
The text was updated successfully, but these errors were encountered: