From d1e40e592678b8955a8ed36bdeaf42929822302e Mon Sep 17 00:00:00 2001 From: Eunbong Song Date: Fri, 24 Apr 2015 04:36:27 +0000 Subject: [PATCH 1/2] tools/liblockdep: Fix linker error in case of cross compile If we try to cross compile liblockdep, even if we set the CROSS_COMPILE variable the linker error can occur because LD is not set with CROSS_COMPILE. This patch adds "LD" can be set automatically with CROSS_COMPILE variable so fixes linker error problem. Signed-off-by: Eunbong Song Signed-off-by: Sasha Levin --- tools/lib/lockdep/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile index 0c356fb65022..18ffccf00426 100644 --- a/tools/lib/lockdep/Makefile +++ b/tools/lib/lockdep/Makefile @@ -14,9 +14,10 @@ define allow-override $(eval $(1) = $(2))) endef -# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix. +# Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix. $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,AR,$(CROSS_COMPILE)ar) +$(call allow-override,LD,$(CROSS_COMPILE)ld) INSTALL = install From 2480257fb17ba0fdaf62bc8c2406bd08d5e7f8f1 Mon Sep 17 00:00:00 2001 From: Eunbong Song Date: Wed, 13 May 2015 06:02:32 -0400 Subject: [PATCH 2/2] tools/liblockdep: Fix compilation error Recent changes to kernel/locking/lockdep.c broke the liblockdep build. Fix that. Signed-off-by: Eunbong Song Signed-off-by: Sasha Levin --- tools/lib/lockdep/uinclude/linux/kernel.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h index a11e3c357be7..cd2cc59a5da7 100644 --- a/tools/lib/lockdep/uinclude/linux/kernel.h +++ b/tools/lib/lockdep/uinclude/linux/kernel.h @@ -28,6 +28,9 @@ #define __init #define noinline #define list_add_tail_rcu list_add_tail +#define list_for_each_entry_rcu list_for_each_entry +#define barrier() +#define synchronize_sched() #ifndef CALLER_ADDR0 #define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))