Displaying 5 results from an estimated 5 matches for "__nr_syscall_max".
2008 Sep 27
2
[LLVMdev] compile linux kernel
...is error probably because
LLVM is not able to handle inline assembly. I'm using LLVM-2.3
code snippet from "arch/x86_64/kernel/asm-offsets.c"
....
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
....
DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
return 0;
# make CROSS_COMPILE=llvm- V=1
llvm-gcc -Wp,-MD,arch/x86_64/kernel/.syscall.o.d -nostdinc -isystem
/home/ashish/llvm/llvm-gcc4.2-2.3.source/obj/../install/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/include
-D__KERNEL__ -Iinclude -include include/linux/autocon...
2008 Sep 28
0
[LLVMdev] compile linux kernel
...le to handle inline assembly. I'm using LLVM-2.3
>
> code snippet from "arch/x86_64/kernel/asm-offsets.c"
> ....
>
> #define DEFINE(sym, val) \
> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
> ....
>
> DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
> return 0;
>
> # make CROSS_COMPILE=llvm- V=1
>
> llvm-gcc -Wp,-MD,arch/x86_64/kernel/.syscall.o.d -nostdinc -isystem
> /home/ashish/llvm/llvm-gcc4.2-2.3.source/obj/../install/lib/gcc/
> x86_64-unknown-linux-gnu/4.2.1/include
> -D__KERNEL__ -Ii...
2008 Sep 28
3
[LLVMdev] compile linux kernel
...the IR code generated, it seems inline
assembly is being handled correctly. The preprocessing is also being
done correctly. Here is the asm-offsets.i file snippet..
...
builtin_offsetof(struct crypto_tfm,__crt_ctx)));
asm volatile("\n->" : : );
asm volatile("\n->" "__NR_syscall_max" " %0 " "sizeof(syscalls) - 1"
: : "i" (sizeof(syscalls) - 1));
return 0;
}
....
and here is the IR code snippet -
...
tail call void asm sideeffect "\0A->__NR_syscall_max $0
sizeof(syscalls) - 1", "i,~{dirflag},~{fpsr},~{flags}"( i64...
2008 Sep 27
0
[LLVMdev] compile linux kernel
On Fri, Sep 26, 2008 at 9:19 PM, Ashish Bijlani
<ashish.bijlani at gmail.com> wrote:
> Hi,
>
> I'm trying to compile linux-2.6.23.16 with llvm-2.3. Is it at all
> possible?
Yes, but it requires significant hacking, and the result for 2.6 is a
mostly bitcode kernel with a few userspace shared libraries linked in
as objcode (yes, the kernel builds .so files and includes them
2008 Sep 27
4
[LLVMdev] compile linux kernel
Hi,
I'm trying to compile linux-2.6.23.16 with llvm-2.3. Is it at all
possible? I get "Not an ELF" error. I pass "-emit-llvm" option to spit
LLVM IR, which can be JITed at runtime
$ make CROSS_COMPILE=llvm- CFLAGS="-O2 -emit-llvm"
Error: not ELF
make[2]: *** [scripts/mod/elfconfig.h] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
using