[LITMUS^RT] Error compiling litmus kernel

Daniele Accattoli d.acca87 at gmail.com
Tue May 14 11:13:15 CEST 2013


Il 04/05/2013 12:08, Björn Brandenburg ha scritto:
> On May 4, 2013, at 11:55 AM, Björn Brandenburg<bbb at mpi-sws.org>  wrote:
>>> litmus/built-in.o: In function `sys_release_ts':
>>> /home/marvin2/litmus_git/litmus-rt/litmus/sync.c:147: undefined
>>> reference to `__aeabi_uldivmod'
>>> make: *** [.tmp_vmlinux1] Error 1
>> This means litmus/sync.c is doing an integer division without using the proper macros. I'll look into it.
> I've pushed a branch that should fix this error to  prop/compile-fixes on GitHub.  The branch should also resolve the compilation error in sched_pfp.c
>
> - Björn
>
>
> _______________________________________________
> litmus-dev mailing list
> litmus-dev at lists.litmus-rt.org
> https://lists.litmus-rt.org/listinfo/litmus-dev
Thanks a lot for your help, all the error for litmus are resolved.

For this error:

litmus/built-in.o: In function `__cmpxchg':
/home/marvin2/litmus_git/litmus-rt/arch/arm/include/asm/system.h:422:
undefined reference to `__bad_cmpxchg'

I've found that it's a error in the kernel source code, and the file that must contain the function are:

/Linux/arch/arm/include/asm/system.h - for the header, and the function is defined extern
/Linux/arch/arm/kernel/traps.c - for the function code, and there is no function named __bad_cmpxchg

After a while searching on the web, I've found this patch that fix the problem:

diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -639,6 +639,14 @@ void __bad_xchg(volatile void *ptr, int size)
  }
  EXPORT_SYMBOL(__bad_xchg);
  
+void __bad_cmpxchg(volatile void *ptr, int size)
+{
+	printk("cmpxchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n",
+		__builtin_return_address(0), ptr, size);
+	BUG();
+}
+EXPORT_SYMBOL(__bad_cmpxchg);
+
  /*
   * A data abort trap was taken, but we did not handle the instruction.
   * Try to abort the user program, or panic if it was the kernel.
  
I've applied it at the kernel and compiled the code well, thought I don't know if it is the best way
to solve the problem....

Many Thanks for all yours help!

Daniele






More information about the litmus-dev mailing list