2014-04-01 06:05:08

by EUNBONG SONG

[permalink] [raw]
Subject: tools/liblockdep: Build failure


There is tools/liblockdep build failure.
I have been trying to find the cause and i found commit id 63f9a7fde715352e0769302527670542a664b981 is the casue.

Author: Andi Kleen <[email protected]>
Date: Sat Feb 8 08:52:01 2014 +0100

asmlinkage: Make lockdep_sys_exit asmlinkage

lockdep_sys_exit can be called from assembler code, so make it
asmlinkage.

Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: H. Peter Anvin <[email protected]>

diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 92b1bfc..7df9aa6 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -265,7 +265,7 @@ extern void lockdep_info(void);
extern void lockdep_reset(void);
extern void lockdep_reset_lock(struct lockdep_map *lock);
extern void lockdep_free_key_range(void *start, unsigned long size);
-extern void lockdep_sys_exit(void);
+extern asmlinkage void lockdep_sys_exit(void);

extern void lockdep_off(void);
extern void lockdep_on(void);
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index eb8a547..c8b6753 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4191,7 +4191,7 @@ void debug_show_held_locks(struct task_struct *task)
}
EXPORT_SYMBOL_GPL(debug_show_held_locks);

-void lockdep_sys_exit(void)
+asmlinkage void lockdep_sys_exit(void)
{
struct task_struct *curr = current;
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?


2014-04-01 08:03:17

by Robin Hack

[permalink] [raw]
Subject: Re: tools/liblockdep: Build failure

Hi.

I have same issue.

I investigated output of gcc -E and I found that asmlinkage macro isn't
expanded as is expected.

$ grep asmlinkage common.o
asmlinkage extern void lockdep_sys_exit(void);

On Tue, Apr 01, 2014 at 06:04:35AM +0000, Eunbong Song wrote:
>
> There is tools/liblockdep build failure.
> I have been trying to find the cause and i found commit id 63f9a7fde715352e0769302527670542a664b981 is the casue.
>
> Author: Andi Kleen <[email protected]>
> Date: Sat Feb 8 08:52:01 2014 +0100
>
> asmlinkage: Make lockdep_sys_exit asmlinkage
>
> lockdep_sys_exit can be called from assembler code, so make it
> asmlinkage.
>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Signed-off-by: Andi Kleen <[email protected]>
> Link: http://lkml.kernel.org/r/[email protected]
> Signed-off-by: H. Peter Anvin <[email protected]>
>
> diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
> index 92b1bfc..7df9aa6 100644
> --- a/include/linux/lockdep.h
> +++ b/include/linux/lockdep.h
> @@ -265,7 +265,7 @@ extern void lockdep_info(void);
> extern void lockdep_reset(void);
> extern void lockdep_reset_lock(struct lockdep_map *lock);
> extern void lockdep_free_key_range(void *start, unsigned long size);
> -extern void lockdep_sys_exit(void);
> +extern asmlinkage void lockdep_sys_exit(void);
>
> extern void lockdep_off(void);
> extern void lockdep_on(void);
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index eb8a547..c8b6753 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4191,7 +4191,7 @@ void debug_show_held_locks(struct task_struct *task)
> }
> EXPORT_SYMBOL_GPL(debug_show_held_locks);
>
> -void lockdep_sys_exit(void)
> +asmlinkage void lockdep_sys_exit(void)
> {
> struct task_struct *curr = current;

2014-04-01 08:11:58

by Robin Hack

[permalink] [raw]
Subject: Re: tools/liblockdep: Build failure

More investigation reveals this:

(from common.o which is output of gcc -E)
# 1 "./uinclude/linux/linkage.h" 1

pwd is: linux/tools/lib/lockdep
$ cat ./uinclude/linux/linkage.h

/* empty file */


Have nice day
Robin Hack
On Tue, Apr 01, 2014 at 10:02:58AM +0200, Robin Hack wrote:
> Hi.
>
> I have same issue.
>
> I investigated output of gcc -E and I found that asmlinkage macro isn't
> expanded as is expected.
>
> $ grep asmlinkage common.o
> asmlinkage extern void lockdep_sys_exit(void);
>
> On Tue, Apr 01, 2014 at 06:04:35AM +0000, Eunbong Song wrote:
> >
> > There is tools/liblockdep build failure.
> > I have been trying to find the cause and i found commit id 63f9a7fde715352e0769302527670542a664b981 is the casue.
> >
> > Author: Andi Kleen <[email protected]>
> > Date: Sat Feb 8 08:52:01 2014 +0100
> >
> > asmlinkage: Make lockdep_sys_exit asmlinkage
> >
> > lockdep_sys_exit can be called from assembler code, so make it
> > asmlinkage.
> >
> > Cc: Peter Zijlstra <[email protected]>
> > Cc: Ingo Molnar <[email protected]>
> > Signed-off-by: Andi Kleen <[email protected]>
> > Link: http://lkml.kernel.org/r/[email protected]
> > Signed-off-by: H. Peter Anvin <[email protected]>
> >
> > diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
> > index 92b1bfc..7df9aa6 100644
> > --- a/include/linux/lockdep.h
> > +++ b/include/linux/lockdep.h
> > @@ -265,7 +265,7 @@ extern void lockdep_info(void);
> > extern void lockdep_reset(void);
> > extern void lockdep_reset_lock(struct lockdep_map *lock);
> > extern void lockdep_free_key_range(void *start, unsigned long size);
> > -extern void lockdep_sys_exit(void);
> > +extern asmlinkage void lockdep_sys_exit(void);
> >
> > extern void lockdep_off(void);
> > extern void lockdep_on(void);
> > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> > index eb8a547..c8b6753 100644
> > --- a/kernel/locking/lockdep.c
> > +++ b/kernel/locking/lockdep.c
> > @@ -4191,7 +4191,7 @@ void debug_show_held_locks(struct task_struct *task)
> > }
> > EXPORT_SYMBOL_GPL(debug_show_held_locks);
> >
> > -void lockdep_sys_exit(void)
> > +asmlinkage void lockdep_sys_exit(void)
> > {
> > struct task_struct *curr = current;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2014-04-01 10:22:11

by Robin Hack

[permalink] [raw]
Subject: [PATCH] Re: tools/liblockdep: Build failure

From: Robin Hack <[email protected]>
Copy asmlinkage macro to lockdep/uinclude/linux/linkage.h.

diff --git a/tools/lib/lockdep/uinclude/linux/linkage.h b/tools/lib/lockdep/uinclude/linux/linkage.h
index fab00ff..6799a5b 100644
--- a/tools/lib/lockdep/uinclude/linux/linkage.h
+++ b/tools/lib/lockdep/uinclude/linux/linkage.h
@@ -1,3 +1,19 @@
+#ifndef _LOCKDEP_ULINKAGE_H
+#define _LOCKDEP_ULINKAGE_H

-/* empty file */
+#if GCC_VERSION >= 40600
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
+#else
+#define __visible
+#endif

+#define CPP_ASMLINKAGE __visible
+
+#ifndef asmlinkage
+#define asmlinkage CPP_ASMLINKAGE
+#endif
+
+#endif

2014-04-01 10:34:09

by Robin Hack

[permalink] [raw]
Subject: Re: [PATCH] Re: tools/liblockdep: Build failure

Patch is wrong.
On Tue, Apr 01, 2014 at 12:21:59PM +0200, Robin Hack wrote:
> From: Robin Hack <[email protected]>
> Copy asmlinkage macro to lockdep/uinclude/linux/linkage.h.
>
> diff --git a/tools/lib/lockdep/uinclude/linux/linkage.h b/tools/lib/lockdep/uinclude/linux/linkage.h
> index fab00ff..6799a5b 100644
> --- a/tools/lib/lockdep/uinclude/linux/linkage.h
> +++ b/tools/lib/lockdep/uinclude/linux/linkage.h
> @@ -1,3 +1,19 @@
> +#ifndef _LOCKDEP_ULINKAGE_H
> +#define _LOCKDEP_ULINKAGE_H
>
> -/* empty file */
> +#if GCC_VERSION >= 40600
> +/*
> + * Tell the optimizer that something else uses this function or variable.
> + */
> +#define __visible __attribute__((externally_visible))
> +#else
> +#define __visible
> +#endif
>
> +#define CPP_ASMLINKAGE __visible
> +
> +#ifndef asmlinkage
> +#define asmlinkage CPP_ASMLINKAGE
> +#endif
> +
> +#endif
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2014-04-01 15:40:10

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Re: tools/liblockdep: Build failure

On Tue, Apr 01, 2014 at 12:21:59PM +0200, Robin Hack wrote:
> From: Robin Hack <[email protected]>
> Copy asmlinkage macro to lockdep/uinclude/linux/linkage.h.

You can just do

#define asmlinkage
#define __visible

for this case. don't need all the ifdefs or the attribute in the
userspace build.

-Andi

2014-04-01 15:47:29

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH] Re: tools/liblockdep: Build failure

On 04/01/2014 11:34 AM, Andi Kleen wrote:
> On Tue, Apr 01, 2014 at 12:21:59PM +0200, Robin Hack wrote:
>> From: Robin Hack <[email protected]>
>> Copy asmlinkage macro to lockdep/uinclude/linux/linkage.h.
>
> You can just do
>
> #define asmlinkage
> #define __visible

Thanks Andi,

I've queued it up along with another fix for Ingo.


Thanks,
Sasha