Nuke the C++ implementation of Zig from orbit using WASI by andrewrk · Pull Request #13560 · ziglang/zig

3 min read Original article ↗

andrewrk added a commit that referenced this pull request

Nov 22, 2022
This is to work around OOM on the CI server. Once #13560 is complete,
we can avoid having to replace the tarballs so often.

@andrewrk

In the CI system, I copied the old tarball and then applied
05c21a2 to its compiler_rt
implementation.

After this is verified we can drop this commit and regenerate the
tarballs from a master branch commit.

@jacobly0 @andrewrk

@jacobly0 @andrewrk

In particular, these two changes are relevant:

 * zig cc: support -stack in addition to --stack for linker arg
   - Fixes stack overflow when running zig2 on aarch64-macos.
 * compiler_rt: avoid using weak aliases
   - Fixes duplicate symbol when linking zig2 on aarch64-linux.

@andrewrk

I messed up the spelling of '-stack_size' making it '-stack' instead.
Will need to fix on master branch. But let's test this here before
making another master branch commit.

@jacobly0 @andrewrk

@jacobly0 @andrewrk

@jacobly0 @andrewrk

@jacobly0 @andrewrk

@jacobly0 @andrewrk

On windows we get:

    lld-link: error: undefined symbol: __stack_chk_fail
    >>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main)
    >>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main_main)
    >>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(log_scoped_28_default_29_err__anon_2764)
    >>> referenced 36192 more times

    lld-link: error: undefined symbol: __stack_chk_guard
    >>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(.refptr.__stack_chk_guard)
    >>> referenced by CMakeFiles/zig2.dir/compiler_rt.c.obj
This commit chickens out and reverts
02456a3, leaving it for a future
enhancement.
This commit adds a 637 KB binary file to the source repository. This
commit does nothing else, so it should be replaced with a different
commit before this branch is merged to avoid bloating the git
repository.

jacobly0 pushed a commit to jacobly0/zig that referenced this pull request

Dec 10, 2022
Before, --color on would affect colored compile error printing but not
affect terminal progress bar printing. It was intended for this option
to affect both; now it does.

This causes a failure when building the language reference, which
contains code for parsing terminal output and rendering HTML. Now it
must be expanded to handle 'K' and 'D' codes to simulate a terminal
cursor moving, and the CI will fail until that capability is added in a
later commit of this branch.

I extracted this change from ziglang#13560 so that the idea is not lost but we
can solve this issue separately.

Vexu pushed a commit that referenced this pull request

Jan 3, 2023
Before, --color on would affect colored compile error printing but not
affect terminal progress bar printing. It was intended for this option
to affect both; now it does.

This causes a failure when building the language reference, which
contains code for parsing terminal output and rendering HTML. Now it
must be expanded to handle 'K' and 'D' codes to simulate a terminal
cursor moving, and the CI will fail until that capability is added in a
later commit of this branch.

I extracted this change from #13560 so that the idea is not lost but we
can solve this issue separately.

andrewrk added a commit that referenced this pull request

Jan 9, 2023
This is to work around OOM on the CI server. Once #13560 is complete,
we can avoid having to replace the tarballs so often.