Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-embedded
Navigation:
Lists: gentoo-embedded: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-embedded@g.o
From: "Dennis.Yxun" <dennis.yxun@...>
Subject: Re: Trying to Make Cross compile more firendly
Date: Fri, 27 Mar 2009 00:25:38 +0000
<br><div class="gmail_quote">On Thu, Mar 26, 2009 at 9:27 PM, Patrice Tisserand <span dir="ltr">&lt;<a href="mailto:ptisserand@...">ptisserand@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
From: &quot;Dennis.Yxun&quot; &lt;<a href="mailto:dennis.yxun@...">dennis.yxun@...</a>&gt;<br>
Subject: [gentoo-embedded] Trying to Make Cross compile more firendly<br>
Date: Thu, 26 Mar 2009 14:59:06 +0000<br>
<br>
Hi Dennis,<br>
<div class="im"><br>
&gt; HI Community:<br>
&gt;    I&#39;m trying to cross compile a stage1 base system for Openpandora. All the<br>
&gt; steps can be followed in this wiki [1].<br>
</div>Thanks for the link.<br>
[cut]<br>
<div class="im">&gt;    Actually the upstream provide two scripts [2] to setup the building<br>
&gt; environment. Which one is crossdev_set_environment.sh, it set SYSROOT same<br>
&gt; with ROOT, another is set_environment.sh, which make ROOT different from<br>
&gt; SYSROOT. Since SYSROOT is the cross<br>
&gt; toolchain&#39;s environment, and ROOT is the target rootfs. I perfer to take<br>
&gt; set_set_environment.sh&#39;s way, It would seperate toolchains and target<br>
&gt;  rootfs. So it will make the finanal rootfs more neat and clean, also will<br>
&gt; avoid potential file confliction. That could be possible, for example<br>
&gt; the linux-headers, both cross toolchain and target rootfs will emerge. Also<br>
&gt; maybe simply mark it as provided would solve this problem.<br>
</div>If you use a ROOT different of SYSROOT, you could have some issue with ld linker<br>
script.<br>
If you look at content of libc.so linker script, you will something like:<br>
GROUP (/lib/libc.so.6 ...)<br>
According to <a href="http://sourceware.org/binutils/docs/ld/File-Commands.html" target="_blank">http://sourceware.org/binutils/docs/ld/File-Commands.html</a> , it will<br>
work when this file is in sysroot but not when out of the sysroot.<br>
I have found there is a least the libc.so and libpthread.so linker script which<br>
have this issue.<br>
But maybe the same issue could be present in other linker script. </blockquote><div> </div><div>em.. this does require deep unstanding about LD linker working mechanism.<br>is SYSROOT  is related to cross-toolchain, so hardcoded?<br>
not sure whether we still can customize the library search paths.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div class="im"><br>
&gt;    The upstream&#39;s default embedded&#39;s make.conf only look for header files and<br>
&gt; library from ROOT&#39;s path. So if some lowlevel package<br>
&gt; looking for header file or library located at the toolchain&#39;s path, will fail<br>
&gt; at complile stage. I come cross and idea, maybe it&#39;s possible to add<br>
&gt; both SYSROOT and ROOT&#39;s path into compiler&#39;s looking path.So I just tweaked<br>
&gt; the CFLAGS and LDFLAGS[3]. I have no idea whill there be<br>
&gt; any problem with this. Still struggling and so far I got here.<br>
</div>I don&#39;t think it&#39;s necessary to add SYSROOT in headers and libraries search<br>
path, since gcc already looking in his sysroot.<br>
<div class="im"></div><br></blockquote><div><br>make sense, agree<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
<br>
&gt; [3] LDFLAGS=&quot; -L${ROOT}/lib  -L/${ROOT}/usr/lib \<br>
&gt; -L${SYSROOT}usr/lib -L${SYSROOT}lib \<br>
&gt; &quot;<br>
&gt; CFLAGS=&quot;-Os -pipe ${MARCH_TUNE} -fomit-frame-pointer \<br>
&gt;  -I${SYSROOT}/usr/include \<br>
&gt;  -I${SYSROOT}/include \<br>
&gt;  -I${ROOT}usr/include/ \<br>
&gt;  -I${ROOT}include/ \<br>
&gt; &quot;<br>
</div>For CFLAGS, I think it&#39;s better to replace -I${ROOT}/usr/include by -isystem<br>
${ROOT}/usr/include</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
If in a sofware source code you have a fle name features.h, some #include<br>
&quot;features.h&quot; and of course a -I. in his compilation CFLAGS.<br>
If your CFLAGS are appending to the sofware CFLAGS, it&#39;s fine.<br>
But if your CFLAGS are prepending to the software CFLAGS, it will use the first<br>
features.h found in -I directories.<br>
With -isystem this issue only occurs if in the compilation CFLAGS there is also<br>
a -isystem (which is quite unusual I think).</blockquote><div> </div><div>good suggestion  <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Regards,<br>
<font color="#888888">Patrice.<br>
<br>
</font></blockquote></div><br>
References:
Trying to Make Cross compile more firendly
-- Dennis.Yxun
Re: Trying to Make Cross compile more firendly
-- Patrice Tisserand
Navigation:
Lists: gentoo-embedded: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Trying to Make Cross compile more firendly
Next by thread:
[embedded] first step in programming geode target
Previous by date:
Re: Trying to Make Cross compile more firendly
Next by date:
Re: Trying to Make Cross compile more firendly


Updated Jun 17, 2009

Summary: Archive of the gentoo-embedded mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.