[llvm-dev] Generating object files more efficiently

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 23 13:39:45 PDT 2019


I think you need to pass a triple for your target to clang using --target
otherwise it will use your host target.

~Craig


On Sat, Mar 23, 2019 at 1:32 PM J S via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> It is my actual target architecture
> ------------------------------
> *From:* Doerfert, Johannes <jdoerfert at anl.gov>
> *Sent:* Saturday, March 23, 2019 1:30 PM
> *To:* J S
> *Cc:* via llvm-dev
> *Subject:* Re: [llvm-dev] Generating object files more efficiently
>
>
> I copied "-march=XYZ" from your original email,
>
> you have to replace it with your actual target architecture or simply drop
> it.
> ------------------------------
> *From:* J S <mm92126 at hotmail.com>
> *Sent:* Saturday, March 23, 2019 3:26:59 PM
> *To:* Doerfert, Johannes
> *Cc:* via llvm-dev
> *Subject:* Re: [llvm-dev] Generating object files more efficiently
>
>
>
> Johannes,
>
>
> I tried the last one and it gave me this:
>
>
> error: unknown target CPU 'XYZ'
> note: valid target CPU values are: nocona, core2, penryn, bonnell, atom,
>       silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7,
>       westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell,
>       core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake,
>       cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64,
>       athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10,
>       barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1,
> znver2,
>       x86-64
>
>
> ------------------------------
> *From:* Doerfert, Johannes <jdoerfert at anl.gov>
> *Sent:* Saturday, March 23, 2019 1:15 PM
> *To:* J S
> *Cc:* via llvm-dev
> *Subject:* Re: [llvm-dev] Generating object files more efficiently
>
> I would have guessed:
>
> object:
> clang -c foo.c -o foo.o -march=XYZ
>
> shared library:
> clang -shared foo.c -o foo.so -march=XYZ
>
> executable:
> clang foo.c -o foo -march=XYZ
>
>
> On 03/23, J S via llvm-dev wrote:
> > Currently I compile my C code in 2 steps in order to generate .o files
> >
> > clang -emit-llvm -c foo.c -o foo.bc
> > llc -march=XYZ foo.bc -filetype=obj
> >
> > Is there a way to generate either .o or .elf files in just 1 command?
> >
> > Thanks.
> >
>
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> llvm-dev Info Page
> <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
> lists.llvm.org
> To see the collection of prior postings to the list, visit the llvm-dev
> Archives.. Using llvm-dev: To post a message to all the list members, send
> email to llvm-dev at lists.llvm.org. You can subscribe to the list, or
> change your existing subscription, in the sections below.
>
>
>
> --
>
> Johannes Doerfert
> Researcher
>
> Argonne National Laboratory
> Lemont, IL 60439, USA
>
> jdoerfert at anl.gov
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/ada08657/attachment.html>


More information about the llvm-dev mailing list