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 a MEX file


From: Guillaume
Subject: [Octave-bug-tracker] [bug #55363] Global variable in a MEX file
Date: Mon, 7 Jan 2019 06:25:38 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #9, bug #55363 (project octave):

Adding '-Wl,-Bsymbolic-functions' manually to the Matlab mex compilation
command line does not change the behavior. Matlab seems to use the
'-Wl,--version-script=' flag,  which probably takes precedence.

On Ubuntu, the '-Wl,-Bsymbolic-functions' link option comes from
$OCT_LINK_OPTS. If I redefine it to contain '-Wl,-z,relro' only before calling
mkoctfile, then everything works fine again. $OCT_LINK_OPTS seems to be
populated from $LDFLAGS.

I could find a number of related discussions, where that flag created similar
issues:

https://lists.ubuntu.com/archives/ubuntu-devel/2018-June/040369.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637184
https://bugs.launchpad.net/ubuntu/+source/tango/+bug/1250534
https://github.com/grpc/grpc/issues/11195

Would there be a way to automatically strip '-Wl,-Bsymbolic-functions' from
$LDFLAGS if present? As mentioned in comments #4 and #5, it cannot be assumed
to be able to declare all functions and variables to be static in a MEX file.
For example, I could find this being described here:

http://anadoxin.org/blog/control-over-symbol-exports-in-gcc.html

with the solution to use '-Wl,--version-script='.

    _______________________________________________________

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]