Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla at busybox.net <bugzilla@busybox.net>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 12076] Patchelf can link against an incompatible libc++ version
Date: Fri, 02 Aug 2019 14:44:52 +0000	[thread overview]
Message-ID: <bug-12076-163-l52QRxKal9@https.bugs.busybox.net/> (raw)
In-Reply-To: <bug-12076-163@https.bugs.busybox.net/>

https://bugs.busybox.net/show_bug.cgi?id=12076

Arnout Vandecappelle <arnout@mind.be> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Arnout Vandecappelle <arnout@mind.be> ---
Thank you for the files.

I still believe the issue is in your Docker container itself.

The symbol that triggers this is __throw_out_of_range_fmt:

$ readelf -a patchelf-buildroot | grep 3\\.4\\.20
0000006203c0  000500000007 R_X86_64_JUMP_SLO 0000000000000000
_ZSt24__throw_out_of_r at GLIBCXX_3.4.20 + 0

It is linked only if you use a class which may throw an out of range error.
However, it should get pulled in by <string> which (eventually) includes
<bits/basic_string.h>. So the simple helloworld.cpp wouldn't trigger it, but if
you do something like std::string("foo")[4] you should actually trigger this
exception and hit that code path.

In addition, for Buildroot builds you use /opt/gcc/4.9/bin/g++ while for the
helloworld compilation you use just g++, which is probably /usr/bin/g++.

I suspect that the problem is that /opt/gcc/4.9/bin/g++ does not set a proper
RPATH for its libstdc++. You could add it to /etc/ld.so.conf, but I don't know
if ld.so is smart enough to use a different version of a dynamic library
depending of the symbols that are requested.

You could also try to export HOST_LDFLAGS="-Wl,-rpath=/opt/gcc/4.9/lib" (or
whatever the path is that contains GCC 9's libstdc++.so).

In any case, I'm pretty sure this is due to a broken toolchain in your
container and not due to a Buildroot issue, and definitely nothing that we can
do about it. So I'm closing this as invalid. That said, don't hesitate to
continue asking help either here or on the mailing list or on IRC.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2019-08-02 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 16:06 [Buildroot] [Bug 12076] New: Patchelf can link against an incompatible libc++ version bugzilla at busybox.net
2019-08-01 16:22 ` [Buildroot] [Bug 12076] " bugzilla at busybox.net
2019-08-02  8:44 ` bugzilla at busybox.net
2019-08-02 14:44 ` bugzilla at busybox.net [this message]

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=bug-12076-163-l52QRxKal9@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@busybox.net \
    /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