You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is for the _decimal specific parts from bpo-4555. The patch
depends on _Pragma (C99) and gcc >= 4.0 for the contents of the pragma.
I think it will work for clang, too.
Should the libmpdec API symbols (i.e. the ones starting with mpd_*)
be hidden for _decimal.c, too?
Personally I prefer using attributes instead of pragmas. The GCC manual recommends such as well. There are also other sources in Modules/* that use '__attribute__ ((visibility ("hidden")))'. Namely ctypes and zlib.
I can understand that it is more work, but I find something like the following more readable (I am not actually suggesting names here, just an example):
There are also other sources in Modules/* that use '__attribute__ ((visibility ("hidden")))'. Namely ctypes and zlib.
They do, but for a tiny amount of functions. mpdecimal.h, which is internal
as far as _decimal.so is concerned, also needs to be changed. There you have
something like 200 lines of
Activity
skrah commentedon Dec 21, 2012
This issue is for the _decimal specific parts from bpo-4555. The patch
depends on _Pragma (C99) and gcc >= 4.0 for the contents of the pragma.
I think it will work for clang, too.
Should the libmpdec API symbols (i.e. the ones starting with mpd_*)
be hidden for _decimal.c, too?
skrah commentedon Dec 21, 2012
Adding everyone from issue bpo-4555, in case you can think of a different
(portable) solution for hiding symbols (with minimal effort).
meadori commentedon Dec 21, 2012
Personally I prefer using attributes instead of pragmas. The GCC manual recommends such as well. There are also other sources in Modules/* that use '__attribute__ ((visibility ("hidden")))'. Namely ctypes and zlib.
I can understand that it is more work, but I find something like the following more readable (I am not actually suggesting names here, just an example):
...
skrah commentedon Dec 21, 2012
Meador Inge <report@bugs.python.org> wrote:
I followed www.akkadia.org/drepper/dsohowto.pdf . Drepper seems to be fine
with the use of pragmas in internal headers.
They do, but for a tiny amount of functions. mpdecimal.h, which is internal
as far as _decimal.so is concerned, also needs to be changed. There you have
something like 200 lines of
which increases the size of the diff between the standalone libmpdec and the
one shipped with Python.
meadori commentedon Dec 21, 2012
Ah, I missed how big of a line range these pragmas are covering when I scanned the patch before. In that case, I agree with the current patch.
python-dev commentedon Dec 21, 2012
New changeset 24f6c6f3b7bf by Stefan Krah in branch '3.3':
Issue bpo-16745: Hide a couple of symbols by making them local.
http://hg.python.org/cpython/rev/24f6c6f3b7bf
python-dev commentedon Dec 22, 2012
New changeset 51b0a150f8aa by Stefan Krah in branch '3.3':
Issue bpo-16745: Hide symbols in _decimal.so.
http://hg.python.org/cpython/rev/51b0a150f8aa
python-dev commentedon Dec 22, 2012
New changeset ccc372b37fbb by Stefan Krah in branch '3.3':
Issue bpo-16745: The gcc visibility pragma is buggy on OpenIndiana and NetBSD.
http://hg.python.org/cpython/rev/ccc372b37fbb