diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-23 20:26:13 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-23 20:26:13 +0900 |
| commit | 01b59a88946a6cb710f77a171c69a8904f4f4d44 (patch) | |
| tree | 9d238f418f9a0f406fb7e0976e4d090f3fb0b219 /internal/rosa | |
| parent | 2e69fc47c0e833a740fc3f6625862b2e7f7254ef (diff) | |
This makes the API easier to use, and works around nested cross-compile
state failures in LLVM.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa')
| -rw-r--r-- | internal/rosa/state.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 5b6c84cc..ac709122 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -236,12 +236,15 @@ var ErrInvalidCross = errors.New("invalid cross-compilation state") // NewCross returns a copy of s for cross-compilation. func (s *S) NewCross(arch string) *S { - if (s.native != nil && arch == s.native.Arch()) || arch == runtime.GOARCH { + if s.native != nil && arch == s.native.Arch() { panic(ErrInvalidCross) } p := s.Clone() p.native, p.arch = s, arch + if arch == runtime.GOARCH { + p.native = nil + } return p } |
