This is the mail archive of the crossgcc@sourceware.org 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]

creating relocatable binutils


I'm working with native compilation, but the same issue holds for
crosscompilers and I'll need to go there.

The goal is to create RPMs for toolchains (native and cross) that
have a default installation prefix (for system wide installation) but
that allows for regular users to install under their $HOME or wherever
they have the right permissions.

RPMs are binary packages.

The rpm command has a --prefix option that would physically move the
tree to wherever the user wants.

I've been able to get relocatable rpms for binutils by linking the
binutils executables statically, but this is not ideal (to be honest I
haven't benchmarked real compilation to see whether it really makes a
difference and the difference in size doesn't bother me at all).

Dynamic linking would require the user (or rpm, but this is immaterial)
to run ldconfig on relocated binutils' lib directory (where libopcodes
and libbfd live). Unfortunately this requires root permissions.

One way I see is to use -rpath whan compiling binutils, but
(although I haven't tested it) I believe the rpath must be an absolute
directory, which makes this solution unsuitable for me (only the end
user would know the final destination).

Another way is to force gcc to set  LD_LIBRARY_PATH before calling ld or
as. In my case I can assume that the gcc installed location will be
related to binutils' in a known way and I could derive the right
LD_LIBRARY_PATH setting. But this approach doesn't look nice.

Any suggestions?

TIA

        Maurizio


--
For unsubscribe information see http://sourceware.org/lists.html#faq


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