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

compiler: link .syso files found in Go package directories #4593

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
Loading
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
builder, loader: link .syso files in Go package directories
Among other things, this enables WebAssembly programs to link in custom sections,
which can be stored in a relocatable wasm module with a .syso suffix in a package directory.

This will simplify the build process for WASI 0.2, removing the need to run
'wasm-tools component embed' with the original source WIT files.
  • Loading branch information
ydnar committed Nov 29, 2024
commit 2b59261c212f451435e61bee3601e10cd040d9e5
6 changes: 6 additions & 0 deletions 6 builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
}
linkerDependencies = append(linkerDependencies, job)
}

// Add .syso files
// TODO: is this the right way to do this?
for _, filename := range pkg.SysoFiles {
ldflags = append(ldflags, filepath.Join(pkg.Dir, filename))
}
}

// Linker flags from CGo lines:
Expand Down
7 changes: 4 additions & 3 deletions 7 loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ type PackageJSON struct {
}

// Source files
GoFiles []string
CgoFiles []string
CFiles []string
GoFiles []string
CgoFiles []string
CFiles []string
SysoFiles []string

// Embedded files
EmbedFiles []string
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.