From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7561 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: building musl libc.so with gcc -flto Date: Fri, 1 May 2015 09:57:08 +0300 (MSK) Message-ID: References: <1429742932-6026-1-git-send-email-armccurdy@gmail.com> <20150423022309.GH6817@brightrain.aerifal.cx> <5542949D.8000509@kernel.org> <20150430234451.GY17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: ger.gmane.org 1430463450 10306 80.91.229.3 (1 May 2015 06:57:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 May 2015 06:57:30 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7574-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 01 08:57:25 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Yo4t0-0005D2-DL for gllmg-musl@m.gmane.org; Fri, 01 May 2015 08:57:22 +0200 Original-Received: (qmail 18084 invoked by uid 550); 1 May 2015 06:57:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18064 invoked from network); 1 May 2015 06:57:20 -0000 In-Reply-To: <20150430234451.GY17573@brightrain.aerifal.cx> User-Agent: Alpine 2.11 (LNX 23 2013-08-11) Xref: news.gmane.org gmane.linux.lib.musl.general:7561 Archived-At: > > Wouldn't adding __attribute__((externally_visible)) to the relevant > > symbols be more appropriate? It's intended to solve exactly this > > problem. > > I'm not clear whether it would be reliable to use this or not. > Semantically externally_visible and visibility=hidden are > contradictory. Even if we weren't trying to avoid relying on > additional GNU C features, I think it would be a bad idea to rely on > this working since the behavior under such contradictory annotations > could potentially vary widely between compilers. The attribute that's suitable for this case is "used", not "externally_visible" (um, I already mentioned that in the other thread where I explained why the reference from the asm is 'ignored'). Andy is not correct in saying that "it's intended to solve exactly this problem". To quote GCC manual, externally_visible This attribute, attached to a global variable or function, nullifies the effect of the -fwhole-program command-line option, so the object remains visible outside the current compilation unit. used This attribute, attached to a function, means that code must be emitted for the function even if it appears that the function is not referenced. This is useful, for example, when the function is referenced only in inline assembly. ( https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html ) Alexander