Repository navigation
Open
Description
The Sysroot Release 20181213 Version 1 is using older kernel, which is breaking us ingesting SmartOS packages (such as zlib) in .NET, ever since we made this change: dotnet/arcade@4900886 (download dependencies from trunk instead of 2020Q1 repository). Luckily, we have older docker images persisisting in container repository for cross-building so it is not a blocker. :)
It would be nice if we get the new release with updated kernel and toolchain, so we don't run into errors like:
# bash on linux-x64
$ git clone https://github.com/dotnet/runtime --single-branch --depth 1; cd runtime
$ URN=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-illumos-20220813234406-f13d79e
$ docker run -v$(pwd):/runtime -e ROOTFS_DIR=/crossrootfs/x64 $URN \
/runtime/build.sh clr -cross -os illumos -gcc
...
[100%] Building CXX object Corehost.Static/CMakeFiles/singlefilehost.dir/runtime/src/native/corehost/corehost.cpp.o
[100%] Linking CXX executable singlefilehost
/crossrootfs/x64/bin/../lib/gcc/x86_64-sun-solaris2.10/8.4.0/../../../../x86_64-sun-solaris2.10/bin/ld: /crossrootfs/x64/lib/libz.so: undefined reference to `__stack_chk_fail@ILLUMOS_0.37'
/crossrootfs/x64/bin/../lib/gcc/x86_64-sun-solaris2.10/8.4.0/../../../../x86_64-sun-solaris2.10/bin/ld: /crossrootfs/x64/lib/libz.so: undefined reference to `__stack_chk_guard@ILLUMOS_0.37'
collect2: error: ld returned 1 exit status
Corehost.Static/CMakeFiles/singlefilehost.dir/build.make:1858: recipe for target 'Corehost.Static/singlefilehost' failed
make[2]: *** [Corehost.Static/singlefilehost] Error 1(with older image; URN=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-illumos-20220531132048-f13d79e which was created using older zlib and mit-krb5 packages, the build succeeds)
Metadata
Metadata
Assignees
Labels
No labels
Activity
jclulow commentedon Aug 15, 2022
Do you know what version of illumos the trunk packages are built against? cc @jperkin
am11 commentedon Aug 15, 2022
v0.37 I think; going by the error log
__stack_chk_fail@ILLUMOS_0.37'.jclulow commentedon Aug 15, 2022
That's a symbol version in a specific library, but not enough to identify the whole OS image. From what I recall, pkgsrc trunk binaries are built on a particular SmartOS platform which will have a release datestamp.
jperkin commentedon Aug 15, 2022
Hi, they're built on
joyent_20210826T002459Z.am11 commentedon Sep 21, 2022
Thank you. For .NET's purposes, we do not need compatibility older than illumos 2021.
Toolchain: (non-mandatory) if possible, would be nice to have newer compiler toolchain (preferably the latest, gcc-12) in sysroot release, as newer ones come with improved code analyzers.
am11 commentedon Jun 27, 2024
Hey guys, I hope this message finds you well. I just wanted to follow-up since @gwr is looking to continue on the dotnet/runtime port effort; if we could get the new'ish sysroot build, we would be be able to utilize the newer versions dependencies (like libz) as those are stuck in time. 🥲
jclulow commentedon Jun 28, 2024
The compiler you're using doesn't come from the sysroot. It must be built as part of your docker image, right?
am11 commentedon Jun 28, 2024
Yup, I can use the v14. I was wondering if there are any known issues with the bleeding edge version (last time you confirmed v8.4 is what Rust is using and we can trust it). But I guess we will find out. 😅
gwr commentedon Jun 28, 2024
am11 commentedon Jun 28, 2024
gcc-10 with latest (or new enough) kernel sounds good. 👍
gwr commentedon Jun 28, 2024
The question of "what gcc version does the target use" is a little complex.
The base OS uses gcc 10.4 (with patches to allow system tools to see all function calls with args and return values etc, even in production code). Some details about those OS-specific patches for gcc are in IPD-7 if you're curious.
Those features are very helpful for tracking down problems.
Most user-level applications and libraries are built with a later version of gcc as chosen by the distribution.
OmniOS/CE r151046 (and r151048) is using gcc 12.2.0 (with OS-specific patches as described above)
OpenIndiana ("hipster 2024") is using gcc 13.3.0:
I'd suggest being a bit conservative, and go with gcc 12.2 or 12.3 with the illumos patches
as described in IPD-7
OmniOS offers a fairly light-weight method of building that (with patches) in omnios-build...gcc12
Similarly gcc-10.x (with patches) is also in omnios-build...gcc10
Let me know if I can help with that in any way.
Thanks.
am11 commentedon Jun 28, 2024
I think we are fine with whichever compiler version is available, just need the new build of sysroot with kernel version supporting the symbols error.
side note: on other community-supported targets (freebsd, linux-s390x etc.), we are using clang from host with
--gcc-toolchainset to$ROOTFS_DIR/usrand-sysrootset to$ROOTFS_DIRto enable cross-compilation. clang provides multi-target so host clang 18 works for many targets. However, this is not a requirement just a good-thing-to-have.alexrp commentedon Apr 14, 2026
I've been looking at the viability of adding illumos cross-compilation support to Zig (https://codeberg.org/ziglang/zig/issues/30971). It seems to me that the sysroots published in this repo would be perfect for this purpose as we can harvest system headers and libc symbols from them without having to actually build illumos from source ourselves.
But, I'd like to avoid building that support on a shaky foundation, so I'm wondering if we can expect future releases in this repo?
gwr commentedon Apr 14, 2026
There's a new one I've tested with dotnet, but there are other tests the sysroot maintainers would like to run before promoting it to general release. I'll ping them to see if I can help move that along.
BTW, the illumos project goes to great lengths to avoid breaking backward compatiblity.
When building things to run on illumos, you generally want to use a sysroot corresponding to the oldest system on which you intend to run your build. That's different from how a lot of other OS's do things.
am11 commentedon Apr 14, 2026
I agree that it is painful to maintain the compatibility but I think this is a general expectation. e.g. folks still build stuff on CentOS 5/6 (read: very old) and FreeBSD 11 etc. to maximize compat.