0

I need to build ld from sources on OSX 10.12.3 (16D32). I cloned the last version from git://sourceware.org/git/binutils-gdb.git and tried to build it:

./configure --prefix=/usr --disable-werror (there are a lot of warnings, so I disable them)

make

but I got

 In file included from dwarf2read.c:72:
 ./common/gdb_unlinker.h:35:35: error: '__nonnull__' attribute 
 is invalid for the implicit this argument
  unlinker (const char *filename) ATTRIBUTE_NONNULL (1)

Have anybody seen it and know how to fix it? I need only ld to check why it shows

ld: warning: can't parse dwarf compilation unit info in 

on OSX, when Ubuntu works fine and objdump doesn't show any elf symbols.

Thanks for help.

AC-93
  • 85
  • 1
  • 7
  • I'm a little confused by this question. The linker that's part of the Apple development tools is Apple's own `ld64`, not `ld` from GNU binutils. You can see the error message you reference in [Apple's source for `ld64`](https://opensource.apple.com/source/ld64/ld64-274.2/src/ld/parsers/macho_relocatable_file.cpp.auto.html) (within `Parser::parseDebugInfo`). – bdash Mar 02 '17 at 04:38
  • Got it. You are right, I was confused by ld name. ld -v shows that it is ld64 that can be build. – AC-93 Mar 03 '17 at 19:06

1 Answers1

0

I was trying to build wrong ld. ld -v @(#)PROGRAM:ld PROJECT:ld64-274.2 shows that I had to build ld64 from apple sources. Thanks bdash for pointing that.

AC-93
  • 85
  • 1
  • 7