From nobody@FreeBSD.org  Tue Jan 11 08:02:37 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54CD7106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2011 08:02:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 44A1F8FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2011 08:02:37 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0B82aX1070127
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2011 08:02:36 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p0B82aVs070126;
	Tue, 11 Jan 2011 08:02:36 GMT
	(envelope-from nobody)
Message-Id: <201101110802.p0B82aVs070126@red.freebsd.org>
Date: Tue, 11 Jan 2011 08:02:36 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Linux emulator not understand STB_GNU_UNIQUE binding
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         153887
>Category:       kern
>Synopsis:       [linux] Linux emulator not understand STB_GNU_UNIQUE binding
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-emulation
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 08:10:08 UTC 2011
>Closed-Date:    
>Last-Modified:  Sat Jun  4 08:50:09 UTC 2011
>Originator:     Yuri
>Release:        8.1-STABLE amd64
>Organization:
n/a
>Environment:
>Description:
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.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: arundel 
Responsible-Changed-When: Fri Jan 28 20:46:59 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153887 

From: Marcin Cieslak <saper@saper.info>
To: bug-followup@FreeBSD.org, yuri@tsoft.com
Cc:  
Subject: Re: kern/153887: [linux] Linux emulator not understand STB_GNU_UNIQUE
 binding
Date: Sun, 1 May 2011 20:36:14 +0000

 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

From: Yuri <yuri@rawbw.com>
To: bug-followup@FreeBSD.org
Cc: saper@saper.info
Subject: RE: kern/153887: [linux] Linux emulator not understand STB_GNU_UNIQUE
 binding
Date: Sat, 04 Jun 2011 01:36:19 -0700

 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
 
>Unformatted:
