linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bug 217768] Build error
       [not found] ` <bug-217768-8243-86af6q0Txp@https.bugzilla.kernel.org/>
@ 2023-08-09 23:46   ` Steven Rostedt
  2023-08-09 23:47     ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2023-08-09 23:46 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: Linux Trace Devel

On Wed, 09 Aug 2023 11:54:15 +0000
bugzilla-daemon@kernel.org wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=217768

--- Comment #1 from Douglas RAILLARD (douglas.raillard@arm.com) ---

> So since there is no way to get a visibility-based namespace in C that works
> for libs with more than one ELF file in it (i.e. static lib with more than one
> .o), the options are:

Hi Douglas,

Thanks for looking into this and debugging it. Yeah, I figured that
__hidden was going to bite me sooner or later. :-/


> 
>   1. Change the name of one of the definitions.
>   2. Move that function to a 3rd library and make the other 2 depend on it.
>   3. pre-link all the object files in libtracefs.a into a single .o
> 
> 
> This patch implements 3. for libtracefs and fixes static build of trace-cmd. A
> similar patch would be needed for libtraceevent and libtracecmd even though
> there is currently no symbol conflict (by chance):

Actually, I prefer #1. #2 is out of the question. But trace-cmd actually
depends on hidden functions being accessible during linking. That is, the
trace-cmd binary uses __hidden functions in libtracecmd. The __hidden()
just means that they should not be relied on.

Perhaps we need to make all __hidden functions have a prefix. Hmm, perhaps just add:

 "_tracecmd_" or "_tracefs_" to the front of it?

That is, for strstrip() in trace-cmd, rename it to: _tracecmd_strstrip()

and for libtracefs: _libtracefs_strstrip()

by convention, anything that starts with "tracecmd_" or "tracefs_" should
be exposed and considered API. We can have that anything with "_tracecmd_"
or "_tracefs_" is to be hidden and not part of the API.

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bug 217768] Build error
  2023-08-09 23:46   ` [Bug 217768] Build error Steven Rostedt
@ 2023-08-09 23:47     ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2023-08-09 23:47 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: Linux Trace Devel

On Wed, 9 Aug 2023 19:46:02 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Perhaps we need to make all __hidden functions have a prefix. Hmm, perhaps just add:
> 
>  "_tracecmd_" or "_tracefs_" to the front of it?
> 
> That is, for strstrip() in trace-cmd, rename it to: _tracecmd_strstrip()
> 
> and for libtracefs: _libtracefs_strstrip()

That should have been: _tracefs_strstrip()

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-09 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <bug-217768-8243@https.bugzilla.kernel.org/>
     [not found] ` <bug-217768-8243-86af6q0Txp@https.bugzilla.kernel.org/>
2023-08-09 23:46   ` [Bug 217768] Build error Steven Rostedt
2023-08-09 23:47     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).