Bug 153887 - [linux] Linux emulator not understand STB_GNU_UNIQUE binding
Summary: [linux] Linux emulator not understand STB_GNU_UNIQUE binding
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 08:10 UTC by yuri
Modified: 2016-01-09 21:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yuri 2011-01-11 08:10:08 UTC
I have the working app in Ubuntu.
When I copy it to FreeBSD with all shared libs I get such message:
app.linux: symbol lookup error: ../lib/libstdc++.so.6: undefined symbol: _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE, version GLIBCXX_3.4

./lib/libstdc++.so.6 has been taken from Ubuntu (gcc-4.5.1). It was compiled there from gcc sources.

Upon closer inspection I see that on FreeBSD:
> readelf -aW ../lib/libstdc++.so.6 | grep _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE
  1426: 000f30dc     4 OBJECT <OS specific>: 10 DEFAULT   26 _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE@@GLIBCXX_3.4
  3380: 000f30dc     4 OBJECT <OS specific>: 10 DEFAULT   26 _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE

But on Ubuntu the word 10 is replaced with UNIQUE. It refers to the relatively newly introduced extension STB_GNU_UNIQUE, see here:
http://osdir.com/ml/general/2009-08/msg09809.html

I think Linux emulator is outdated and needs to be updated.
Comment 1 Alexander Best freebsd_committer freebsd_triage 2011-01-28 20:46:59 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-emulation

Over to maintainer(s).
Comment 2 Marcin Cieślak 2011-05-01 21:36:14 UTC
Hello,

I don't think that this area belongs to the linux emulator, as this problem probably is related to the
runtime linker and not the kernel. Two questions, though:

(1) did you run "brandelf -t Linux" on your program binary?

(2) can you provide us with a small testcase (like a one-line program trying to use libstdc++ in a smiliar way)?

Thanks in advance,

//Marcin
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2011-06-04 09:36:19 UTC
Hi,

 > I don't think that this area belongs to the linux emulator, as this 
problem probably is related to the runtime linker and not the kernel. 
Two questions, though:

Why it doesn't belong to emulator? Runtime linker for Linux executables 
is outdated, this is related to linux emulator.

 > (1) did you run "brandelf -t Linux" on your program binary?

No I didn't, usually linux executables (like skype and acroread) don't 
need this.

(2) can you provide us with a small testcase (like a one-line program 
trying to use libstdc++ in a smiliar way)?

Regarding the testcase, my linux executable itself doesn't use the 
symbol _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE. 
Instead it links with some open source shared libraries, some of which 
probably links to this symbol.

But looking at the readelf output it's pretty clear what triggers the 
problem.

Yuri