Blame SOURCES/0189-libtasn1-compile-into-asn1-module.patch

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