Messages in this thread | | | Subject | Re: [PATCH 1/7] liblockdep: Fix undefined symbol prandom_u32 | From | Sasha Levin <> | Date | Tue, 14 Jun 2016 17:31:29 -0400 |
| |
On 06/14/2016 04:47 PM, Ben Hutchings wrote: > __lock_pin_lock() now calls prandom_u32() which is not defined in > liblockdep. __lock_pin_lock() and its caller lock_pin_lock() are dead > code in liblockdep, but we still need to provide a definition of > prandom_u32() in case lazy binding is disabled. > > Fixes: e7904a28f533 ("locking/lockdep, sched/core: Implement a better ...") > Signed-off-by: Ben Hutchings <ben@decadent.org.uk> > --- > tools/lib/lockdep/common.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/lib/lockdep/common.c b/tools/lib/lockdep/common.c > index d1c89cc06f5f..405c17667c4d 100644 > --- a/tools/lib/lockdep/common.c > +++ b/tools/lib/lockdep/common.c > @@ -1,5 +1,6 @@ > #include <stddef.h> > #include <stdbool.h> > +#include <stdlib.h> > #include <linux/compiler.h> > #include <linux/lockdep.h> > #include <unistd.h> > @@ -10,6 +11,11 @@ static __thread struct task_struct current_obj; > /* lockdep wants these */ > bool debug_locks = true; > bool debug_locks_silent; > +u32 prandom_u32(void) > +{ > + /* Used only by lock_pin_lock() which is dead code */ > + abort(); > +}
I had to place this bit in lockdep.c rather than common.c, since lockdep.c is the one building kernel/lockdep.c.
Thanks, Sasha
[unhandled content-type:application/pgp-signature] | |