[LLVMdev] [lld] Handling a whole bunch of readers

Shankar Easwaran shankare at codeaurora.org
Thu Oct 10 09:16:07 PDT 2013


On 10/9/2013 11:19 PM, Rui Ueyama wrote:
>
> Isnt having a YAML file starting with the below better, so that you dont
> need to go through file extensions.
>
> magic :
> arch:
>
> I guess we will use a fixed file extension anyway (we probaly don't want to
> use .txt for YAML object file for example), so what do you think is the
> benefit of depending on special file magic compared to using file extension?
>
>
I would like to support usecases like this.

(a)
$ cat simple.s
          .text
          .global _start
          .type _start, at function
_start:
          callq bar
          ret

clang simple.s -c- -o- | lld -flavor gnu -target x86_64 
--output-filetype=yaml -r - | lld -flavor gnu -target x86_64 -

Which is certainly not doable because you dont have a file created on 
the filesystem.

PS: This has been snipped from an earlier discussion with Tim.

(b)

lld -flavor gnu -target x86_64 input.o --output-filetype=yaml -o 
atoms.objtxt (Create a atom file using x86_64 target)
lld -flavor gnu -target hexagon atoms.objtxt (use it with hexagon)

You can create yaml files from each flavor and pass it to the wrong 
flavor, too.

If we have the magic and arch in the yaml file (or) one entry combined 
triple(that combines flavor, operating system and target) this would 
work and there is no need to create new types of extensions.

Thanks

Shankar Easwaran

-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by the Linux Foundation



More information about the llvm-dev mailing list