Skip to content

Commit

Permalink
Zig improvements (compiler-explorer#7355)
Browse files Browse the repository at this point in the history
- Make it easy/possible to run compiler-explorer-zig locally (see first
commit)
- Dont strip debug info, add explicit flag for this (second commit)
- Allow filtering library functions. (it doesn't work super great atm,
but at least some of the hundreds of thousands of lines get filtered
out).
  • Loading branch information
Waqar144 authored Feb 8, 2025
1 parent 5d7f261 commit 877aa55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion etc/config/zig.defaults.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
compilers=/usr/bin/zig
compilers=zig:/usr/bin/zig
supportsBinary=true
compilerType=zig
objdumper=objdump
versionFlag=version
binaryHideFuncRe=^(_.*|call_gmon_start|(de)?register_tm_clones|frame_dummy|.*@plt.*)$
isSemVer=true
semver=trunk
supportsLibraryCodeFilter=true

#################################
#################################
Expand Down
3 changes: 2 additions & 1 deletion lib/compilers/zig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export class ZigCompiler extends BaseCompiler {
if (this.self_hosted_cli) {
// Versions after 0.6.0 use a different command line interface.
const outputDir = path.dirname(outputFilename);
options.push('--cache-dir', outputDir, '--name', name);
// -fno-strip: Do not strip debug info
options.push('--cache-dir', outputDir, '--name', name, '-fno-strip');

if (filters.binary) {
options.push('-femit-bin=' + desiredName);
Expand Down

0 comments on commit 877aa55

Please sign in to comment.