This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building crossgcc rpms (as non-root)


I'm struggling with a set of issues that don't seem to have documented 
solutions, which somewhat surprises me. You'll see I've parenthesised "as 
non-root" above, as I believe it should be an assumption (of course, one 
always builds rpms as non-root!) although I daily find evidence that it 
isn't.

The standard practice for building RPMs as non-root is to use a BuildRoot 
- a sandbox into which one installs files before packaging. It's 
essentially a chroot area. There's two reasons for doing this - one is 
security (as non-root, you don't have permission to write to the final 
file location), and the other is because you don't want to pollute your 
build system's file system.

The process for building a gcc cross-compiler is (IIUC):

1. Configure, build and install binutils
2. Build a bootstrap-compiler
3. Build and install header files and glibc
4. Build and install gcc

Step 1 is OK, because we can make an RPM (installing into a BuildRoot in 
the process), then install the RPM as root. The cross-binutils RPM can be 
a BuildPrereq of the cross-gcc RPM.

Step 2 is OK, we can build the bootstrap compiler into a local directory.

Step 3 is maybe OK, except we need to install the header files and 
libraries into a BuildRoot location. Setting install_root seems to do that 
OK.

Step 4 is where things always go wrong for me. The build of gcc proper 
always fails because it can't find the include files built in Step 3, 
because they have not yet been installed in their final location.

Does anyone know the correct magic incantation? Is there a way to 
configure a gcc build with separate "include files are here at the moment" 
and "include files will be here at run time" locations? Ditto for 
libraries/startup objects.

Or is it feasible, and best, to make a cross-glibc and headers RPM (built 
using a bootstrap compiler), and install that before building the final 
cross-gcc?

Thanks for your thoughts

--
Charlie Brady

A: Because we read from top to bottom, left to right.
Q: Why should i start my reply below the quoted text?



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]