Re: gcc on solaris

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/10/3 Christer Solskogen <christer.solskogen@xxxxxxxxx>:
> 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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux