-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
.github, config: use Zig to cross compile arm64 Linux asset #460
Commits on Aug 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 0546176 - Browse repository at this point
Copy the full SHA 0546176View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4dae1da - Browse repository at this point
Copy the full SHA 4dae1daView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc75361 - Browse repository at this point
Copy the full SHA bc75361View commit details -
nimble: strip comment section from binary
With the Zig 0.9.0 release (2021-12-20), the configlet binary now has 30 KiB of bloat in the comment section, repeating the clang version many times. Before this commit: $ readelf -p .comment ./configlet String dump of section '.comment': [ 0] clang version 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 74211dd7f7e7174a2027641dfcfdb3fc5df62f0c) [...] (repeat for 30 KB) [ 7969] clang version 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 74211dd7f7e7174a2027641dfcfdb3fc5df62f0c) [ 79d2] Linker: LLD 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 74211dd7f7e7174a2027641dfcfdb3fc5df62f0c) Binary size profile before this commit: FILE SIZE VM SIZE -------------- -------------- 75.2% 368Ki 64.5% 368Ki .text 0.0% 0 19.6% 111Ki .bss 18.2% 89.1Ki 15.6% 89.1Ki .rodata 6.2% 30.6Ki 0.0% 0 .comment 0.2% 816 0.1% 824 .data 0.1% 640 0.0% 0 [ELF Section Headers] 0.1% 392 0.1% 392 [ELF Program Headers] 0.0% 64 0.0% 64 [ELF Header] 0.0% 63 0.0% 0 .shstrtab 0.0% 8 0.0% 8 .got 0.0% 8 0.0% 8 [LOAD #1 [R]] 0.0% 4 0.0% 3 .fini 0.0% 3 0.0% 3 .init 100.0% 489Ki 100.0% 570Ki TOTAL Strip the comment section. But print it first.
Configuration menu - View commit details
-
Copy full SHA for ceef0c0 - Browse repository at this point
Copy the full SHA ceef0c0View commit details -
nimble: remove
-s
flag fromstrip
commandWith Zig 0.10.0 (2022-10-31), `zig cc` now properly uses the `--passL: -s` option that we use in `config.nims`. So we can remove the `-s` flag from our post-build hook. From the Zig 0.10.0 release notes [1]: `zig cc` is Zig's drop-in C compiler tool. Enhancements in this release: [...] - Integration with more linker args: - `--whole-archive`, `-whole-archive` - `--no-whole-archive`, `-no-whole-archive` - `-s`, `--strip-all` - `-S`, `--strip-debug` [...] [1] https://ziglang.org/download/0.10.0/release-notes.html#zig-cc
Configuration menu - View commit details
-
Copy full SHA for c3254b7 - Browse repository at this point
Copy the full SHA c3254b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4cf6be - Browse repository at this point
Copy the full SHA c4cf6beView commit details -
.github, config: cross-compile an arm64 asset
And install Zig via script, rather than snap. One benefit is that it allows us to pin a Zig version. The script is adapted from one I added to the Exercism Zig repo [1]. [1] exercism/zig@9dfb95f031b1
Configuration menu - View commit details
-
Copy full SHA for 0fd7591 - Browse repository at this point
Copy the full SHA 0fd7591View commit details -
`strip` can't strip a non-native executable.
Configuration menu - View commit details
-
Copy full SHA for abb70ab - Browse repository at this point
Copy the full SHA abb70abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8df0f9b - Browse repository at this point
Copy the full SHA 8df0f9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6aaed8 - Browse repository at this point
Copy the full SHA f6aaed8View commit details -
.github(cross-compile): try --os:macosx
--os:macos produced the error: /home/runner/work/configlet/configlet/nimdir/lib/system/dyncalls.nim(198, 10) Error: no implementation for dyncalls
Configuration menu - View commit details
-
Copy full SHA for d4403d3 - Browse repository at this point
Copy the full SHA d4403d3View commit details -
config: disable LTO for zig + macos
Try to resolve error: error: LTO is not yet supported with the Mach-O object format. More details: ziglang/zig#8680 Error: execution of an external compiler program 'zigcc -c -w -ferror-limit=3 -pthread -target aarch64-macos-none -flto -Os -I/home/runner/work/configlet/configlet/nimdir/lib -I/home/runner/work/configlet/configlet/src -o /home/runner/.cache/nim/configlet_r/@m..@snimdir@slib@ssystem@sctypes.nim.c.o /home/runner/.cache/nim/configlet_r/@m..@snimdir@slib@ssystem@sctypes.nim.c' failed with exit code: 1
Configuration menu - View commit details
-
Copy full SHA for 97893f7 - Browse repository at this point
Copy the full SHA 97893f7View commit details -
.github(cross-compile): disable aarch-macos target for now
Disable until we can resolve the error CC: ../nimdir/lib/std/sysrand.nim /home/runner/.cache/nim/configlet_r/@m..@snimdir@slib@sstd@ssysrand.nim.c:9:10: fatal error: 'Security/SecRandom.h' file not found which is due to a recent commit [1]. [1] 53a75a2 ("nimble, uuid: generate UUIDs via std/sysrand, not pragmagic/uuids", 2023-08-07)
Configuration menu - View commit details
-
Copy full SHA for 62ed28c - Browse repository at this point
Copy the full SHA 62ed28cView commit details
Commits on Aug 15, 2023
-
.github(cross-compile): try aarch64-windows-gnu
This probably won't work immmediately.
Configuration menu - View commit details
-
Copy full SHA for 83796fe - Browse repository at this point
Copy the full SHA 83796feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f8c8df - Browse repository at this point
Copy the full SHA 3f8c8dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 21bf654 - Browse repository at this point
Copy the full SHA 21bf654View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67dbdd5 - Browse repository at this point
Copy the full SHA 67dbdd5View commit details -
.github(cross-compile), nimble: prepare to strip with llvm-strip
Our `strip` doesn't support elf64-aarch64 as a target, and `zig objcopy` doesn't have a `-R, --remove-section` option. Use llvm-strip when it's installed.
Configuration menu - View commit details
-
Copy full SHA for eea45c8 - Browse repository at this point
Copy the full SHA eea45c8View commit details -
.github(cross-compile): format with shfmt
Format with shfmt -i 2 -sr -kp -ci -w ./cross-compile
Configuration menu - View commit details
-
Copy full SHA for 3e97a25 - Browse repository at this point
Copy the full SHA 3e97a25View commit details