Subject: Re: [bug#55998] [PATCH] gnu: Add cctools.

From: Philip McGrath <[email-masked]>
Date: Wed, 15 Jun 2022 15:19:06 -0400

On 6/15/22 14:53, Maxime Devos wrote:
> Philip McGrath schreef op wo 15-06-2022 om 13:15 [-0400]:
>> +      (synopsis "Darwin's @code{cctools} and @code{ld64}")
>> +      ;; Confusingly enough, the program is called ld64, but the command is
>> +      ;; just ld (with no symlink), so @command{ld64} would be wrong.
>> +      (description
>> +       "Darwin's @code{cctools} are a set of tools somewhat similar in purpose
>> +to GNU Binutils, but for Mach-O files targeting Darwin.  The suite includes
>> +@command{install_name_tool}, @command{libtool}, and other specialized tools in
>> +addition to standard utilities like @command{ld} and @command{as}.  This
>> +package provides portable versions of the tools.")
>> +      (license license:apsl2))))
> 
> How can this work? We don't have any (cross-compiled) Darwin libc
> libraries to let it link against. Is this a draft patch?
> 

Fortunately, we don't need a Darwin libc: tools like `install_name_tool` 
run on GNU/Linux, but work with Darwin binaries, somewhat like 
`patchelf` can work on a cross-compiled binary. From another point of 
view, it's a bit like some parts of MinGW.

This patch is not enough for a Darwin cross-compilation toolchain, 
though I believe it would play a role analogous to GNU Binutils in such 
a toolchain.

Still, several of the tools are useful (albeit niche) on their own, 
which is why I sent this patch now. A whole group of tools supports 
inspecting Mach-O binaries, for example.

-Philip