bd7cb17
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
bd7cb17
From: Daniel Axtens <dja@axtens.net>
bd7cb17
Date: Fri, 5 Jun 2020 17:47:25 +1000
bd7cb17
Subject: [PATCH] libtasn1: compile into asn1 module
bd7cb17
bd7cb17
Create a wrapper file that specifies the module license.
bd7cb17
Set up the makefile so it is built.
bd7cb17
bd7cb17
Signed-off-by: Daniel Axtens <dja@axtens.net>
bd7cb17
---
bd7cb17
 grub-core/Makefile.core.def        | 15 +++++++++++++++
bd7cb17
 grub-core/lib/libtasn1_wrap/wrap.c | 26 ++++++++++++++++++++++++++
bd7cb17
 2 files changed, 41 insertions(+)
bd7cb17
 create mode 100644 grub-core/lib/libtasn1_wrap/wrap.c
bd7cb17
bd7cb17
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
bd7cb17
index 97347ae76f9..21d2c541850 100644
bd7cb17
--- a/grub-core/Makefile.core.def
bd7cb17
+++ b/grub-core/Makefile.core.def
bd7cb17
@@ -2576,3 +2576,18 @@ module = {
bd7cb17
   common = commands/i386/wrmsr.c;
bd7cb17
   enable = x86;
bd7cb17
 };
bd7cb17
+
bd7cb17
+module = {
bd7cb17
+  name = asn1;
bd7cb17
+  common = lib/libtasn1/lib/decoding.c;
bd7cb17
+  common = lib/libtasn1/lib/coding.c;
bd7cb17
+  common = lib/libtasn1/lib/element.c;
bd7cb17
+  common = lib/libtasn1/lib/structure.c;
bd7cb17
+  common = lib/libtasn1/lib/parser_aux.c;
bd7cb17
+  common = lib/libtasn1/lib/gstr.c;
bd7cb17
+  common = lib/libtasn1/lib/errors.c;
bd7cb17
+  common = lib/libtasn1_wrap/wrap.c;
bd7cb17
+  cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
bd7cb17
+  // -Wno-type-limits comes from libtasn1's configure.ac
bd7cb17
+  cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB) -I$(srcdir)/lib/libtasn1/lib -Wno-type-limits';
bd7cb17
+};
bd7cb17
diff --git a/grub-core/lib/libtasn1_wrap/wrap.c b/grub-core/lib/libtasn1_wrap/wrap.c
bd7cb17
new file mode 100644
bd7cb17
index 00000000000..622ba942e33
bd7cb17
--- /dev/null
bd7cb17
+++ b/grub-core/lib/libtasn1_wrap/wrap.c
bd7cb17
@@ -0,0 +1,26 @@
bd7cb17
+/*
bd7cb17
+ *  GRUB  --  GRand Unified Bootloader
bd7cb17
+ *  Copyright (C) 2020 IBM Corporation
bd7cb17
+ *
bd7cb17
+ *  GRUB is free software: you can redistribute it and/or modify
bd7cb17
+ *  it under the terms of the GNU General Public License as published by
bd7cb17
+ *  the Free Software Foundation, either version 3 of the License, or
bd7cb17
+ *  (at your option) any later version.
bd7cb17
+ *
bd7cb17
+ *  GRUB is distributed in the hope that it will be useful,
bd7cb17
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bd7cb17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bd7cb17
+ *  GNU General Public License for more details.
bd7cb17
+ *
bd7cb17
+ *  You should have received a copy of the GNU General Public License
bd7cb17
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bd7cb17
+ */
bd7cb17
+
bd7cb17
+#include <grub/dl.h>
bd7cb17
+
bd7cb17
+/*
bd7cb17
+ * libtasn1 is provided under LGPL2.1+, which is compatible
bd7cb17
+ * with GPL3+. As Grub as a whole is under GPL3+, this module
bd7cb17
+ * is therefore under GPL3+ also.
bd7cb17
+ */
bd7cb17
+GRUB_MOD_LICENSE ("GPLv3+");