> Now, again, I need to know:
>
> - distribution
> - host kernel
I am running "Debian" on my machine. Its "2.6.18" and version #1 Fri
Nov 10 16:55:51 IST 2006.
> - glibc version used
glibc version is 1.2.10
{{{
$glib-config --version
1.2.10
}}}
> - whether the host processor/distro is a 64-bit one
My machine is 32 bit.

gcc version is
{{{
$gcc --version
gcc (GCC) 4.1.2 20061028 (prerelease) (Debian 4.1.1-19)
}}}

>
> Hmm, there are some glibc which cache the result of getpid(), so we use
> syscall(getpid). It seems this is happening again here, but it's strange. I
> looked in 2.6.18 source code and the bug had already been fixed.
>

I guess, I know the problem now...
When I tried to compile vanilla kernel-2.6.18 with "make linux
ARCH=um" gives following errors, and I had to do these modifications
to make it compile. And one of the modification is about "getpid()".
Here I am giving u the error, and what I did for that.
{{{
arch/um/os-Linux/process.c:144: error: expected declaration specifiers
or '...' before 'getpid'
arch/um/os-Linux/process.c:146: warning: return type defaults to 'int'
arch/um/os-Linux/process.c: In function '_syscall0':
arch/um/os-Linux/process.c:147: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:152: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:158: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:173: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:183: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:197: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:207: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:242: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:254: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:274: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '{' token
arch/um/os-Linux/process.c:144: error: parameter name omitted
arch/um/os-Linux/process.c:284: error: expected '{' at end of input
make[1]: *** [arch/um/os-Linux/process.o] Error 1
}}}

This error comes because "arch/um/os-Linux/process.c" has following statement
{{{
inline _syscall0(pid_t, getpid)
}}}
And this statement is the one which is giving error.
When I commented it, the compilation went ahead.

Now, I can see that how this small modification of mine has created the problem.
Can u tell me, what should I do with this statement so that I will get
rid of above error ?
------------------------------------------------------------------------------
There were few other errors also which I came across in compilation
process. Here I am giving all of them bellow...
{{{
arch/um/os-Linux/skas/process.c: In function 'copy_context_skas0':
arch/um/os-Linux/skas/process.c:328: error: 'PAGE_SHIFT' undeclared
(first use in this function)
arch/um/os-Linux/skas/process.c:328: error: (Each undeclared
identifier is reported only once
arch/um/os-Linux/skas/process.c:328: error: for each function it appears in.)
arch/um/os-Linux/skas/process.c:560:2: warning: #warning need cpu pid
in switch_mm_skas
make[2]: *** [arch/um/os-Linux/skas/process.o] Error 1
}}}
Here, I added
{{{
#define PAGE_SHIFT 12
}}}
in "arch/um/os-Linux/skas/process.c:328"
I got this value of PAGE_SHIFT by doing some grepping.
----------------------------------------------------------------------------------
{{{
arch/um/os-Linux/sys-i386/tls.c:6: error: expected declaration
specifiers or '...' before 'get_thread_area'
arch/um/os-Linux/sys-i386/tls.c:6: error: expected declaration
specifiers or '...' before 'u_info'
arch/um/os-Linux/sys-i386/tls.c:6: warning: type defaults to 'int' in
declaration of '_syscall1'
arch/um/os-Linux/sys-i386/tls.c: In function 'check_host_supports_tls':
arch/um/os-Linux/sys-i386/tls.c:20: warning: implicit declaration of
function 'get_thread_area'
make[2]: *** [arch/um/os-Linux/sys-i386/tls.o] Error 1
}}}

This error is similar to the first error that I was getting,
This time, It was for following line in "arch/um/os-Linux/sys-i386/tls.c"
{{{
 static _syscall1(int, get_thread_area, user_desc_t *, u_info);
}}}
So, I again commented this line also.
-----------------------------------------------------------------------------------------
{{{
  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/um/os-Linux/built-in.o: In function `check_host_supports_tls':
(.text+0x3f27): undefined reference to `get_thread_area'
collect2: ld returned 1 exit status
  KSYM    .tmp_kallsyms1.S
nm: '.tmp_vmlinux1': No such file
No valid symbol.
make: *** [.tmp_kallsyms1.S] Error 1
}}}
Here, "get_thread_area" function name is wrong I suppose.
After doing some grepping, i got "sys_get_thread_area" name for it.
So, I modified "get_thread_area" with "sys_get_thread_area".
-------------------------------------------------------------------------------------
After doing all above modifications, I got linux-2.6.18 compiling.
But I guess my ad-hoc modifications has broken the UML working.
Can I know which of above modifications are not proper.
And how should I avoid them

>
> Btw, adding stderr=1 should make UML print its error message in such cases.
Where I have to add stderr=1 ?
in UML command-line parameter to UML ?

> --
> Inform me of my mistakes, so I can add them to my list!
> Paolo Giarrusso, aka Blaisorblade
> http://www.user-mode-linux.org/~blaisorblade
>


-- 
 Pravin Shinde

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to