Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use 'weak' attribute and non-static on illumos - #7206

#7206
Merged
akoeplinger merged 1 commit into
dotnet:maindotnet/dotnet:mainfrom
am11:chore/sccsid-fix-old-compileram11/dotnet:chore/sccsid-fix-old-compilerCopy head branch name to clipboard
Jun 12, 2026
Merged

Use 'weak' attribute and non-static on illumos#7206
akoeplinger merged 1 commit into
dotnet:maindotnet/dotnet:mainfrom
am11:chore/sccsid-fix-old-compileram11/dotnet:chore/sccsid-fix-old-compilerCopy head branch name to clipboard

Conversation

@am11

@am11 am11 commented Jun 12, 2026

Copy link
Copy Markdown
Member

apphost build wasn't happy with static/non-global symbol being referenced in .init_array.

@dotnet-policy-service
dotnet-policy-service Bot requested review from a team June 12, 2026 07:01
@am11

am11 commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

cc @akoeplinger, @janvorli, I tested it adhoc previously because there were other errors to side step with gcc build. Now those are resolved, it turned out we run into:

   FAILED: gc/libclrgc.so 
  : && /crossrootfs/x64/bin/x86_64-illumos-g++ --sysroot=/crossrootfs/x64 -fPIC -fstack-protector -g   -shared -Wl,-hlibclrgc.so -o gc/libclrgc.so gc/unix/CMakeFiles/gc_pal.dir/gcenv.unix.cpp.o gc/unix/CMakeFiles/gc_pal.dir/numasupport.cpp.o gc/unix/CMakeFiles/gc_pal.dir/events.cpp.o gc/unix/CMakeFiles/gc_pal.dir/cgroup.cpp.o gc/unix/CMakeFiles/gc_pal.dir/runtime/artifacts/obj/_version.c.o gc/vxsort/CMakeFiles/gc_vxsort.dir/isa_detection.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/do_vxsort_avx2.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/do_vxsort_avx512.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/machine_traits.avx2.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp.o gc/vxsort/CMakeFiles/gc_vxsort.dir/smallsort/avx2_load_mask_tables.cpp.o gc/datadescriptor/CMakeFiles/gc_dll_wks_descriptor.dir/cdac-gc_dll_wks_descriptor/contract-descriptor.c.o gc/datadescriptor/CMakeFiles/gc_dll_wks_descriptor.dir/__/__/debug/datadescriptor-shared/contractpointerdata.cpp.o gc/datadescriptor/CMakeFiles/gc_dll_svr_descriptor.dir/cdac-gc_dll_svr_descriptor/contract-descriptor.c.o gc/datadescriptor/CMakeFiles/gc_dll_svr_descriptor.dir/__/__/debug/datadescriptor-shared/contractpointerdata.cpp.o gc/CMakeFiles/clrgc.dir/gceventstatus.cpp.o gc/CMakeFiles/clrgc.dir/gcconfig.cpp.o gc/CMakeFiles/clrgc.dir/gccommon.cpp.o gc/CMakeFiles/clrgc.dir/gcscan.cpp.o gc/CMakeFiles/clrgc.dir/gcsvr.cpp.o gc/CMakeFiles/clrgc.dir/gcwks.cpp.o gc/CMakeFiles/clrgc.dir/handletable.cpp.o gc/CMakeFiles/clrgc.dir/handletablecore.cpp.o gc/CMakeFiles/clrgc.dir/handletablescan.cpp.o gc/CMakeFiles/clrgc.dir/objecthandle.cpp.o gc/CMakeFiles/clrgc.dir/softwarewritewatch.cpp.o gc/CMakeFiles/clrgc.dir/gchandletable.cpp.o gc/CMakeFiles/clrgc.dir/gceesvr.cpp.o gc/CMakeFiles/clrgc.dir/gceewks.cpp.o gc/CMakeFiles/clrgc.dir/gcload.cpp.o gc/CMakeFiles/clrgc.dir/gcbridge.cpp.o gc/CMakeFiles/clrgc.dir/handletablecache.cpp.o gc/CMakeFiles/clrgc.dir/runtime/artifacts/obj/_version.c.o  shared_minipal/libminipal.a   -lssp -lssp && cd /runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc && sh -c "echo Stripping symbols from \$(basename '/runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so') into \$(basename '/runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so.dbg')" && /crossrootfs/x64/bin/x86_64-illumos-objcopy --only-keep-debug /runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so /runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so.dbg && /crossrootfs/x64/bin/x86_64-illumos-objcopy --strip-debug --strip-unneeded /runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so && /crossrootfs/x64/bin/x86_64-illumos-objcopy --add-gnu-debuglink=/runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so.dbg /runtime/artifacts/obj/coreclr/illumos.x64.Debug/gc/libclrgc.so
  /crossrootfs/x64/lib/gcc/x86_64-sun-solaris2.11/13.3.0/../../../../x86_64-sun-solaris2.11/bin/ld: gc/CMakeFiles/clrgc.dir/runtime/artifacts/obj/_version.c.o:/runtime/artifacts/obj/_version.c:3:
  multiple definition of `sccsid'; gc/unix/CMakeFiles/gc_pal.dir/runtime/artifacts/obj/_version.c.o:/runtime/artifacts/obj/_version.c:3: first defined here
  collect2: error: ld returned 1 exit status

With this patch I finally got it green in the CI https://github.com/am11/CrossRepoCITesting/actions/runs/27387091192, patching arcade SDK isn't easy when building runtime alone, so I patched the script for that run, shows:


  >>>>> before
  static char sccsid[] __attribute__((used,retain)) = "@(#)Version 42.42.42.42424";
  >>>>> after
  __asm__(".pushsection .init_array; .reloc ., R_X86_64_NONE, sccsid; .popsection");
  char sccsid[] __attribute__((used,weak)) = "@(#)Version 42.42.42.42424";

...


[7](https://github.com/am11/CrossRepoCITesting/actions/runs/27387091192/job/80936377718#step:3:10988)
Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 01:21:33.79
@(#)Version 42.42.42.42424

A single version string reported by strings runtime/artifacts/bin/coreclr/illumos.x64.Release/./libcoreclr.so | grep '@(#)Version' in Release build (debug show duplicates because we don't use -Wl,--gc-sections, but we only care about Release having the right semantics for this).

@akoeplinger
akoeplinger merged commit f0130b9 into dotnet:main Jun 12, 2026
11 checks passed
@am11
am11 deleted the chore/sccsid-fix-old-compiler branch June 12, 2026 14:34
janvorli pushed a commit to dotnet/runtime that referenced this pull request Jun 15, 2026
First, our default build is failing with solaris gcc 13, so couple of
fixes for those are included (jit, gcenv etc.). Then it includes clang
fixes.

For the first time, cross building runtime repo for illumos-x64 with
llvm-toolchain has succeeded. It has two issues which I've reported
upstream with minimal repro and workarounds:

* llvm assembler (llvm-mc):
llvm/llvm-project#202953
* LLVM linker (lld): llvm/llvm-project#202963

For the first one I am adding a workaround in configurecompiler.cmake
(`if (CMAKE_C_COMPILER_ID MATCHES "GNU")` condition). For the second one
the hack goes in toolchain.cmake which I am skipping from this PR as I'm
running trials to slim it down a bit (current state:
https://github.com/am11/runtime/blob/67046c0cf095c5d7888c797226fe736156b5e04c/eng/common/cross/toolchain.cmake#L227-L307).

Together the clang build succeeds on Azure Linux cross environment same
as rest of the platforms (freebsd, openbsd, haiku).

Note that the gcc build requires another fix upstream
dotnet/dotnet#7206, which I recently broke while
fixing sccsid which got broken after we started to use `--gc-sections`
linker option liberally.
eiriktsarpalis pushed a commit to dotnet/runtime that referenced this pull request Jul 15, 2026
First, our default build is failing with solaris gcc 13, so couple of
fixes for those are included (jit, gcenv etc.). Then it includes clang
fixes.

For the first time, cross building runtime repo for illumos-x64 with
llvm-toolchain has succeeded. It has two issues which I've reported
upstream with minimal repro and workarounds:

* llvm assembler (llvm-mc):
llvm/llvm-project#202953
* LLVM linker (lld): llvm/llvm-project#202963

For the first one I am adding a workaround in configurecompiler.cmake
(`if (CMAKE_C_COMPILER_ID MATCHES "GNU")` condition). For the second one
the hack goes in toolchain.cmake which I am skipping from this PR as I'm
running trials to slim it down a bit (current state:
https://github.com/am11/runtime/blob/67046c0cf095c5d7888c797226fe736156b5e04c/eng/common/cross/toolchain.cmake#L227-L307).

Together the clang build succeeds on Azure Linux cross environment same
as rest of the platforms (freebsd, openbsd, haiku).

Note that the gcc build requires another fix upstream
dotnet/dotnet#7206, which I recently broke while
fixing sccsid which got broken after we started to use `--gc-sections`
linker option liberally.
ManickaP pushed a commit to ManickaP/runtime that referenced this pull request Jul 22, 2026
First, our default build is failing with solaris gcc 13, so couple of
fixes for those are included (jit, gcenv etc.). Then it includes clang
fixes.

For the first time, cross building runtime repo for illumos-x64 with
llvm-toolchain has succeeded. It has two issues which I've reported
upstream with minimal repro and workarounds:

* llvm assembler (llvm-mc):
llvm/llvm-project#202953
* LLVM linker (lld): llvm/llvm-project#202963

For the first one I am adding a workaround in configurecompiler.cmake
(`if (CMAKE_C_COMPILER_ID MATCHES "GNU")` condition). For the second one
the hack goes in toolchain.cmake which I am skipping from this PR as I'm
running trials to slim it down a bit (current state:
https://github.com/am11/runtime/blob/67046c0cf095c5d7888c797226fe736156b5e04c/eng/common/cross/toolchain.cmake#L227-L307).

Together the clang build succeeds on Azure Linux cross environment same
as rest of the platforms (freebsd, openbsd, haiku).

Note that the gcc build requires another fix upstream
dotnet/dotnet#7206, which I recently broke while
fixing sccsid which got broken after we started to use `--gc-sections`
linker option liberally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.