gcc on solaris

Maciej (Matchek) Bliziński maciej@opencsw.org
Wed Jan 11 13:08:00 GMT 2012


2011/10/3 Christer Solskogen <christer.solskogen@gmail.com>:
> On 03.10.11 09:09, Maciej (Matchek) Bliziński wrote:
>
>> The SFW version of GCC has a special patch which makes it add the -R
>> flag by default.  Unless you add that a patch, GCC will not add
>> anything to RPATH on its own.
>>
>
> True. So I patched the specfile of gcc instead (as found in the link you
> gave me) - that worked perfectly! :-)
>
>        spec_string="%{m64:-R ${PREFIX}/lib/amd64 %D}%{!m64:-R ${PREFIX}/lib
> %D}"
>        ${PREFIX}/bin/gcc -dumpspecs | sed -e "/%D/d" | awk '{print}
> /*link_libgcc:/{print "'"${spec_string}"'"}' > ${OBJDIR}/specs
>        SPECFILE=`dirname $(${PREFIX}/bin/gcc -print-libgcc-file-name)`/specs
>        cp ${OBJDIR}/specs ${SPECFILE}
>
> Not sure how that works out on sparc(64).

I did it with a post-build shell script[1]:

"${gcc_bin}" -dumpspecs > specs
gsed -i -e \
'/\*lib:/,+1 s+%.*+& %{m64:-R /opt/csw/lib/64 } %{!m64:-R /opt/csw/lib}+' \
specs

...and shipping the package with a custom specs file. Works well.

Maciej

[1] https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/files/customize_specs.sh



More information about the Gcc-help mailing list