Building crossgcc rpms (as non-root)

Bill Gatliff bgat@billgatliff.com
Fri Mar 19 21:29:00 GMT 2004


Charlie:


I took a stab at this late last year, I just posted my RPMs here:

http://billgatliff.com/twiki/bin/view/Crossgcc/ToolSetupRPMS

The RPMs build fine, but the installed toolchain doesn't work--- 
apparently there's a disconnect somewhere in the search paths.  I had to 
drop the project to put out other fires, and never got back to it.

Perhaps the posted RPMs will help.  They would build as non-root.

I took the approach of producing a bootstrapgcc RPM, which would be used 
by an RPM maintainer but wouldn't produce an RPM that normal users would 
need.


Regards,

b.g.


Charlie Brady wrote:

>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
>
>  
>

-- 
Bill Gatliff
GNU-based embedded development, training and consulting services.
bgat@billgatliff.com



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



More information about the crossgcc mailing list