public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mitch <Mitch@0Bits.COM>
To: jdike@addtoit.com, brugolsky@telemetry-investments.com,
	linux-kernel@vger.kernel.org
Subject: Re: UML build failure with 2.6.18
Date: Thu, 21 Sep 2006 01:05:27 +0400	[thread overview]
Message-ID: <4511AD17.8040108@0Bits.COM> (raw)

Hi Jeff,

That works perfectly as did the previous patch. I knew how to fix the 
problem anyhow, just wanted to know why i/if was the only person having 
thr problem. I'm running glibc-2.3.6 and gcc-4.0.3.

Cheers
Mithc

-------- Original Message --------
Subject: Re: UML build failure with 2.6.18
Date: Wed, 20 Sep 2006 13:40:26 -0400
From: Jeff Dike <jdike@addtoit.com>
To: Mitch <Mitch@0Bits.COM>
CC: linux-kernel@vger.kernel.org,        "Bill Rugolsky Jr." 
<brugolsky@telemetry-investments.com>
References: <45115EC7.2010407@0Bits.COM>

On Wed, Sep 20, 2006 at 07:31:19PM +0400, Mitch wrote:
> It's no distro (built up myself, so you can assume a gentoo type build).
> I'm building from scratch, so it should use no headers since i'm 
> building a kernel.

UML interacts with the host, by making system calls, so it needs the
host's libc headers.

Try the patch below.

				Jeff

Index: linux-2.6.17/arch/um/os-Linux/process.c
===================================================================
--- linux-2.6.17.orig/arch/um/os-Linux/process.c	2006-09-20 
11:15:08.000000000 -0400
+++ linux-2.6.17/arch/um/os-Linux/process.c	2006-09-20 
13:35:24.000000000 -0400
@@ -140,11 +140,9 @@ void os_usr1_process(int pid)
   * syscalls, and also breaks with clone(), which does not unshare the TLS.
   */

-inline _syscall0(pid_t, getpid)
-
  int os_getpid(void)
  {
-	return(getpid());
+	return syscall(__NR_getpid);
  }

  int os_getpgrp(void)
Index: linux-2.6.17/arch/um/os-Linux/sys-i386/tls.c
===================================================================
--- linux-2.6.17.orig/arch/um/os-Linux/sys-i386/tls.c	2006-06-18 
13:49:35.000000000 -0400
+++ linux-2.6.17/arch/um/os-Linux/sys-i386/tls.c	2006-09-20 
13:37:27.000000000 -0400
@@ -3,8 +3,6 @@
  #include "sysdep/tls.h"
  #include "user_util.h"

-static _syscall1(int, get_thread_area, user_desc_t *, u_info);
-
  /* Checks whether host supports TLS, and sets *tls_min according to 
the value
   * valid on the host.
   * i386 host have it == 6; x86_64 host have it == 12, for i386 
emulation. */
@@ -17,7 +15,7 @@ void check_host_supports_tls(int *suppor
  		user_desc_t info;
  		info.entry_number = val[i];

-		if (get_thread_area(&info) == 0) {
+		if(syscall(__NR_get_thread_area, &info) == 0){
  			*tls_min = val[i];
  			*supports_tls = 1;
  			return;
Index: linux-2.6.17/arch/um/os-Linux/tls.c
===================================================================
--- linux-2.6.17.orig/arch/um/os-Linux/tls.c	2006-08-15 
21:59:56.000000000 -0400
+++ linux-2.6.17/arch/um/os-Linux/tls.c	2006-09-20 13:37:14.000000000 -0400
@@ -48,14 +48,11 @@ int os_get_thread_area(user_desc_t *info
  #ifdef UML_CONFIG_MODE_TT
  #include "linux/unistd.h"

-static _syscall1(int, get_thread_area, user_desc_t *, u_info);
-static _syscall1(int, set_thread_area, user_desc_t *, u_info);
-
  int do_set_thread_area_tt(user_desc_t *info)
  {
  	int ret;

-	ret = set_thread_area(info);
+	ret = syscall(__NR_set_thread_area, info);
  	if (ret < 0) {
  		ret = -errno;
  	}
@@ -66,7 +63,7 @@ int do_get_thread_area_tt(user_desc_t *i
  {
  	int ret;

-	ret = get_thread_area(info);
+	ret = syscall(__NR_get_thread_area, info);
  	if (ret < 0) {
  		ret = -errno;
  	}

             reply	other threads:[~2006-09-20 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20 21:05 Mitch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-20 15:31 UML build failure with 2.6.18 Mitch
2006-09-20 16:47 ` Bill Rugolsky Jr.
2006-09-20 17:40 ` Jeff Dike
2006-09-20 13:27 Mitch
2006-09-20 15:22 ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4511AD17.8040108@0Bits.COM \
    --to=mitch@0bits.com \
    --cc=brugolsky@telemetry-investments.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox