https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77267

Peter Wu <peter at lekensteyn dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter at lekensteyn dot nl

--- Comment #2 from Peter Wu <peter at lekensteyn dot nl> ---
Building Wireshark on Arch Linux with the -Wl,--as-needed linker option also
results in issues.

Example output during the linker stage (with -mmpx -fcheck-pointer-bounds):
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../lib/libmpxwrappers.so:
undefined reference to `get_bd'
collect2: error: ld returned 1 exit status

$ readelf -s /usr/lib/libmpxwrappers.so.2.0.0 | grep get_bd
     8: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND get_bd
    72: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND get_bd
$ readelf -s /usr/lib/libmpx.so.2.0.0 | grep get_bd
    38: 0000000000001720     8 FUNC    GLOBAL DEFAULT   13 get_bd@@LIBMPX_2.0
   115: 0000000000001720     8 FUNC    GLOBAL DEFAULT   13 get_bd

What helped here was explicitly adding -lmpxwrappers -lmpx to the linker flags.

Reply via email to