<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi Aboulaye,</div><div><br></div><div>Thank you very much for your information!</div><div>For now, I have succeeded in compilation of simple code. When I move to the complex ones, I will use this toolkit.</div><div>Thank you!</div><div><br></div><div>Sincerely,</div><div>Hanbing</div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"Abdoulaye Walsimou Gaye" <awg@embtoolkit.org><br><b>À: </b>"Hanbing Li" <hanbing.li@inria.fr>, llvmdev@cs.uiuc.edu<br><b>Envoyé: </b>Jeudi 6 Novembre 2014 19:30:28<br><b>Objet: </b>Re : [LLVMdev] Cross-compiler to arm<br><div><br></div><div style="font-size: 12pt; font-family: Calibri,sans-serif;" data-mce-style="font-size: 12pt; font-family: Calibri,sans-serif;">Hello,<div>EmbToolkit may be an option for you.</div><div>The latest git source tree is able to give you the needed --sysroot env (with different choices of c library) for you target arm, a cross compiler (clang/llvm or gcc, or both), build Linux kernel (gcc cross compiler), build a root filesystem.</div><div>All this under Mac os X.</div><div><br></div><div>Cheers,</div><div> awg</div><br><div id="htc_header">----- Reply message -----<br>De : "Hanbing Li" <hanbing.li@inria.fr><br>Pour : <llvmdev@cs.uiuc.edu><br>Objet : [LLVMdev] Cross-compiler to arm<br>Date : jeu., nov. 6, 2014 18:21</div></div><br><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000" data-mce-style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000;"><div>Hi list,</div><div><br></div><div>I want to use LLVM to compile the C code to arm.</div><div>Host: Mac OS X 10.10</div><div>Target: Pandaboard, armv7l, ubuntu</div><div><br></div><div>I found some useful information but not worked yet.</div><div><br></div><div>I tried like this:</div><div><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">$ clang -fomit-frame-pointer -ggdb -emit-llvm --target=armv7l-unknown-linux-eabi -mcpu=cortex-a9 —mfpu=neon -mfloat-abi=softfp --sysroot=/... test.c -c -o test.bc</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">--></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">clang-3.5: error: no such file or directory: '—mfpu=neon'</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">clang-3.5: error: -emit-llvm cannot be used when linking</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">clang-3.5: error: no such file or directory: '—-sysroot=...'</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;"><span id="mce_25_start" style="overflow:hidden;line-height:0px" data-mce-style="overflow: hidden; line-height: 0px;"></span>when I tried like this: </span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">$ clang -fomit-frame-pointer -ggdb -emit-llvm --target=armv7l-unknown-linux-eabi -mcpu=cortex-a9 test.c -c -o test.bc</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">It worked. Then I did:</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">$ llc test.bc -o test.s</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;" data-mce-style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;">And sent the test.s to the </span><span style="font-size: medium;" data-mce-style="font-size: medium;">pandaboard. On the board, I did:</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;"></span><span style="font-family: Menlo; font-size: 11px;" data-mce-style="font-family: Menlo; font-size: 11px;">$ as -o test.o test.s</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-family: Menlo; font-size: 11px;" data-mce-style="font-family: Menlo; font-size: 11px;">$ </span><span style="font-family: Menlo; font-size: 11px;" data-mce-style="font-family: Menlo; font-size: 11px;">ld -e main -o a.out test.o</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">$ ./a.out</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">--></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;">Segmentation fault (core dumped)</p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">This is what I got. </span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">The test.c is very simple. Even like</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">int main(){</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">int i=0;</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">return 0;</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">}</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">Still no work.</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;"><br></span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;">BTW, someone said: <span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff;" data-mce-style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff;">Toolchain on host : </span><span style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Arial, Helvetica, sans-serif; background-color: #f4f5f7; color: #555555; font-size: 12px; line-height: 17px;" data-mce-style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Arial, Helvetica, sans-serif; background-color: #f4f5f7; color: #555555; font-size: 12px; line-height: 17px;">sudo apt-get install gcc-arm-linux-gnueabi</span></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;" data-mce-style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;">How to realize this in MacOS?(port or brew)? I also found something here: <a href="https://launchpad.net/gcc-arm-embedded/+download" target="_blank" data-mce-href="https://launchpad.net/gcc-arm-embedded/+download">https://launchpad.net/gcc-arm-embedded/+download</a>. </span><span style="font-size: medium;" data-mce-style="font-size: medium;"><br></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;" data-mce-style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;">Is this the same thing or not?</span></p><p style="margin: 0px; font-size: 11px; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;" data-mce-style="font-size: medium; font-family: 'times new roman', 'new york', times, serif;"><br></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;">Does anyone know how to cross-compile from MacOS to arm? Or tell me what's wrong with my operations! Any suggestion or information is appreciated!</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;"><br></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;">Thanks,</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;">Hanbing</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;"><br></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-size: medium;" data-mce-style="font-size: medium;"><br></span></p></div></div></blockquote><div><br></div></div></body></html>