octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55363] global variable in multiple mex or oct


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #55363] global variable in multiple mex or oct files collapse to one definition with -Bsymbolic-functions
Date: Mon, 7 Jan 2019 15:37:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Update of bug #55363 (project octave):

                Severity:              3 - Normal => 1 - Wish               
              Item Group:              Regression => Feature Request        
                  Status:            Works For Me => Confirmed              
                 Summary: Global variable in a MEX file => global variable in
multiple mex or oct files collapse to one definition with -Bsymbolic-functions

    _______________________________________________________

Follow-up Comment #11:

I retitled this to more accurately descripe the situation. I was also able to
confirm this with an oct file demo, attached as foo1.cc and foo2.cc. So this
is entirely a linker phenomenon with the -Bsymbolic-functions option, which
allows multiple definitions of the same symbol to collapse to the same
definition in the process space at run time.

The feature request at this point looks like making mkoctfile automatically
pass a version script to the linker when building a mex file, so that it
filters out all symbols and only the 'mexFunction' symbol is exported.

Should the same magic be done on oct files? That's a little more complicated,
as mkoctfile would have to essentially parse the symbol tables and look for
all DEFUN-related symbols and add them to a dynamic version script. But it
would make oct files more robust as well, only exporting the minimum that is
required for the oct file to be loaded by Octave.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55363>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]