THIS IS GONNA BE A LOOOOOOOOOOOONG POST , bear with me
Quote:
Originally Posted by business_kid
You have an absolute path there you know.
/linux/test/usr/bin/../lib64/gcc/x86_64-niteco-linux/4.5.2/ =
/linux/test/usr/lib64/gcc/x86_64-niteco-linux/4.5.2/
|
This is ONLY the case on a normal unchrooted shell
Quote:
Originally Posted by business_kid
The trouble with gcc is that it spreads directories like confetti at a wedding for reasons I never understood.
|
well the confetti install is mostly due the FHS standard as far as i understand it , but to be honest that's not the problem and i don't care where the package throws it's stuff because rpm does an excellent job managing all the spread confetti giving that i can specify the sub root dir with --prefix or similar ...etc
Quote:
Originally Posted by business_kid
I imagine the ones in chroot should be similar(/usr/bin/back-out-of-bin/lib64<blah>), but not all bits might be in the same place in chroot?
|
No , in the chroot i'm getting (
../lib64/gcc<blah>) and it causes problems with finding compiler binaries ...etc
Quote:
Originally Posted by business_kid
you will have a non functional gcc, and some of that stuff is hard coded in. There is no user config file.
|
yes i dealt with the hardcoded stuff by using
Code:
make DESTDIR=/relocated/dir install
but i'm still dealing with the dynamic (and weird behavior) of generating relative paths that lead to broken libs and exec bins...etc
Quote:
Originally Posted by business_kid
If you want a handy package system, check out slackware which uses a few scripts with no real dependency tracking. LFS also have some thing which you put between the make and install on the command line.
|
No Thanks , i do really appreciate a full blown package manager as opposed to the slack style ( yes for me dependency tracking is a prerequisite) and btw just wanted to point out that the "thing" you described that can be put between make and install is a utility which "redirects" all file operations to a given directory but according to LFS 6.8 it does have caveats and isn't reliable (from what i've gathered) so i'm not using it , besides most if not all packages that hardwire paths have extra features in "make install" that can redirect the installation out of the box without the need for unreliable third party stuff , and those who don't can be solved with running sed over their scripts (incase they aren't binaries)
Quote:
Originally Posted by business_kid
RPM is headaches. RPM lacks a --middle-finger option which it sorely needs.
|
well despite that fact that i'm not considering dumping RPM , i'm all ears to know about the "--middle-finger" option!
what's that ?
please elaborate...
Quote:
Originally Posted by knudfl
But why not always use the same folder for your chroot environment,
and simply do '../gcc-4.5.2/configure --prefix=/linux/test/ etc.',
or ../gcc-4.5.2/configure --prefix=/linux/test/gcc452/ etc.,
then all issues are avoided.
|
because things are lil' more complicated , the chroot environment is just a means to an end and not the end itself!
the target is to build a fully chrootable and self-contained toolchain to use for building an entire distro from scratch(scratch as from ziltch , this is not an LFS reference).
the second reason is that the method has to be packaging friendly as opposed to the spaghetti way of lfs , slack or else.
that said , i've made some progress here in the meantime and i'd like to share some results:
i've found out that if you run the following on your distro
Code:
chroot /chrootable/shell /bin/env -i /bin/bash
and assuming that "/chrootable/shell" contains a fully working GNU toolchain then attempting to compile with gcc with give you the exact same trouble that i'm getting !! (i.e cc1 not found)
and even more interestingly "gcc --print-search-dirs" will produce
relative paths as opposed to absolute ones outside the chroot!
the conclusion , is that all distros (at least the once i've examined opensuse 11.2 and CentOS ) are facing the same problem with gcc search-dirs , i've also find out that different distros deal with the problem by installing additional third-party scripts or executables that sort of "search" on behalf of gcc for it's own compiler binaries
for instance in CentOS , an application that i couldn't isolate so far located in /sbin (/sbin is the $PATH variable) is responsible for doing the job (i.e removing/adding /sbin to $PATH will either break or fix gcc)
on opensuse , a package called "openmpi" acts as a proxy for any gcc installation.
the first question is , why not just appending the compiler binaries path directly to $PATH?
to which the answer is : to allow multiple gcc's or even several gcc installations of the same version all of which have the same "--prefix" value , this way every gcc binary would have prior and independent knowledge of it's compiler binaries (cc1 , cc1plus ..) therefore avoiding collision of several gcc's .
the second (and open) question, what's the ideal way to solve this ?
in other words , what tools should we use to point gcc to it's compiler bins?
kind regards