From efdddd6351c95f3140679d5b1c6c092359297054 Mon Sep 17 00:00:00 2001 From: arkadiam Date: Tue, 12 Jan 2021 12:25:42 -0500 Subject: [PATCH 1/2] qamel cmd: add arm64 support --- internal/cmd/profile-setup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/profile-setup.go b/internal/cmd/profile-setup.go index b136e27..abaf6dc 100644 --- a/internal/cmd/profile-setup.go +++ b/internal/cmd/profile-setup.go @@ -56,7 +56,7 @@ func profileSetupHandler(cmd *cobra.Command, args []string) { // Fetch target architecture fmt.Println() fmt.Println("Please specify the target architecture for this profile. " + - `Possible values are "386" and "amd64".` + "\n" + + `Possible values are "386", "amd64", and "arm64".` + "\n" + "Keep it empty to use your system architecture.") fmt.Println() @@ -68,7 +68,7 @@ func profileSetupHandler(cmd *cobra.Command, args []string) { } switch targetArch { - case "386", "amd64": + case "386", "amd64", "arm64": default: cRedBold.Printf("Architecture %s is not supported\n", targetArch) os.Exit(1) From ecf2c191067467a9c0d5289d5883d124a8cceabd Mon Sep 17 00:00:00 2001 From: arkadiam Date: Tue, 12 Jan 2021 12:34:31 -0500 Subject: [PATCH 2/2] generator cgo: add arm64 support --- internal/generator/cgo.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/generator/cgo.go b/internal/generator/cgo.go index 4b04368..28cf729 100644 --- a/internal/generator/cgo.go +++ b/internal/generator/cgo.go @@ -136,6 +136,8 @@ func createCgoFlags(profile config.Profile, projectDir string) (string, error) { if _, ok := mapCompiler["EXPORT_ARCH_ARGS"]; ok { if profile.Arch == "amd64" { mapCompiler["EXPORT_ARCH_ARGS"] = "-arch x86_64" + } else if profile.Arch == "arm64" { + mapCompiler["EXPORT_ARCH_ARGS"] = "-arch aarch64" } else { mapCompiler["EXPORT_ARCH_ARGS"] = "-arch i386" }