All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: Steven Scholz <steven.scholz@imc-berlin.de>
Cc: tglx@linutronix.de, linux-rt-users@vger.kernel.org
Subject: Re: cyclictest hangs with posix interval timers !?
Date: Mon, 8 Jan 2007 11:28:56 +0100	[thread overview]
Message-ID: <20070108102856.GA15514@pengutronix.de> (raw)
In-Reply-To: <45A21888.8060702@imc-berlin.de>

On Mon, Jan 08, 2007 at 11:10:16AM +0100, Steven Scholz wrote:
> As I wrote I have problems linking it statically!
> 
>  gcc -Wall -O2  -lpthread -lrt cyclictest.c -o cyclictest -static
> 
> results in

...
 
> while
> 
>  gcc -Wall -O2 cyclictest.c -o cyclictest -lrt -lpthread -static
> 
> compiles and links fine!
> 
> Any idea why the order matters?

The order does always matter. From 'info gcc': 

     It makes a difference where in the command you write this option;
     the linker searches and processes libraries and object files in
     the order they are specified.  Thus, `foo.o -lz bar.o' searches
     library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
     refers to functions in `z', those functions may not be loaded.

So in your first case, run with -v to see the linker options:

rsc@isonoe:~/tmp/cyclictest$ gcc -v -Wall -O2  -lpthread -lrt cyclictest.c -o cyclictest -static 2>&1 | grep collect2
 /usr/lib/gcc/i486-linux-gnu/4.1.2/collect2 -m elf_i386 -static -o
cyclictest /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o
/usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginT.o
-L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2
-L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -lpthread -lrt /tmp/cc2ooNdo.o --start-group -lgcc
-lgcc_eh -lc --end-group /usr/lib/gcc/i486-linux-gnu/4.1.2/crtend.o
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o
collect2: ld returned 1 exit status

... crt1.o crti.o crtbeginT.o -lpthread -lrt cc2ooNdo.o crtend.o

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

  reply	other threads:[~2007-01-08 10:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04 11:43 cyclictest hangs with posix interval timers !? Steven Scholz
2007-01-04 11:52 ` Robert Schwebel
2007-01-04 12:08   ` Steven Scholz
2007-01-04 13:15   ` Steven Scholz
2007-01-04 13:27     ` Thomas Gleixner
2007-01-04 13:31       ` Steven Scholz
2007-01-04 13:47         ` Thomas Gleixner
2007-01-04 15:01       ` Steven Scholz
2007-01-05  8:48         ` Thomas Gleixner
2007-01-05  9:16           ` Robert Schwebel
2007-01-07 12:38           ` Steven Scholz
2007-01-07 12:51           ` Steven Scholz
2007-01-07 14:21             ` Thomas Gleixner
2007-01-07 14:38               ` Steven Scholz
2007-01-07 14:52                 ` Thomas Gleixner
2007-01-07 14:55                   ` Steven Scholz
2007-01-07 15:32                   ` Steven Scholz
2007-01-08 10:10           ` Steven Scholz
2007-01-08 10:28             ` Robert Schwebel [this message]
2007-01-08 11:37           ` Steven Scholz
2007-01-08 11:42             ` Robert Schwebel
2007-01-08 11:43               ` Steven Scholz
2007-01-04 13:30 ` Thomas Gleixner
2007-01-04 13:32   ` Steven Scholz

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=20070108102856.GA15514@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=steven.scholz@imc-berlin.de \
    --cc=tglx@linutronix.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.