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

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