Page MenuHomeSolus

unbork zig compiler
ClosedPublic

Authored by nazar on Jun 11 2023, 12:15 AM.
Tags
None
Referenced Files
F11006841: D14197.id34620.diff
Tue, Aug 1, 5:12 PM
F11006840: D14197.id34611.diff
Tue, Aug 1, 5:12 PM
F11006839: D14197.id34608.diff
Tue, Aug 1, 5:12 PM
F11006838: D14197.id34595.diff
Tue, Aug 1, 5:12 PM
F11006834: D14197.id34594.diff
Tue, Aug 1, 5:11 PM
F11006833: D14197.id.diff
Tue, Aug 1, 5:11 PM
F11003364: D14197.diff
Mon, Jul 31, 1:52 PM
F10960246: D14197.diff
Tue, Jul 18, 10:30 AM

Details

Reviewers
silke
Group Reviewers
Triage Team
Commits
R5456:4ecc8637c3f2: unbork zig compiler
Summary
Test Plan

ncdu should compile now

Diff Detail

Repository
R5456 ziglang
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

nazar created this revision.

This does not fix the issue with ncdu for me. It looks to me like zig uses instructions from the build environment, and it probably shouldn't.
I can reproduce the issue as follows:

  1. Build zig on a machine with AVX512 (like the buildserver or my desktop).
  2. Transfer and install package on a machine without AVX512.
  3. Run zig and get a crash with 'Illegal instruction'.

This does not fix the issue with ncdu for me. It looks to me like zig uses instructions from the build environment, and it probably shouldn't.
I can reproduce the issue as follows:

  1. Build zig on a machine with AVX512 (like the buildserver or my desktop).
  2. Transfer and install package on a machine without AVX512.
  3. Run zig and get a crash with 'Illegal instruction'.

Yeah, this is bad.

If it is an option to target x86_64 with the base compiler and then offering a haswell build, that might be the best way forward.

Will probably want to hold off on the haswell part as I know @joebonrichie has some ideas re. glibc hwcaps for the solus 4.5 release once we get this 4.4 release out the door.

This does not fix the issue with ncdu for me. It looks to me like zig uses instructions from the build environment, and it probably shouldn't.
I can reproduce the issue as follows:

  1. Build zig on a machine with AVX512 (like the buildserver or my desktop).
  2. Transfer and install package on a machine without AVX512.
  3. Run zig and get a crash with 'Illegal instruction'.

I updated the patch which may or may not work, cant say for sure without being able to reproduce the issue.
In order to reproduce it I'll need eopkg from build server, new one, with the patch applied.
Then I can go and fix it properly.

This does not fix the issue with ncdu for me. It looks to me like zig uses instructions from the build environment, and it probably shouldn't.
I can reproduce the issue as follows:

  1. Build zig on a machine with AVX512 (like the buildserver or my desktop).
  2. Transfer and install package on a machine without AVX512.
  3. Run zig and get a crash with 'Illegal instruction'.

I updated the patch which may or may not work, cant say for sure without being able to reproduce the issue.
In order to reproduce it I'll need eopkg from build server, new one, with the patch applied.
Then I can go and fix it properly.

I have a local build of the package with the patch applied for you here. Note that if you install that your zig is probably broken.

I did find this issue, which gives the build option -DZIG_TARGET_MCPU=baseline. That does seem to fix the issue for me (download here). Please check if it's the correct way to do this though 😅.

We ran into known issue, here's the root cause
https://github.com/ziglang/zig/blob/d27007cd7e66df8db72cfaa7e5dcd3de65857ac8/CMakeLists.txt#L121

@joebonrichie would =baseline= be correct value for mcpu?

I can verify this revision solves the issues, and baseline definitely looks right to me. Thanks!

This revision is now accepted and ready to land.Jun 12 2023, 5:39 PM
This revision was automatically updated to reflect the committed changes.