File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ $(BUILD_DIR)/macos-arm64/crc: $(SOURCES)
106106$(BUILD_DIR ) /linux-amd64/crc : $(SOURCES )
107107 GOOS=linux GOARCH=amd64 go build -tags " $( BUILDTAGS) " -ldflags=" $( LDFLAGS) " -o $@ $(GO_EXTRA_BUILDFLAGS ) ./cmd/crc
108108
109+ $(BUILD_DIR ) /linux-arm64/crc : $(SOURCES )
110+ GOOS=linux GOARCH=arm64 go build -tags " $( BUILDTAGS) " -ldflags=" $( LDFLAGS) " -o $@ $(GO_EXTRA_BUILDFLAGS ) ./cmd/crc
111+
109112$(BUILD_DIR ) /windows-amd64/crc.exe : $(SOURCES )
110113 GOARCH=amd64 GOOS=windows go build -tags " $( BUILDTAGS) " -ldflags=" $( LDFLAGS) " -o $@ $(GO_EXTRA_BUILDFLAGS ) ./cmd/crc
111114
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ CRC's main executable}
1919%global golicenses LICENSE
2020%global godocs *.md
2121
22+ %ifarch x86_64
23+ %global gohostarch amd64
24+ %endif
25+ %ifarch aarch64
26+ %global gohostarch arm64
27+ %endif
2228
2329Name: %{goname}
2430Release: 1%{?dist}
@@ -65,7 +71,7 @@ make COMMIT_SHA=__COMMIT_SHA__ GO_EXTRA_LDFLAGS="-B 0x$(head -c20 /dev/urandom|o
6571%install
6672# with fedora macros: gopkginstall
6773install -m 0755 -vd %{buildroot}%{_bindir}
68- install -m 0755 -vp %{gobuilddir}/src/%{goipath}/out/linux-amd64 /crc %{buildroot}%{_bindir}/
74+ install -m 0755 -vp %{gobuilddir}/src/%{goipath}/out/linux-%{gohostarch} /crc %{buildroot}%{_bindir}/
6975
7076install -d %{buildroot}%{_datadir}/%{name}-redistributable/{linux,macos,windows}
7177install -m 0755 -vp %{gobuilddir}/src/%{goipath}/release/* %{buildroot}%{_datadir}/%{name}-redistributable/linux/
Original file line number Diff line number Diff line change @@ -139,9 +139,18 @@ func fixAdminHelperExecutableCached() error {
139139
140140func checkSupportedCPUArch () error {
141141 logging .Debugf ("GOARCH is %s GOOS is %s" , runtime .GOARCH , runtime .GOOS )
142- // Only supported arches are amd64, and arm64 on macOS
143- if runtime .GOARCH == "amd64" || (runtime .GOARCH == "arm64" && runtime .GOOS == "darwin" ) {
142+ // Only supported arches are amd64, and arm64 on macOS & Linux
143+ switch runtime .GOARCH {
144+ case "amd64" :
144145 return nil
146+ case "arm64" :
147+ if runtime .GOOS == "darwin" {
148+ return nil
149+ }
150+ if runtime .GOOS == "linux" {
151+ logging .Warnf ("CRC is not officially supported on ARM64 CPUs for Linux." )
152+ return nil
153+ }
145154 }
146155 return fmt .Errorf ("CRC can only run on AMD64/Intel64 CPUs and Apple silicon" )
147156}
You can’t perform that action at this time.
0 commit comments