Forums

Skip to content

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

Creating binpkg for slow machines

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
cogman
n00b
n00b
Posts: 10
Joined: Wed Oct 02, 2024 7:17 pm

Creating binpkg for slow machines

  • Quote

Post by cogman » Tue Mar 10, 2026 8:38 pm

I'm looking for tips on how to approach this.

I have an AMD server with some beefy hardware and a slower laptop with not so beefy hardware (Intel skylake). I'd like to use the AMD server to produce binary packages for my slower laptop with all the trimmings.

Reading over the binary package guide, it looks like I have 4 options.

The first, which is my least preferred, is I could weaken the optimizations down to a common target compatible for everyone. This is definitely the easiest thing to do.

The second, is a chroot environment. The main issue here (as I see it) is I'd be targeting skylake in this env, but I'd be running on an AMD box. that MAYBE fine as I believe my AMD CPU (zen3) has all the same instructions as skylake, but it also might not be if there's some oddball intel only instructions which get inserted into the output.

The 3rd option would be to (somehow) leverage crossdev to create binary packages specifically for my laptop. The issue here is that my laptop has ultimately the same architecture as my host system and cross dev doesn't appear to allow me to split the two up. (Maybe I'm missing something here). This would be my most preferred route, but IDK how to make it work.

The 4th option would be to use qemu (somehow) and emulate my laptop. This is probably doable but it's nasty. Ideally I'd want the host system to be able to build these packages on a schedule and a virtual machine just makes that annoying to deal with. I'd rather not do this.

Any suggestions here would be great. I'd also like to potentially extend this for other computers I own which run into similar problems. It'd be nice to have these packages compiled by my server for those computers while I'm sleeping.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56081
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Mar 10, 2026 8:54 pm

cogman,
The second, is a chroot environment. The main issue here (as I see it) is I'd be targeting skylake in this env, but I'd be running on an AMD box. that MAYBE fine as I believe my AMD CPU (zen3) has all the same instructions as skylake, but it also might not be if there's some oddball intel only instructions which get inserted into the output.
The build system emitting "oddball intel only instructions" is OK as long as you don't try to execute them during the build process too.
That would get you an Illegal Instruction Exception. dmesg will tell you all about that.

The Build In A Chroot is the way to go.
Crossdev can't be used.
You may need to set some per package CFLAGS in the chroot to avoid Illegal Instructions but you won't know until you try.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
mega_flow
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 100
Joined: Sun Jun 26, 2016 9:54 pm
Location: Belgium

  • Quote

Post by mega_flow » Wed Mar 11, 2026 8:04 am

Hello

I'm using the same setup
My old computer is a intel haswell cpu and my laptop is a amd cpu
this is the make.conf for the build computer

Code: Select all

WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-O2 -pipe -march=x86-64-v3 -mtune=znver3 -flto -fomit-frame-pointer ${WARNING_FLAGS}"
CFLAGS="${COMMON_FLAGS} -fno-plt -fexceptions"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${COMMON_FLAGS} -fno-plt"
FFLAGS="${COMMON_FLAGS}"
RUSTFLAGS="-C target-cpu=x86-64-v3 -C link-arg=-Wl,-z,pack-relative-relocs"
CPU_FLAGS_X86="aes avx avx2 bmi1 bmi2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"

PORTAGE_ELOG_SYSTEM="save"
PORTAGE_ELOG_CLASSES="warn error info log qa"
PORTAGE_SCHEDULING_POLICY="idle"

FEATURES='${FEATURES} buildpkg binpkg-multi-instance -network-sandbox'
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --binpkg-respect-use=y --binpkg-changed-deps=y"
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --buildpkg-exclude='acct-group/* acct-user/* virtual/* app-eselect/* */*-bin'"

MAKEOPTS="-j4 -l5"
I have set the use flags in a custom profile (no-miltilib + gnome) so i dont need to edit all make.conf https://github.com/megaflow8/megaflow
The latop have some extra cpu_flags_x86 but only dev-libs/libgcrypt benefit from that 1
As for chroot i use systemd-nspawn and machinectl on a encrypt image
for the file server i use www-servers/lighttpd and rsync to sync portage and the custom overlay form my build computer to my laptop keep all in sync

The laptop can get to 4000 rpm in fans speed . so night build was is to loud for the people I live with
i'm using this setup for 2 year and i like it
Legion Slim 5 16ARP9
Top
mid-kid
n00b
n00b
Posts: 26
Joined: Sun Aug 24, 2014 9:51 am

  • Quote

Post by mid-kid » Sun Mar 15, 2026 1:32 pm

NeddySeagoon wrote:...
Crossdev can't be used.
...
I've never tried this myself, but I'm not entirely certain why?
You can create a cross-toolchain for x86_64-mylaptop-linux-gnu, set CHOST=x86_64-mylaptop-linux-gnu on the target system's make.conf, and every build system will treat this as cross-compilation. Alternatively you can create a chroot where you change the CHOST to x86_64-mybuilder-linux-gnu and a crossdev to cross-compile to x86_64-pc-linux-gnu.
That said, crossdev brings its own slew of headaches, with many packages that can't be cross-compiled, or have issues, but in theory, I'm not sure why it wouldn't?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56081
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Mar 15, 2026 1:42 pm

mid-kid,

If you change the tuple as you suggest, it will probably work.
With the default x86_64-unknown-linux-gnu parts of the cross toolchain overwrite the host toolchain.

Using x86_64-mylaptop-linux-gnu as a tuple ensures that you cannot use binaries with any other tuple. You are very much on your own.

As you say, crossdev is a mixed blessing.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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