[llvm-dev] Extending llvm-objcopy to support COFF

Martin Storsjö via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 20 00:07:44 PDT 2018


On Tue, 13 Mar 2018, Jake Ehrlich via llvm-dev wrote:

> Hey everyone,
> 
> Sorry to jump in on this so late. My two cents is that it should remain GNU
> objoppy compatible most likely. It was always vaguely a desire to have
> command line compatibility but it has turned out over time that this is
> actually a crucial feature and should be one of the top priorities. You
> can't just go into a giant build system and swap out all the uses of GNU
> objcopy with their llvm-objcopy equivalents. This is the whole reason I'm
> adding the llvm-strip interface. We know of multiple instances where GNU
> strip is used in large systems and it's non-trivial to replace every last
> individual usage of GNU strip with the corresponding llvm-objcopy use. We
> know of even more instances where GNU objcopy is super hard to replace. Most
> of the users of/people who want to use llvm-objcopy need it to be a drop in
> replacement. This all said, GNU objcopy hasn't generally been used on
> windows platforms, so this might be a moot point.

FWIW, here's a case where GNU objcopy is used for windows: 
https://git.videolan.org/?p=vlc.git;a=blob;f=extras/package/win32/package.mak;h=c65bef4ce6428ceab2c1272fb6ca98815e4975f8;hb=7fd02feb6c6be674066b68c2f53776a5504f4657#l90

Here, the options --only-keep-debug, --strip-all and --add-gnu-debuglink 
are used, in addition to $(STRIP).

And elsewhere, for the strip tool, I've seen the option "-x" used.

// Martin


More information about the llvm-dev mailing list