nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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