Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Using gcc binpkg on different profile

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
salam
Apprentice
Apprentice
Posts: 231
Joined: Thu Sep 29, 2005 8:52 am

Using gcc binpkg on different profile

  • Quote

Post by salam » Tue Feb 24, 2026 4:28 pm

I have 2 hosts, a fast bare metal and a slow VM. As this package takes ages to complete, I am thinking, if it is possible to build gcc(emerge -B) on the fast one and use it as a binary package on the slower. But they have different profiles.

Fast: [9] default/linux/amd64/23.0/no-multilib (stable) *
Slow: [13] default/linux/amd64/23.0/no-multilib/hardened/selinux (stable) *

CFLAGS are same on both:
COMMON_FLAGS="-O2 -pipe -march=x86-64 -mtune=intel"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
ABI_X86="64"

The only difference i see is the hardened use flag on gcc. So would using a binary on the slower host, made with USE="hardened" emerge -B gcc, work correctly, or is there something that prevents such a build?
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Tue Feb 24, 2026 4:57 pm

I'd expect it to work, but it might rebuild other stuff with hardened on your non-hardened machine if something else needs to be hardened to build hardened gcc?

I'd try an USE="hardened" emerge -pv sys-devel/gcc to see if it pulls in/wants other stuff to be built.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56106
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Feb 24, 2026 5:09 pm

salam,

The hardened profile turns on extra default gcc flags. They would be missing if you used the binary from the the fast machine.

You could run your own binhost builder in a chroot on the fast system, then install the binaries on the VM.
The chroot would be a copy of the VM.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
pietinger
Administrator
Administrator
Posts: 6640
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Feb 24, 2026 8:48 pm

salam,

maybe you are interested in this wiki article:
https://wiki.gentoo.org/wiki/Hardened/Toolchain#Changes
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
salam
Apprentice
Apprentice
Posts: 231
Joined: Thu Sep 29, 2005 8:52 am

  • Quote

Post by salam » Wed Feb 25, 2026 2:09 pm

After digging out some additional info, i tried it the hard way - so first i compiled gcc on the non-hardened host:

Code: Select all

USE="hardened" emerge -av1B gcc
I then locally extracted the package to see what differs. So far, i worked only with a single binary - x86_64-pc-linux-gnu-gcc
Executed cmp -l -b on the original build, which was done on the hardened profile and this new build(non-hardened profile, but forced +hardened use flag). But I only found out that the whole difference is the order of flags passed to ./configure

I see the diff only in 2 places:

Code: Select all

  [ 2] .note.gnu.bu[...] NOTE             00000000000003d8  000003d8
       0000000000000024  0000000000000000   A       0     0     4
and

Code: Select all

  [18] .rodata           PROGBITS         00000000000f9000  000f9000
       00000000000b28f8  0000000000000000   A       0     0     32
The rodata diff is exactly the config flag order, which is quite readable even from cmp output
Other than that, the binaries look the same. Or am i searching a completely wrong place?
Top
Post Reply

5 posts • Page 1 of 1

Return to “Portage & Programming”

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