Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18034 - modifed gcc ebuild that can build native or cross tool chains
Summary: modifed gcc ebuild that can build native or cross tool chains
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 17120 (view as bug list)
Depends on: 18031 18032 18033 18933
Blocks: 17858 18936
  Show dependency tree
 
Reported: 2003-03-23 04:44 UTC by James Boddington (RETIRED)
Modified: 2004-11-16 17:04 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for gcc-3.2.2-r1 (gcc-3.2.2-r1.diff,7.04 KB, patch)
2003-03-23 04:46 UTC, James Boddington (RETIRED)
Details | Diff
allows the 1st stage gcc to be build for ppc (gcc-3.2-crossppc.diff,2.88 KB, patch)
2003-03-23 04:57 UTC, James Boddington (RETIRED)
Details | Diff
allows the 1st stage gcc to be built for alpha (gcc-3.2.2-cross-alpha.diff,1.85 KB, patch)
2003-03-23 04:59 UTC, James Boddington (RETIRED)
Details | Diff
allows the 1st stage gcc to be built for x86 (gcc-3.2.2-cross-x86.diff,2.54 KB, patch)
2003-03-23 05:00 UTC, James Boddington (RETIRED)
Details | Diff
6/4/2003 patch for gcc-3.2.2-r1 (gcc-3.2.2-r1.diff,9.43 KB, patch)
2003-04-05 21:17 UTC, James Boddington (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Boddington (RETIRED) gentoo-dev 2003-03-23 04:44:44 UTC
This patch for gcc-3.2.2-r1.ebuild allows the ebuild to create a native gcc or a cross compiler 

Reproducible: Always
Steps to Reproduce:
1. emerge gcc 
   Native gcc 
2. CCHOST=sparc-unknown-linux-gnu USE=build emerge gcc 
    Build a 1st stage gcc for cross tool chain to compile the cross glibc. 
3. CCHOST=sparc-unknown-linux-gnu emerge gcc 
    Builds the 2nd stage gcc for the cross tool chain.
Comment 1 James Boddington (RETIRED) gentoo-dev 2003-03-23 04:46:49 UTC
Created attachment 9717 [details, diff]
patch for gcc-3.2.2-r1

Related to
linux-headers bug 18031
binutils	  bug 18032
glibc		   bug 18033
Comment 2 James Boddington (RETIRED) gentoo-dev 2003-03-23 04:52:05 UTC
The components of this tool chain on my system have been emerged  
and unmerge cleanly. I have build 8 differernt tool chains with these 
ebuilds. I have used this gcc ebuild to update my system compiler  
as well building cross compilers. 
 
So it also seems to play nice with gcc-config 
 
gcc-config --list-profiles 
Lists every compiler installed 
 
gcc-config sparc-unknown-linux-gnu-3.2.2 
Will change the system compiler to the cross compiler. 
Comment 3 James Boddington (RETIRED) gentoo-dev 2003-03-23 04:57:48 UTC
Created attachment 9718 [details, diff]
allows the 1st stage gcc to be build for ppc

This patch is only for the 1st stage gcc when targeting ppc. Once glibc has
been build this patch is not needed.
Comment 4 James Boddington (RETIRED) gentoo-dev 2003-03-23 04:59:44 UTC
Created attachment 9719 [details, diff]
allows the 1st stage gcc to be built for alpha

This patch is for building the 1st stage gcc for alpha. Once glibc has been
built this patch is not needed.
Comment 5 James Boddington (RETIRED) gentoo-dev 2003-03-23 05:00:38 UTC
Created attachment 9720 [details, diff]
allows the 1st stage gcc to be built for x86

Allows the 1st stage gcc to be built when targeting x86. Once glibc has been
built this patch is not needed.
Comment 6 Zach Welch (RETIRED) gentoo-dev 2003-03-23 13:43:54 UTC
Like glibc, this gcc ebuild needs a little more review before I am ready to
commit it; however, Aiken's collection of ebuilds is by far the most integrated implementation I have seen to date, and I will be trying to focus everyone's attention to these for testing and revision.

Since a full cross-gcc toolchain results from the sequential installation of binutils (bug 18032), linux-headers (bug 18031), glibc (bug 18033), and finally
the full gcc itself, I am marking this bug for cross-gcc as dependent on those
other cross-compiling ebuilds. 
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-23 14:25:54 UTC
I have a few small issues with this.

1)  It should be

      cross-check ${MY_PV}

    and not:

      cross-check 3.2.2

2)  Having gcc symlinks in /usr/bin will break multi-version support.

3)  If it will run fix_libtool_files.sh, I will have to change it to take
    and optional target of CCHOST, else its gonna bork the real system stuff :/

That is it for a quick peek.
Comment 8 James Boddington (RETIRED) gentoo-dev 2003-04-05 21:17:14 UTC
Created attachment 10248 [details, diff]
6/4/2003 patch for gcc-3.2.2-r1

After preliminary testing this ebuild will create a native gcc, a cross gcc and
also be cross compiled.

It is now symlinking any libs in /usr/lib/gcc-lib/$CCHOST/$PV/ to
/usr/$CCHOST/lib
This will allow $CCHOST-ld to find the cross libgcc* and libstdc++* with out
having to set extra flags.

The multi version stuff is still be looked at. The $CCHOST-gcc sym links back
to /ust/bin at least give access to the cross compiler.
Comment 9 Zach Welch (RETIRED) gentoo-dev 2003-04-07 19:21:56 UTC
*** Bug 17120 has been marked as a duplicate of this bug. ***
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-08 15:16:45 UTC
> The multi version stuff is still be looked at. The $CCHOST-gcc sym links back
> to /ust/bin at least give access to the cross compiler.

Which part of NO don't you understand ?  Currently gcc have issues with symlinks
from /usr/bin (or where ever) to its true bin dir .. have a look at bug #8132.

If you want to have access all the time, just install the $CCHOST-* binaries in
the real bin dir, and not the unhosted ones, and always add this to the $PATH.
Comment 11 James Boddington (RETIRED) gentoo-dev 2003-04-09 20:35:25 UTC
>Which part of NO don't you understand ? 
 
Where did you say NO? 
 
You did say the sym links break being able to have multiple versions. Which I agree 
with. I was staying with the sym links until something better came along.  Up until you 
showed me bug 8132 I have not had not seen any problems with using the symlinks. 
 
gcc-config <cross compiler>     is far too dangerous to use. 
 
I can say I have been there done that and had to recover a couple of packages 
because I forgot to use gcc-config to change back to the native compiler. 
 
Some of the results so far are at 
http://www.gentoo.org/~aiken/gentoo-cross/gentoo-cross.html#SECTION000100000000000000000 
 
The arm and sparc cross compilers were produced by these ebuilds. Actually every 
compiler listed on that page excluding the linux->mingw32 and cygwin->linux compilers 
were produced with these ebuilds or earlier versions. I have used the sparc chroot on 
my machine and Zach has tried the arm chroot on his netwinder. I have also cross 
compiled a LFS stage1. My sparc runs a 2.2.20 kernel that was cross compiled using 
a 2.95.3 cross compiler that was produced in a similar manner. 
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-12 19:09:18 UTC
Comment 7 actually ;-)
Comment 13 Zach Welch (RETIRED) gentoo-dev 2003-04-27 17:28:59 UTC
Comment on attachment 10248 [details, diff]
6/4/2003 patch for gcc-3.2.2-r1

A new patch will be posted shortly.
Comment 14 James Boddington (RETIRED) gentoo-dev 2003-05-08 23:34:55 UTC
How important is get_number_of_jobs() in the gcc ebuild? 
 
At the moment I am only letting the ebuild use get_number_of_jobs() 
if building a native compiler. This is stopping this function from aborting 
the build. 
 
       if ! cross-target && ! cross-build 
       then 
                # Setup -j in MAKEOPTS 
                get_number_of_jobs 
       fi 
 
 
It uses ARCH to determine which /proc/cpuinfo  format to use. When building 
a cross toolchain or cross compiling gcc ARCH will equal the target arch 
not the local arch so there is a very good chance it will try using the wrong 
format for /proc/cpuinfo then abort the build. I have also had get_number_of_jobs() 
abort a build when I was targeting cris-axis-linux-gnu which is a valid target. The 
die message was Unknown ARCH -- cris! 
 
When I bypass get_number_of_jobs() I normaly use -j2 or -j4 with no apparent 
ill effect. 
 
Comment 15 Alexander Gabert (RETIRED) gentoo-dev 2004-03-05 03:03:57 UTC
hi

what is the current status for this?

Alex
Comment 16 SpanKY gentoo-dev 2004-04-18 23:07:19 UTC
*** Bug 44731 has been marked as a duplicate of this bug. ***
Comment 17 solar (RETIRED) gentoo-dev 2004-04-19 20:35:07 UTC
Is this bug still valid? Can it be closed? 
Comment 18 Alexander Gabert (RETIRED) gentoo-dev 2004-07-08 13:11:57 UTC
obsoleted by crossdev tool in the future?

*hint*hint*

sinc,

Alex
Comment 19 SpanKY gentoo-dev 2004-07-08 14:46:00 UTC
no

crossdev is a hack to work around a portage that cant handle cross compiling
Comment 20 SpanKY gentoo-dev 2004-11-16 17:04:49 UTC
no, we want to make crossdev not needed ...

ive got work in gcc-3.4.3 ... all you have to do is:
env CTARGET="sh4-pc-linux-uclibc" emerge gcc

if something breaks, file a bug :)