[llvm] [CMake] Check objcopy support for LLVM_SPLIT_DWARF (PR #80500)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 14:16:49 PST 2024


dwblaikie wrote:

Yeah, I'm OK waiting to see if this is a problem in practice.

but to answer some of the questions @joker-eph had:
> What tool from binutils is involved in building LLVM with GCC?
gcc, when using -gsplit-dwarf, invokes binutils objcopy to split out the file into the .o and .dwo parts (the compiler itself produces one monolithic object file, and the compiler driver uses objcopy to split it into the two products) 
You can see these extra actions here https://godbolt.org/z/bcj8d895E:

```
gcc version 13.2.0 (Compiler-Explorer-Build-gcc--binutils-2.40) 
...cc1plus ... <source> -o /tmp/cc1E3Olm.s
...as ... -o /app/output.s /tmp/cc1E3Olm.s
...objcopy --extract-dwo /app/output.s /app/output.dwo
...objcopy --strip-dwo /app/output.s
```

I don't know precisely which version of binutils this was introduced in, or what different GCC versions likely ship alongside that binutils version, etc... 

https://github.com/llvm/llvm-project/pull/80500


More information about the llvm-commits mailing list