Patch circl gazelle instructions for cgo

This commit is contained in:
Mustafa Gezen 2024-10-16 13:34:49 +02:00
parent f330111606
commit 3d804027b2
2 changed files with 60 additions and 0 deletions

58
patches/circl.patch Normal file
View File

@ -0,0 +1,58 @@
diff --git a/dh/x25519/BUILD.bazel b/dh/x25519/BUILD.bazel
index d569bc1..13a942d 100644
--- a/dh/x25519/BUILD.bazel
+++ b/dh/x25519/BUILD.bazel
@@ -12,7 +12,9 @@ go_library(
"doc.go",
"key.go",
"table.go",
+ "//math/fp25519:fp_amd64.h",
],
+ cgo = True,
importpath = "github.com/cloudflare/circl/dh/x25519",
visibility = ["//visibility:public"],
deps = [
diff --git a/dh/x448/BUILD.bazel b/dh/x448/BUILD.bazel
index ed287c6..cdbd4f1 100644
--- a/dh/x448/BUILD.bazel
+++ b/dh/x448/BUILD.bazel
@@ -12,7 +12,9 @@ go_library(
"doc.go",
"key.go",
"table.go",
+ "//math/fp448:fp_amd64.h",
],
+ cgo = True,
importpath = "github.com/cloudflare/circl/dh/x448",
visibility = ["//visibility:public"],
deps = [
diff --git a/math/fp25519/BUILD.bazel b/math/fp25519/BUILD.bazel
index c9973ac..e98be64 100644
--- a/math/fp25519/BUILD.bazel
+++ b/math/fp25519/BUILD.bazel
@@ -1,5 +1,10 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+exports_files(
+ ["fp_amd64.h"],
+ visibility = ["//dh/x25519:__pkg__"],
+)
+
go_library(
name = "fp25519",
srcs = [
diff --git a/math/fp448/BUILD.bazel b/math/fp448/BUILD.bazel
index c371ca5..ebc055d 100644
--- a/math/fp448/BUILD.bazel
+++ b/math/fp448/BUILD.bazel
@@ -1,5 +1,10 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+exports_files(
+ ["fp_amd64.h"],
+ visibility = ["//dh/x448:__pkg__"],
+)
+
go_library(
name = "fp448",
srcs = [

View File

@ -171,6 +171,8 @@ def go_repositories():
) )
go_repository( go_repository(
name = "com_github_cloudflare_circl", name = "com_github_cloudflare_circl",
patch_args = ["-p1"],
patches = ["//patches:circl.patch"],
importpath = "github.com/cloudflare/circl", importpath = "github.com/cloudflare/circl",
sum = "h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=", sum = "h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=",
version = "v1.3.9", version = "v1.3.9",