Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Can I compile gcc with distcc?

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
davidshen84
Guru
Guru
Posts: 336
Joined: Sat Aug 09, 2008 4:36 pm

Can I compile gcc with distcc?

  • Quote

Post by davidshen84 » Sat Sep 30, 2023 11:31 pm

Hi,

My laptop is really old, and compiling gcc could take more than 2 hours. I have another Ubuntu system with gcc-12 and gcc-13 installed. I have configured distcc on both machines, and I can use distcc from my gentoo system and the compilations are distributed on both machines. I am even able to compile my kernel using distcc.

However, I could not compile gcc with distcc. Is it possible to use distcc when compiling gcc?


Thanks
David Shen
Top
sublogic
Guru
Guru
User avatar
Posts: 386
Joined: Mon Mar 21, 2022 3:02 am
Location: Pennsylvania, USA

Re: Can I compile gcc with distcc?

  • Quote

Post by sublogic » Sun Oct 01, 2023 12:38 am

davidshen84 wrote:My laptop is really old, and compiling gcc could take more than 2 hours. I have another Ubuntu system with gcc-12 and gcc-13 installed. I have configured distcc on both machines, and I can use distcc from my gentoo system and the compilations are distributed on both machines. I am even able to compile my kernel using distcc.

However, I could not compile gcc with distcc. Is it possible to use distcc when compiling gcc?
It is possible, but only for the first of three passes. With most compilers, certainly with gcc, you compile the sources with the system compiler, producing a binary of the new compiler. Then you compile again with the new compiler, producing new compiler #2, functionally equivalent to the first but not identical. Then you compile again with new compiler #2, producing new compiler #3 which should be identical to #2 if everything worked.

Distcc can produce #1, but is out of the loop when building #2 and #3.

You can do what I do: export your old laptop's root (and /var, if separate) by NFS to your faster computer and emerge gcc in a chroot. I cobbled a little script to prepare the chroot, including bind-mounting the helper's /var/tmp/portage on the NFS mount. PM me for details if you need help.

(The two computers have to trust each other ! root access both ways.)
Top
davidshen84
Guru
Guru
Posts: 336
Joined: Sat Aug 09, 2008 4:36 pm

  • Quote

Post by davidshen84 » Sun Oct 01, 2023 6:06 am

NFS+chroot, that's a good idea. Thanks

I wish gcc can be compiled using distcc directly. I guess version alignment is always tricky, and that's why nobody wants to try.
David Shen
Top
sam_
Developer
Developer
User avatar
Posts: 2814
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Sun Oct 01, 2023 9:32 am

With distcc, you need not just the same versions, but the same configuration and patches.

You're probably better off using binpkgs for this case.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Oct 01, 2023 11:53 am

davidshen84,

NFS sharing works,

Building in a chroot is good too.
Then you build everything on a big hairy system and make your own binaries. which you install on the slow system.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
davidshen84
Guru
Guru
Posts: 336
Joined: Sat Aug 09, 2008 4:36 pm

  • Quote

Post by davidshen84 » Mon Oct 02, 2023 3:39 am

NeddySeagoon,

Thanks a lot. I will give it a try later.
David Shen
Top
Post Reply

6 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic