third_party/gnuefi: init
Adds GNU EFI, not for the hacky trampolines but for the EFI headers
and the standard library.
The "canonical" EDK II headers are extremely hard to use so almost
everyone not inside the EDK II uses these.
Change-Id: I1189bb4c0897e9fed0da3e6471092d7fb09646cb
Reviewed-on: https://review.monogon.dev/c/monogon/+/334
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/third_party/gnuefi/BUILD b/third_party/gnuefi/BUILD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/third_party/gnuefi/BUILD
diff --git a/third_party/gnuefi/external.bzl b/third_party/gnuefi/external.bzl
new file mode 100644
index 0000000..e9e9351
--- /dev/null
+++ b/third_party/gnuefi/external.bzl
@@ -0,0 +1,14 @@
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+def gnuefi_external(name, version):
+ sums = {
+ "3.0.14": "b73b643a0d5697d1f396d7431448e886dd805668789578e3e1a28277c9528435",
+ }
+
+ http_archive(
+ name = name,
+ sha256 = sums[version],
+ build_file = "@//third_party/gnuefi:gnuefi.bzl",
+ strip_prefix = "gnu-efi-%s" % version,
+ urls = ["https://netix.dl.sourceforge.net/project/gnu-efi/gnu-efi-%s.tar.bz2" % version],
+ )
diff --git a/third_party/gnuefi/gnuefi.bzl b/third_party/gnuefi/gnuefi.bzl
new file mode 100644
index 0000000..adb3a82
--- /dev/null
+++ b/third_party/gnuefi/gnuefi.bzl
@@ -0,0 +1,10 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+cc_library(
+ name = "gnuefi",
+ srcs = glob(["lib/*.c", "lib/runtime/*.c", "lib/x86_64/*.c"]),
+ hdrs = glob(["inc/**/*.h"]),
+ # Consumers expect this to be a system library, so add it to the transitive include paths
+ includes = ["inc", "inc/x86_64"],
+ visibility = ["//visibility:public"],
+)