<div class="gmail_quote">---------- 轉寄的郵件 ----------<br>寄件者:"Yun-Chih Chen" <<a href="mailto:b03902074@ntu.edu.tw">b03902074@ntu.edu.tw</a>><br>日期:2016/7/21 下午10:25<br>主旨:Re: Cross compile strace for obscure architectures<br>收件者:"Dmitry V. Levin" <<a href="mailto:ldv@altlinux.org">ldv@altlinux.org</a>><br>副本:"Philippe Ombredanne" <<a href="mailto:pombredanne@nexb.com">pombredanne@nexb.com</a>><br><br type="attribution">>> I am thinking about cross compiling strace and test<br>
>> it on the m68k image.  In other words, compile all necessary binaries,<br>
>> including test binaries, on host system; and test them on qemu guest.<br>
><br>
> This sounds feasible, but I haven't heard of anybody trying to do this<br>
> trick with strace test suite.  This approach will take some time, though.<br>
<br>
I try to do so by running the `cross-m68k.sh` script, as attached (a<br>
sample run log is also attached, although it failed)<br>
<br>
> In particular, some architectures have no crossbuild-essential-$arch<br>
> packaged, so you'd probably have to prepare a cross toolchain using<br>
> cross-gcc-dev.<br>
<br>
buildroot, in addition to building a rootfs, also builds cross<br>
toolchain for us, which is nice.<br>
<br>
>> For now, I can successfully build strace with "CFLAGS=-static"<br>
><br>
> Why CFLAGS instead of LDFLAGS?<br>
Well, I'm not very clear about the difference, but both works.<br>
<br>
> Why would you want to cross-compile gcc?<br>
> I suppose every debian architecture has a native gcc.<br>
Yes, I find native m68k gcc3.4 here[1], built for Debian Sarge, which<br>
is very old.  I think it'd be better to run our tests on m68k rootfs<br>
compiled with newest Linux kernel.  Does this make sense?<br>
<br>
[1] <a href="http://archive.debian.org/debian/pool/main/g/gcc-3.4/" rel="noreferrer" target="_blank">http://archive.debian.org/debian/pool/main/g/gcc-3.4/</a><br>
</div>