dingjian / rpms / kernel-rt

Forked from rpms/kernel-rt 3 years ago
Clone

Blame SOURCES/avoid-debuginfo-hash-collision-scripts.patch

6f37c6
From d6c9ac2154fa4f4f71ea3c2072922e954b73f3e1 Mon Sep 17 00:00:00 2001
6f37c6
From: Clark Williams <williams@redhat.com>
6f37c6
Date: Wed, 20 Jul 2016 10:50:33 -0500
6f37c6
Subject: [PATCH] avoid debuginfo hash collision scripts
54527e
6f37c6
Signed-off-by: Clark Williams <williams@redhat.com>
6f37c6
---
6f37c6
 arch/x86/vdso/Makefile                  | 3 +++
6f37c6
 arch/x86/vdso/vclock_gettime.c          | 2 ++
6f37c6
 arch/x86/vdso/vdso32-setup.c            | 2 ++
6f37c6
 arch/x86/vdso/vdso32/note.S             | 1 +
6f37c6
 scripts/Makefile                        | 2 +-
6f37c6
 scripts/Makefile.build                  | 2 +-
6f37c6
 scripts/asn1_compiler.c                 | 2 ++
6f37c6
 scripts/basic/Makefile                  | 1 +
6f37c6
 scripts/basic/bin2c.c                   | 2 ++
6f37c6
 scripts/basic/fixdep.c                  | 2 ++
6f37c6
 scripts/genksyms/Makefile               | 1 +
6f37c6
 scripts/genksyms/genksyms.c             | 2 ++
6f37c6
 scripts/kallsyms.c                      | 2 ++
6f37c6
 scripts/kconfig/Makefile                | 3 +++
6f37c6
 scripts/kconfig/conf.c                  | 2 ++
6f37c6
 scripts/mod/Makefile                    | 1 +
6f37c6
 scripts/mod/mk_elfconfig.c              | 2 ++
6f37c6
 scripts/mod/modpost.c                   | 2 ++
6f37c6
 scripts/recordmcount.c                  | 2 ++
6f37c6
 scripts/selinux/genheaders/Makefile     | 2 +-
6f37c6
 scripts/selinux/genheaders/genheaders.c | 1 +
6f37c6
 scripts/selinux/mdp/Makefile            | 2 +-
6f37c6
 scripts/selinux/mdp/mdp.c               | 2 ++
6f37c6
 scripts/sortextable.c                   | 2 ++
6f37c6
 scripts/unifdef.c                       | 2 ++
6f37c6
 25 files changed, 43 insertions(+), 4 deletions(-)
54527e
54527e
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
6f37c6
index 10596e431f0e..26e6cf48ff0e 100644
54527e
--- a/arch/x86/vdso/Makefile
54527e
+++ b/arch/x86/vdso/Makefile
6f37c6
@@ -4,6 +4,9 @@
54527e
 #
6f37c6
 OBJECT_FILES_NON_STANDARD	:= y
0d397f
54527e
+KBUILD_CFLAGS += -DDBGNFO=\"$(KERNELRELEASE)\"
54527e
+KBUILD_AFLAGS += -DDBGNFO=\"$(KERNELRELEASE)\"
54527e
+
54527e
 VDSO64-$(CONFIG_X86_64)		:= y
54527e
 VDSOX32-$(CONFIG_X86_X32_ABI)	:= y
54527e
 VDSO32-$(CONFIG_X86_32)		:= y
54527e
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
6f37c6
index fe52205d9263..92be9cdbae49 100644
54527e
--- a/arch/x86/vdso/vclock_gettime.c
54527e
+++ b/arch/x86/vdso/vclock_gettime.c
6f37c6
@@ -27,6 +27,8 @@
0d397f
54527e
 #define gtod (&VVAR(vsyscall_gtod_data))
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 notrace static cycle_t vread_tsc(void)
54527e
 {
6f37c6
 	cycle_t ret = (cycle_t)rdtsc_ordered();
54527e
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
6f37c6
index 0faad646f5fd..f57656b9e60b 100644
54527e
--- a/arch/x86/vdso/vdso32-setup.c
54527e
+++ b/arch/x86/vdso/vdso32-setup.c
54527e
@@ -76,6 +76,8 @@ __setup_param("vdso=", vdso32_setup, vdso_setup, 0);
54527e
 EXPORT_SYMBOL_GPL(vdso_enabled);
54527e
 #endif
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static __init void reloc_symtab(Elf32_Ehdr *ehdr,
54527e
 				unsigned offset, unsigned size)
54527e
 {
54527e
diff --git a/arch/x86/vdso/vdso32/note.S b/arch/x86/vdso/vdso32/note.S
6f37c6
index c83f25734696..6e25bcc8a40f 100644
54527e
--- a/arch/x86/vdso/vdso32/note.S
54527e
+++ b/arch/x86/vdso/vdso32/note.S
54527e
@@ -11,6 +11,7 @@
54527e
    kernel's name. */
54527e
 ELFNOTE_START(Linux, 0, "a")
54527e
 	.long LINUX_VERSION_CODE
54527e
+	.string DBGNFO
54527e
 ELFNOTE_END
0d397f
54527e
 #ifdef CONFIG_XEN
54527e
diff --git a/scripts/Makefile b/scripts/Makefile
6f37c6
index 62e6cc222fb0..befe20a87dd8 100644
54527e
--- a/scripts/Makefile
54527e
+++ b/scripts/Makefile
54527e
@@ -8,7 +8,7 @@
54527e
 # conmakehash:	 Create arrays for initializing the kernel console tables
54527e
 # docproc:       Used in Documentation/DocBook
0d397f
54527e
-HOST_EXTRACFLAGS += -I$(srctree)/tools/include
54527e
+HOST_EXTRACFLAGS += -I$(srctree)/tools/include -DDBGNFO=\"$(KERNELRELEASE)\"
0d397f
54527e
 hostprogs-$(CONFIG_KALLSYMS)     += kallsyms
54527e
 hostprogs-$(CONFIG_LOGO)         += pnmtologo
54527e
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
6f37c6
index 61527b09ac66..63a8316fe46c 100644
54527e
--- a/scripts/Makefile.build
54527e
+++ b/scripts/Makefile.build
54527e
@@ -19,7 +19,7 @@ targets :=
54527e
 subdir-y :=
54527e
 subdir-m :=
54527e
 EXTRA_AFLAGS   :=
54527e
-EXTRA_CFLAGS   :=
54527e
+EXTRA_CFLAGS   := -DDBGNFO=\"$(KernelVer)\"
54527e
 EXTRA_CPPFLAGS :=
54527e
 EXTRA_LDFLAGS  :=
54527e
 asflags-y  :=
54527e
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
6f37c6
index ec2ed45e20f6..58c8f6a21307 100644
54527e
--- a/scripts/asn1_compiler.c
54527e
+++ b/scripts/asn1_compiler.c
54527e
@@ -20,6 +20,8 @@
54527e
 #include <sys/stat.h>
54527e
 #include <linux/asn1_ber_bytecode.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 enum token_type {
54527e
 	DIRECTIVE_ABSENT,
54527e
 	DIRECTIVE_ALL,
54527e
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile
6f37c6
index ec10d9345bc2..c3092e084a39 100644
54527e
--- a/scripts/basic/Makefile
54527e
+++ b/scripts/basic/Makefile
54527e
@@ -8,6 +8,7 @@
54527e
 # ---------------------------------------------------------------------------
54527e
 # fixdep: 	 Used to generate dependency information during build process
0d397f
54527e
+HOST_EXTRACFLAGS += -DDBGNFO=\"$(KERNELRELEASE)\"
54527e
 hostprogs-y	:= fixdep
54527e
 hostprogs-$(CONFIG_BUILD_BIN2C)     += bin2c
54527e
 always		:= $(hostprogs-y)
54527e
diff --git a/scripts/basic/bin2c.c b/scripts/basic/bin2c.c
6f37c6
index af187e695345..24ee6e493fcf 100644
54527e
--- a/scripts/basic/bin2c.c
54527e
+++ b/scripts/basic/bin2c.c
54527e
@@ -9,6 +9,8 @@
0d397f
54527e
 #include <stdio.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 int main(int argc, char *argv[])
54527e
 {
54527e
 	int ch, total = 0;
54527e
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
6f37c6
index 078fe1d64e7d..d8a993d5b22f 100644
54527e
--- a/scripts/basic/fixdep.c
54527e
+++ b/scripts/basic/fixdep.c
54527e
@@ -120,6 +120,8 @@
54527e
 #define INT_NFIG ntohl(0x4e464947)
54527e
 #define INT_FIG_ ntohl(0x4649475f)
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 char *target;
54527e
 char *depfile;
54527e
 char *cmdline;
54527e
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
6f37c6
index aca33b98bf63..fe64439746c7 100644
54527e
--- a/scripts/genksyms/Makefile
54527e
+++ b/scripts/genksyms/Makefile
54527e
@@ -1,4 +1,5 @@
0d397f
54527e
+HOST_EXTRACFLAGS += -DDBGNFO=\"$(KERNELRELEASE)\"
54527e
 hostprogs-y	:= genksyms
54527e
 always		:= $(hostprogs-y)
0d397f
54527e
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
6f37c6
index 88632df4381b..a89629b8acd7 100644
54527e
--- a/scripts/genksyms/genksyms.c
54527e
+++ b/scripts/genksyms/genksyms.c
54527e
@@ -36,6 +36,8 @@
0d397f
54527e
 #define HASH_BUCKETS  4096
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static struct symbol *symtab[HASH_BUCKETS];
54527e
 static FILE *debugfile;
0d397f
54527e
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
6f37c6
index 9a11f9f799f4..1d544535f8de 100644
54527e
--- a/scripts/kallsyms.c
54527e
+++ b/scripts/kallsyms.c
54527e
@@ -29,6 +29,8 @@
0d397f
54527e
 #define KSYM_NAME_LEN		128
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 struct sym_entry {
54527e
 	unsigned long long addr;
54527e
 	unsigned int len;
54527e
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
6f37c6
index 844bc9da08da..65a1b02c4d9c 100644
54527e
--- a/scripts/kconfig/Makefile
54527e
+++ b/scripts/kconfig/Makefile
54527e
@@ -2,6 +2,9 @@
54527e
 # Kernel configuration targets
54527e
 # These targets are used from top-level makefile
0d397f
54527e
+HOST_EXTRACFLAGS += -DDBGNFO=\"$(KernelVer)\"
54527e
+KBUILD_CFLAGS += -DDBGNFO=\"$(KernelVer)\"
54527e
+
54527e
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
54527e
 	localmodconfig localyesconfig
0d397f
54527e
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
6f37c6
index bde5b95c8c19..f8328c349294 100644
54527e
--- a/scripts/kconfig/conf.c
54527e
+++ b/scripts/kconfig/conf.c
54527e
@@ -17,6 +17,8 @@
0d397f
54527e
 #include "lkc.h"
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static void conf(struct menu *menu);
54527e
 static void check_conf(struct menu *menu);
54527e
 static void xfgets(char *str, int size, FILE *in);
54527e
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
6f37c6
index d36fbfc859bd..7034c0800401 100644
54527e
--- a/scripts/mod/Makefile
54527e
+++ b/scripts/mod/Makefile
6f37c6
@@ -1,5 +1,6 @@
6f37c6
 OBJECT_FILES_NON_STANDARD := y
0d397f
54527e
+HOST_EXTRACFLAGS += -DDBGNFO=\"$(KERNELRELEASE)\"
54527e
 hostprogs-y	:= modpost mk_elfconfig
54527e
 always		:= $(hostprogs-y) empty.o
0d397f
54527e
diff --git a/scripts/mod/mk_elfconfig.c b/scripts/mod/mk_elfconfig.c
6f37c6
index 639bca7ba559..9babae46c4f2 100644
54527e
--- a/scripts/mod/mk_elfconfig.c
54527e
+++ b/scripts/mod/mk_elfconfig.c
54527e
@@ -3,6 +3,8 @@
54527e
 #include <string.h>
54527e
 #include <elf.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 int
54527e
 main(int argc, char **argv)
54527e
 {
54527e
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
6f37c6
index 2b64dcd22b32..bc0991ccf07e 100644
54527e
--- a/scripts/mod/modpost.c
54527e
+++ b/scripts/mod/modpost.c
54527e
@@ -23,6 +23,8 @@
54527e
 #include "../../include/generated/uapi/linux/version.h"
54527e
 #include "../../include/linux/export.h"
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 /* Are we using CONFIG_MODVERSIONS? */
54527e
 int modversions = 0;
54527e
 /* Warn about undefined symbols? (do so if we have vmlinux) */
54527e
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
6f37c6
index 9c22317778eb..52bfb472c90e 100644
54527e
--- a/scripts/recordmcount.c
54527e
+++ b/scripts/recordmcount.c
54527e
@@ -40,6 +40,8 @@
54527e
 #define R_METAG_NONE                     3
54527e
 #endif
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static int fd_map;	/* File descriptor for file being modified. */
54527e
 static int mmap_failed; /* Boolean flag. */
54527e
 static void *ehdr_curr; /* current ElfXX_Ehdr *  for resource cleanup */
54527e
diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile
6f37c6
index 417b165008ee..4ca9250ea655 100644
54527e
--- a/scripts/selinux/genheaders/Makefile
54527e
+++ b/scripts/selinux/genheaders/Makefile
54527e
@@ -1,5 +1,5 @@
54527e
 hostprogs-y	:= genheaders
54527e
-HOST_EXTRACFLAGS += -Isecurity/selinux/include
54527e
+HOST_EXTRACFLAGS += -Isecurity/selinux/include -DDBGNFO=\"$(KERNELRELEASE)\"
0d397f
54527e
 always		:= $(hostprogs-y)
54527e
 clean-files	:= $(hostprogs-y)
54527e
diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
6f37c6
index 539855ff31f9..c107add8fe33 100644
54527e
--- a/scripts/selinux/genheaders/genheaders.c
54527e
+++ b/scripts/selinux/genheaders/genheaders.c
54527e
@@ -15,6 +15,7 @@ struct security_class_mapping {
0d397f
54527e
 #define max(x, y) (((int)(x) > (int)(y)) ? x : y)
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
 const char *progname;
0d397f
54527e
 static void usage(void)
54527e
diff --git a/scripts/selinux/mdp/Makefile b/scripts/selinux/mdp/Makefile
6f37c6
index eb365b333441..96052f20cda6 100644
54527e
--- a/scripts/selinux/mdp/Makefile
54527e
+++ b/scripts/selinux/mdp/Makefile
54527e
@@ -1,5 +1,5 @@
54527e
 hostprogs-y	:= mdp
54527e
-HOST_EXTRACFLAGS += -Isecurity/selinux/include
54527e
+HOST_EXTRACFLAGS += -Isecurity/selinux/include -DDBGNFO=\"$(KERNELRELEASE)\"
0d397f
54527e
 always		:= $(hostprogs-y)
54527e
 clean-files	:= $(hostprogs-y) policy.* file_contexts
54527e
diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
6f37c6
index 62b34ce1f50d..8a50fc60989c 100644
54527e
--- a/scripts/selinux/mdp/mdp.c
54527e
+++ b/scripts/selinux/mdp/mdp.c
54527e
@@ -29,6 +29,8 @@
54527e
 #include <unistd.h>
54527e
 #include <string.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static void usage(char *name)
54527e
 {
54527e
 	printf("usage: %s [-m] policy_file context_file\n", name);
54527e
diff --git a/scripts/sortextable.c b/scripts/sortextable.c
6f37c6
index 1f10e89d15b4..2aff6ba8e5e8 100644
54527e
--- a/scripts/sortextable.c
54527e
+++ b/scripts/sortextable.c
54527e
@@ -31,6 +31,8 @@
54527e
 #include <tools/be_byteshift.h>
54527e
 #include <tools/le_byteshift.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 static int fd_map;	/* File descriptor for file being modified. */
54527e
 static int mmap_failed; /* Boolean flag. */
54527e
 static void *ehdr_curr; /* current ElfXX_Ehdr *  for resource cleanup */
54527e
diff --git a/scripts/unifdef.c b/scripts/unifdef.c
6f37c6
index 7493c0ee51cc..8fd20debd864 100644
54527e
--- a/scripts/unifdef.c
54527e
+++ b/scripts/unifdef.c
54527e
@@ -56,6 +56,8 @@
54527e
 #include <string.h>
54527e
 #include <unistd.h>
0d397f
54527e
+const char * dbgnfo = DBGNFO;
54527e
+
54527e
 const char copyright[] =
54527e
     "@(#) $Version: unifdef-2.5 $\n"
54527e
     "@(#) $Author: Tony Finch (dot@dotat.at) $\n"
0d397f
--
6f37c6
2.7.4