Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 238521

Summary: emerge sys-libs/glibc with --buildpkgonly (-B)
Product: Gentoo Linux Reporter: RNZ <renoizer>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED TEST-REQUEST    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/proj/en/base/embedded/cross-development.xml
Whiteboard:
Package list:
Runtime testing required: ---

Description RNZ 2008-09-23 23:00:40 UTC
I emerge sys-libs/glibc whith --buildpkgonly (-B) (on my fast machine) for install to old-PC (slow machine) using next command:
sudo env CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer" emerge -Bav =sys-libs/glibc-2.6.1


--buildpkgonly (-B) - Creates  binary packages for all ebuilds processed without actually merging the packages.  This comes with the caveat that  all build-time dependencies must already be emerged on the system.

But: 
* Sanity check to keep you from breaking your system:
*  Downgrading glibc is not supported and a sure way to destruction
* 
* ERROR: sys-libs/glibc-2.6.1 failed.

if using emerge option -B, my allow to compile if not install options present?

Reproducible: Always

Steps to Reproduce:
1. sudo env CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer" emerge -Bav =sys-libs/glibc-2.6.1
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-24 03:37:40 UTC
Have you considered any of the many other ways to build this older glibc for the slower system? Because of other differences between the two systems (other than the glibc version), installing a glibc made on one system onto the other system is probably not a good idea either. Setting up a staging chroot on the faster system is probably what you want. Heck, even chrooting into the NFS-mounted root fs of the slower system is probably a better idea than extracting something baked on the faster system.
Comment 2 RNZ 2008-09-26 19:51:50 UTC
(In reply to comment #1)
May be approve build package only? --buildpkgonly != Donwgrade
Comment 3 Harald Urkan 2008-09-29 09:33:41 UTC
> May be approve build package only? --buildpkgonly != Donwgrade
 
You can do that, since nothing will be merged on your system. No worries.

You can also use the ready-made package from tinderbox:
http://tinderbox.dev.gentoo.org/html/default-linux/x86/All/glibc-2.6.1.html

Glibc will override your CFLAGs anyway, so the resulting binaries will most likely always be identical on CTARGET=x86 (and any other CTARGET respectively). There is little point in building it yourself.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-29 13:20:12 UTC
Please have a look at the cross compiling documentation - it may not sound like what you think you need, but getting portage and your toolchain to compile for a different target than the local system is more or less exactly what cross compiling means. If it turns out that you cannot accomplish building the older sys-libs/glibc because of portage or the ebuild ignoring the target and root that you set, please reopen this bug.
Comment 5 RNZ 2008-09-29 14:10:51 UTC
Harald Urkan > You can do that, since nothing will be merged on your system. No 
How? If use emerge with --buildpkgonly glibc-2.6.1, but system having newest version of glibc - process stopped with error "Downgrading glibc is not supported and a sure way to destruction" 

>You can also use the ready-made package from tinderbox...
>Glibc will override your CFLAGs anyway...
Thank you.


Jeroen Roovers > Please have a look at the cross compiling documentation...
Drop - build for older system and cross compiling.
I ask: Why emerge is not allow build only (--buildpkgonly) glibc older than installed version?
Comment 6 Harald Urkan 2008-09-29 16:22:26 UTC
> How? If use emerge with --buildpkgonly glibc-2.6.1, but system having newest
> version of glibc - process stopped with error "Downgrading glibc is not
> supported and a sure way to destruction" 

I see the problem. You could modify the ebuild a little.
The function src_setup() has the following block of code in it. If you comment it out, the ebuild will not perform a check:

==========================

# prevent native builds from downgrading ... maybe update to allow people
# to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && \
[[ ${CHOST} == ${CTARGET} ]] ; then
   if has_version '>'${CATEGORY}/${PF} ; then
      eerror "Sanity check to keep you from breaking your system:"
      eerror " Downgrading glibc is not supported and a sure way to destruction"
      die "aborting to save your system"
   fi
fi

==========================

Don't accidentally merge this to the wrong system ;)

Alternatively, chroot into a 2008.0 (stage3) tarball, which has glibc-2.6.1., and either use quickpkg (see man quickpkg) or emerge --buildpkg to generate your glibc binaries.

Also -- please correct me if I'm wrong, Jeroen -- a cross-compiling toolchain is not needed when compiling for the same CHOST.

In this case, both machines should hopefully be i686-pc-linux-gnu.
Comment 7 RNZ 2008-09-29 18:07:49 UTC
Harald Urkan > I see the problem. You could modify the ebuild a little.
8)) Thanks, but I already fix this and use overlay 8))

But I think, rightly add, in glibs(and other) ebuild, checking for existing option --buildpkgonly

Sorry for my bad English.