bug-binutils
[Top][All Lists]
Advanced

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

macOS-builds of libbfd contain unresolvable _libintl_dgettext symbol


From: Michael Roitzsch
Subject: macOS-builds of libbfd contain unresolvable _libintl_dgettext symbol
Date: Tue, 19 Feb 2019 17:06:08 +0100

Hi binutils team,

I am compiling binutils on macOS (Mojave, Darwin 18.5.0) with the following 
configure options:

--enable-shared --target=x86_64-pc-mingw32

The resulting libbfd-2.32.dylib contains an unresolved symbol to 
_libintl_dgettext with no library information attached:

address@hidden:~/D/b/build > nm -ma bfd/.libs/libbfd-2.32.dylib | fgrep gettext
                 (undefined) external _libintl_dgettext (dynamically looked up)

Any runtime usage of this symbol will lead to a failure in the macOS runtime 
linker’s lazy symbol resolution. This can be triggered by running the assembler 
on a test input:

address@hidden:~/D/b/build > gas/as-new ../mingw.s
dyld: lazy symbol binding failed: Symbol not found: _libintl_dgettext
  Referenced from: 
/Users/Michael/Desktop/binutils/build/bfd/.libs/libbfd-2.32.dylib
  Expected in: flat namespace

dyld: Symbol not found: _libintl_dgettext
  Referenced from: 
/Users/Michael/Desktop/binutils/build/bfd/.libs/libbfd-2.32.dylib
  Expected in: flat namespace

../mingw.s: Assembler messages:
../mingw.s: Internal error (Abort trap: 6).
Please report this bug.
dyld: lazy symbol binding failed: Symbol not found: _libintl_dgettext
  Referenced from: 
/Users/Michael/Desktop/binutils/build/bfd/.libs/libbfd-2.32.dylib
  Expected in: flat namespace

dyld: Symbol not found: _libintl_dgettext
  Referenced from: 
/Users/Michael/Desktop/binutils/build/bfd/.libs/libbfd-2.32.dylib
  Expected in: flat namespace

I will attach the test case plus a terminal dump of my build session to this 
email. The same unresolved symbol in libbfd is also present when compiling for 
a x86_64-linux target or for the native Darwin platform without any target 
option. The only difference is that the actual failure is harder to trigger 
with these builds.

My proposed fix is attached as a patch. Linux contains the gettext symbols 
within libc, but on macOS, those are not provided, so binutils’ built-in 
version of libintl should be used on all Darwin-hosted builds.

I hope this is useful. I’d be happy to provide more details or test different 
solutions, if necessary.

Michael

Attachment: terminal
Description: Binary data

Attachment: mingw.s
Description: Binary data

Attachment: darwin-libintl.patch
Description: Binary data


reply via email to

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