public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ozan Çağlayan" <ozan@pardus.org.tr>
To: linux-kernel@vger.kernel.org
Cc: acme@redhat.com, mst@redhat.com, mingo@elte.hu
Subject: Re: [PATCH] perf tools: Fix linking errors with --as-needed flag
Date: Sun, 18 Jul 2010 14:04:32 +0300	[thread overview]
Message-ID: <4C42DFC0.1090708@pardus.org.tr> (raw)
In-Reply-To: <1279449937-29115-1-git-send-email-ozan@pardus.org.tr>

On 18.07.2010 13:45, Ozan Çağlayan wrote:
> External shared libraries should never be appended to the LDFLAGS as
> this messes the linking order. As EXTLIBS collects those libraries,
> it seems that perl and python libraries  should also be appended
> to EXTLIBS.
> 
> Also fix the broken linking order.

Hm actually the PERL_EMBED_LDOPTS may contain LDFLAGS and LIBADD according
to distribution's perl package configuration's goodness/badness. On my system
the return value is crap which bloats the linking process:

 -rdynamic -Wl,-rpath,/usr/lib/perl5/5.10.1/i686-linux-thread-multi/CORE  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/5.10.1/i686-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc

PYTHON_EMBED_LDOPTS evaluates python-config --ldflags and adds these to 
ALL_LDFLAGS. (--libs and --ldflags are synonyms for python-config). According
to python-config this code *never* returns LDFLAGS so it's safe to put them in
EXTLIBS.

So the cure may be more than this patch for perl stuff, but at least it fixes my
linking problems with -Wl, --as-needed.


  reply	other threads:[~2010-07-18 11:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 10:45 [PATCH] perf tools: Fix linking errors with --as-needed flag Ozan Çağlayan
2010-07-18 11:04 ` Ozan Çağlayan [this message]
2010-08-21 17:24   ` Arnaldo Carvalho de Melo
2010-08-22  6:43     ` Tom Zanussi
2010-08-23  2:44       ` Tom Zanussi
2010-08-23 14:38         ` Arnaldo Carvalho de Melo
2010-08-23 21:22           ` Ozan Çağlayan
2010-08-23 23:23             ` Arnaldo Carvalho de Melo
2010-08-23 16:53         ` Kirill A. Shutemov
2010-08-24  5:23           ` Tom Zanussi
     [not found]             ` <tip-f2481f3df4521e731da36afe7f0fe19a5c93e46d@git.kernel.org>
2010-08-30  8:38               ` [tip:perf/core] " Kirill A. Shutemov

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=4C42DFC0.1090708@pardus.org.tr \
    --to=ozan@pardus.org.tr \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mst@redhat.com \
    /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