<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Monday, June 18, 2012 04:32:15 PM Sean Payne wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'Segoe UI,Tahoma,Verdana,Arial,sans-serif'; color:#2a2a2a; background-color:#ffffff;">I want to have clang and then llvm generate code for a specific CPU.  Eg, suppose I want it to build for the PowerPC 750 CPU, how am I meant to tell clang  </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'Segoe UI,Tahoma,Verdana,Arial,sans-serif'; color:#2a2a2a;"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'Segoe UI,Tahoma,Verdana,Arial,sans-serif'; color:#2a2a2a;">I'm running the latest latest trunk versions of clang and llvm on windows and I'm running clang in the debugger.  I've tried all sorts of combinations, but can't get the "CPU" member of TargetOptions to be populated.  e.g. here are some arguments I've tried that didn't work: </span><span style=" font-family:'arial,sans-serif'; color:#222222;">-target ppc750-bla-darwin   -S c:\projects\llvm_750\test1.cpp -o -</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'arial,sans-serif'; color:#222222;"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'arial,sans-serif'; color:#222222; background-color:#ffffff;">Thanks,</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'arial,sans-serif'; color:#222222;"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; background-color:#ffffff;"><span style=" font-family:'arial,sans-serif'; color:#222222; background-color:#ffffff;">Sean</span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br />Hi Sean,</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Interesting you should ask this question. Today I added an -mcpu option to my version off clang/LLVM:</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">[~/ellcc] main% bin/ecc -target ppc-ellcc-linux hello.c -v -mcpu=750</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">clang version 3.2 (http://ellcc.org/svn/ellcc/branches/newlib/llvm/tools/clang 2979)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Target: ppc-ellcc-linux</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Thread model: posix</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> "/home/rich/ellcc/bin/ecc" -cc1 -triple ppc-ellcc-linux -S -disable-free -main-file-name hello.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -msoft-float -target-cpu 750 -target-linker-version 2.21.53.0.1 -momit-leaf-frame-pointer -v -resource-dir /home/rich/ellcc/bin/../libecc -fmodule-cache-path /var/tmp/clang-module-cache -fno-dwarf-directory-asm -fdebug-compilation-dir /home/rich/ellcc -ferror-limit 19 -fmessage-length 87 -mstackrealign -fno-signed-char -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-KzHR2J.s -x c hello.c</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">clang -cc1 version 3.2 based upon LLVM 3.2svn default target x86_64-unknown-linux-gnu</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">#include "..." search starts here:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">#include <...> search starts here:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> /home/rich/ellcc/bin/../libecc/include</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> /home/rich/ellcc/bin/../libecc/usrinclude/ppc/linux</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> /home/rich/ellcc/bin/../libecc/usrinclude/ppc</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> /home/rich/ellcc/bin/../libecc/usrinclude/linux</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> /home/rich/ellcc/bin/../libecc/usrinclude</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">End of search list.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> "/home/rich/ellcc/bin/ppc-elf-as" -o /tmp/hello-ZIWKej.o /tmp/hello-KzHR2J.s -a32</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> "/home/rich/ellcc/bin/ecc-ld" -m elf32ppc --build-id --hash-style=gnu -e _start --eh-frame-hdr -Bdynamic -dynamic-linker /usr/libexec/ld.so -o a.out /home/rich/ellcc/bin/../libecc/lib/ppc/linux/crt0.o /home/rich/ellcc/bin/../libecc/lib/ppc/linux/crtbegin.o -nostdlib -L/home/rich/ellcc/bin/../libecc/ldscripts/linux -L/home/rich/ellcc/bin/../libecc/lib/ppc/linux -L/home/rich/ellcc/bin/../libecc/lib/ppc /tmp/hello-ZIWKej.o -Telf32ppc.x -lc -lcompiler-rt /home/rich/ellcc/bin/../libecc/lib/ppc/linux/crtend.o</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">[~/ellcc] main% </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Currently the TOT doesn't support -mcpu for the PowerPC.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-Rich</p></body></html>