Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#33252 - [binutils] libbfd.a -fvisibility=hidden breaks swig

Attached to Project: Arch Linux
Opened by Younes Manton (ymanton) - Monday, 31 December 2012, 08:23 GMT
Last edited by Allan McRae (Allan) - Thursday, 03 January 2013, 12:53 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The libbfd.a component is built with -fvisibility=hidden, apparently making some APIs declared in bfd.h unavailable in the resulting .a file. This breaks swig, which sees these APIs in the header and generates the corresponding wrapping code, and therefore requires the symbols to be resolvable when the module is loaded.

Additional info:
* package version(s)
* config and/or log files etc.

Introduced by commit 152d9b3eecd2f7209e3504deacc78d73f69d449f

Steps to reproduce:
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 03 January 2013, 12:53 GMT
Reason for closing:  Fixed
Additional comments about closing:  binutils-2.23.1-3 in [testing]
Comment by Allan McRae (Allan) - Monday, 31 December 2012, 10:21 GMT
Give actual details of what breaks in swig.
Comment by Younes Manton (ymanton) - Monday, 31 December 2012, 18:30 GMT
Swig takes a .i file specifying the API to wrap as input and produces a _wrap.c file. The _wrap.c is built into a .so that can be consumed from another language. Including bfd.h in the .i will create wrapping code for everything in bfd.h, however the resulting .so can't be loaded because some functions declared in bfd.h are nowhere to be found. resulting in undefined symbol errors.

For example, bfd_ecoff_get_gp_value is a function declared in bfd.h but the object file containing the definition is not included in libbfd.a.

[ymanton@novo wrappers]$ python2 testbfd.py
Traceback (most recent call last):
File "testbfd.py", line 1, in <module>
import bfd
File "/home/ymanton/Dev/wrappers/bfd.py", line 26, in <module>
_bfd = swig_import_helper()
File "/home/ymanton/Dev/wrappers/bfd.py", line 22, in swig_import_helper
_mod = imp.load_module('_bfd', fp, pathname, description)
ImportError: /home/ymanton/Dev/wrappers/_bfd.so: undefined symbol: bfd_ecoff_get_gp_value

Loading...