All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Krummenacher <max.oss.09@gmail.com>
To: Khem Raj <raj.khem@gmail.com>
Cc: openembeded-devel <openembedded-devel@lists.openembedded.org>,
	Max Krummenacher <max.krummenacher@toradex.com>
Subject: Re: [meta-oe][PATCH 1/2] gpsd: don't compile with gold
Date: Sun, 28 May 2017 20:11:36 +0200	[thread overview]
Message-ID: <1495995096.3000.8.camel@gmail.com> (raw)
In-Reply-To: <CAMKF1sptWiD9vH0CVB86mFhaQMpiSY+3sAGd8E-B+hT2O08O9Q@mail.gmail.com>

Am Sonntag, den 28.05.2017, 09:04 -0700 schrieb Khem Raj:
> On Sun, May 28, 2017 at 4:10 AM, Max Krummenacher <max.oss.09@gmail.com> wrote:
> > When linking with gold libgps and libgpsd error out with:
> >  | ./libgpsd.so: error: undefined reference to 'atan2'
> >  | ./libgpsd.so: error: undefined reference to 'pow'
> >  | ./libgpsd.so: error: undefined reference to 'sqrt'
> >  | ./libgpsd.so: error: undefined reference to 'sin'
> >  | ./libgpsd.so: error: undefined reference to 'cos'
> >  | collect2: error: ld returned 1 exit status
> > 
> > Using the bfd linker fixes the issue.
> 
> It seems packages dont have proper linker rules.
> perhaps a better fix is to add -lm to linker cmdline.
-lm is part of the linker cmdline.

 | arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -
-sysroot=/home/res/develop/oe-core/build/tmp-glibc/sysroots/apalis-imx6 -o gpsd -Wl,-O1 -Wl,--hash
-style=gnu -Wl,--as-needed --sysroot=/home/res/develop/oe-core/build/tmp-glibc/sysroots/apalis-imx6 
-pthread -Wl,-rpath=/home/res/develop/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux
-gnueabi/gpsd/3.14-r0/gpsd-3.14 gpsd.o timehint.o shmexport.o dbusexport.o sd_socket.o -L. 
-L/home/res/develop/oe-core/build/tmp-glibc/sysroots/apalis-imx6/usr/lib -lrt -lbluetooth -ldbus-1 
-lgpsd -lusb-1.0 -lbluetooth -lgps -lm -ldbus-1

One can get this link by linking the two shared objects '-lgps -lm' swapped '-lm -lgps', however I
do not understand why that order matters.
It does not help to add -lm when linking libgps.so.

gpsd 3.16 seems do not be affected, the scons file however has been given quite same change.

So, IMHO I'd rather use the linker which we now produces working binaries than to add yet one more
patch to the scons file. That gives a commit we can use to backport for pyro and morty.
Going forward we can use the update to 3.16 which allows to drop the majority of the patches we have
now and builds also with gold.

Max

> > 
> > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > ---
> >  meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb b/meta-oe/recipes
> > -navigation/gpsd/gpsd_3.14.bb
> > index 4d00fea6d..fb02f9598 100644
> > --- a/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb
> > +++ b/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb
> > @@ -36,6 +36,8 @@ SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true',
> > 'f
> >  export STAGING_INCDIR
> >  export STAGING_LIBDIR
> > 
> > +LDFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '',
> > d)}"
> > +
> >  PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
> >  PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}"
> >  PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free"
> > --
> > 2.12.0
> > 
> > --
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel


  reply	other threads:[~2017-05-28 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-28 11:10 [meta-oe][PATCH 1/2] gpsd: don't compile with gold Max Krummenacher
2017-05-28 11:10 ` [meta-oe][PATCH 2/2] gpsd: update to 3.16 Max Krummenacher
2017-05-28 16:04 ` [meta-oe][PATCH 1/2] gpsd: don't compile with gold Khem Raj
2017-05-28 18:11   ` Max Krummenacher [this message]
2017-05-28 19:11     ` Khem Raj

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=1495995096.3000.8.camel@gmail.com \
    --to=max.oss.09@gmail.com \
    --cc=max.krummenacher@toradex.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.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 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.