All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Andreas Schwab <schwab@suse.de>
Cc: Benjamin Collar <benjamin.collar@siemens.com>,
	linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: using _syscall4 to call sys_futex with -fPIC won't compile
Date: Mon, 05 Jul 2004 12:17:24 -0400	[thread overview]
Message-ID: <40E97F14.2060706@nortelnetworks.com> (raw)
In-Reply-To: <je1xjqigxr.fsf@sykes.suse.de>

Andreas Schwab wrote:
> Benjamin Collar <benjamin.collar@siemens.com> writes:
> 
>  > Greetings
>  >
>  > [1.]
>  > If I use _syscall4 in order to call sys_futex and compile with -fPIC, I
>  > receive this compiler error:
>  > "can't find a register in class `BREG' while reloading `asm'"
> 
> Don't do that then.
> 
>  > [2.]
>  > I'm using futexes in a project and I have to build a shared library;
>  > thus I need to use -fPIC when compiling. When doing so, I get the error
>  > mentioned in [1.].
> 
> Don't use kernel headers in user space.  Use syscall(3) instead.

The "_syscallx" macros are in the userspace versions of the kernel headers, and 
as such should be fair game.  Also, you need to get a list of syscall numbers 
somehow, and those numbers are generally defined in the same file that contains 
the "_syscallx" macros.

syscall() doesn't work for all system calls.  The man page explicitly warns that 
it doesn't work for pipe(2).  Interestingly, the glibc manual doesn't have that 
warning.  Wonder which is correct...

Chris

  reply	other threads:[~2004-07-05 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-05 10:39 PROBLEM: using _syscall4 to call sys_futex with -fPIC won't compile Benjamin Collar
2004-07-05 15:58 ` Andreas Schwab
2004-07-05 16:17   ` Chris Friesen [this message]
2004-07-05 17:57     ` Andreas Schwab

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=40E97F14.2060706@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=benjamin.collar@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.