Off Topic: Building ld

I have a need to build ld from source to understand an assert(0).

I got excited when I found that ld64 on the opensource portal contains an xcodeproj

http://opensource.apple.com/source/ld64/ld64-127.2/

But… it seems like I’m lacking mach-o/arm/reloc.h, and dyld_priv.h.

I’m doing my best to stitch it all together, but if anyone has any pointers to make this less painful, it would be much obliged.

Humbly,

Joe Abbey
Director of S/W Development
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
W: 765-889-4756 x2
C: 765-464-9893
jabbey@arxan.com
www.arxan.com

I have a need to build ld from source to understand an assert(0).

I got excited when I found that ld64 on the opensource portal contains an xcodeproj

http://opensource.apple.com/source/ld64/ld64-127.2/

But... it seems like I'm lacking mach-o/arm/reloc.h, and dyld_priv.h.

I'm doing my best to stitch it all together, but if anyone has any pointers to make this less painful, it would be much obliged.

Most of the stuff on opensource.apple.com is very painful to build. In this case you have to pick up reloc.h from
the cctools archive and dyld_priv.h from dyld.

http://opensource.apple.com/source/cctools/cctools-806/include/mach-o/arm/reloc.h
http://opensource.apple.com/source/dyld/dyld-195.5/include/mach-o/dyld_priv.h

put them in the right directories and it should compile.

- Ben

Thanks for your response, that’s kinda what I’ve gathered over the years. I was hoping that the Xcode project would have “just worked”.

I’ll keep piece-mealing it together, and hope that it works.

I’ll try to post a radar.

Joe

Joe Abbey
Director of S/W Development
Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
W: 765-889-4756 x2
C: 765-464-9893
jabbey@arxan.com
www.arxan.com

For what it's worth, I have a bug report about adding
<mach-o/arm/reloc.h> you could reference: 10281358. As for
dyld_priv.h, you can remove LocalAddressSpace::findUnwindSections
(which is unused) and no longer need to include it.

-- Joe Ranieri

Ben,

Thanks for your help!

http://opensource.apple.com/source/cctools/cctools-806/include/mach-o/arm/reloc.h

Yep, as Joe Ranieri pointed out, I had to tell MachOFileAbstraction.hpp about ARM relocs

http://opensource.apple.com/source/dyld/dyld-195.5/include/mach-o/dyld_priv.h

I tried to use the dyld_priv.h from cctools to no avail, using the one from dyld (as you pointed out) worked

Also I had to “drag and drop” llvm-c/lto.h into the project, since no combination of Project/Target/Recursive Header Search paths to /home/jabbey/src/llvm/include seemed to do the trick. Maybe I’m doing it wrong?

Hurray, maybe I can debug my linker issue now.

Joe

Joe Abbey

Director of S/W Development

Arxan Technologies, Inc.
1305 Cumberland Ave, Ste 215
West Lafayette, IN 47906
jabbey@arxan.com
www.arxan.com

The rest of the diagnostic would be helpful - but I'm guessing you
tried to cast (using the LLVM casts (cast<T>(...))) to an integer
type.