<p>Patrick Georgi has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27241">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/crossgcc: Allow building a new gcc against new binutils with -D<br><br>With -D, the newly built toolchain isn't installed into $prefix/...<br>but into $DESTDIR/$prefix/... while being built for $prefix alone.<br><br>This is useful for distributions, but it breaks down when the build<br>host already has the toolchain installed in $prefix without proper<br>build isolation (cf. gentoo):<br><br>In such cases libgcc etc are built using the new compiler (as gcc's<br>build system is smart enough to state the path explicitly), but that<br>compiler then uses its regular algorithm to determine the path to as,<br>ld, ...<br>That makes it use the tools from $prefix, which might differ in formats<br>(assembly, certain object file flags, ...): nds32le-elf in particular<br>has rather unstable formats still, and so new compilers can't work<br>with old binutils.<br><br>The approach to deal with this is to take an unused path that's<br>specified by gcc's build system ($out/gcc/$arch/$version) and symlink<br>it to the new toolchain - these explicitly given directories take<br>precedence over the default search path, and so the new binutils<br>are used.<br><br>Change-Id: Ia9a262e73f56cd486a2ae07422b598c205a03aed<br>Signed-off-by: Patrick Georgi <pgeorgi@chromium.org><br>---<br>M util/crossgcc/buildgcc<br>1 file changed, 2 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/27241/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc</span><br><span>index cd8a091..ef0c4d5 100755</span><br><span>--- a/util/crossgcc/buildgcc</span><br><span>+++ b/util/crossgcc/buildgcc</span><br><span>@@ -752,6 +752,8 @@</span><br><span>           --with-mpc=$DESTDIR$TARGETDIR \</span><br><span>              --with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \</span><br><span>                 && \</span><br><span style="color: hsl(120, 100%, 40%);">+  mkdir -p gcc/$TARGETARCH && \</span><br><span style="color: hsl(120, 100%, 40%);">+ ln -s $DESTDIR$TARGETDIR/$TARGETARCH/bin gcc/$TARGETARCH/$GCC_VERSION && \</span><br><span>   $MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc && \</span><br><span>    $MAKE install-gcc DESTDIR=$DESTDIR || touch .failed</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27241">change 27241</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27241"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia9a262e73f56cd486a2ae07422b598c205a03aed </div>
<div style="display:none"> Gerrit-Change-Number: 27241 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Georgi <pgeorgi@google.com> </div>