Re: Solaris 10: wchar_iso.h vs cwchar

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

 



2011/9/4 Jonathan Wakely <jwakely.gcc@xxxxxxxxx>:
> 2011/9/3 Maciej Bliziński:
>> 2011/9/3 Jonathan Wakely <jwakely.gcc@xxxxxxxxx>:
>>>> Any ideas why the RPATH might be missing?
>>>
>>> This is a FAQ, read the docs. Your dynamic linker doesn't look in /opt/csw
>>> and gcc does not use a rpath automatically. Building gcc is not trivial,
>>> read the docs! Carefully!
>>
>> I have read the docs. The configuration stage instructions explain this part:
>>
>> "...also the --with-mpc=mpcinstalldir option is shorthand for
>> --with-mpc-lib=mpcinstalldir/lib and
>> --with-mpc-include=mpcinstalldir/include"
>>
>> On my system, these locations are correct, the following files exist:
>>
>> /opt/csw/include/mpc.h
>> /opt/csw/lib/libmpc.so -> libmpc.so.2.0.0
>> /opt/csw/lib/libmpc.so.2 -> libmpc.so.2.0.0
>
> Did you read the whole of that paragraph?  Right there it says "You
> might also need to ensure the shared libraries can be found by the
> dynamic linker when building and using GCC, for example by setting the
> runtime shared library path variable (LD_LIBRARY_PATH on GNU/Linux and
> Solaris systems). "

Does it mean that you have to set LD_LIBRARY_PATH every time you run a
program compiled with gcc?

libstdc++.so.6 needs to have the information necessary to find
libgcc_s.so.1 without LD_LIBRARY_PATH, otherwise it won't meet the
criteria necessary to be released at OpenCSW.

>> I assumed that the information about libmpc.so.2 location is passed to
>> the intermediate binaries.
>
> You assume wrong, and the docs pretty clearly say you might need to
> ensure the dynamic linker can find the libs.  Since your problem is
> that the dynamic linker can't find the libs, maybe those docs are
> relevant :)

Is this documentation available in source form?  I've seen in the HTML
that it's generated from texinfo, but I couldn't find the source
texinfo files.

>> You linked to a FAQ item about the runpath[2], if I understand
>> correctly, it doesn't concern building/bootstrapping GCC, it's about
>> binaries built by GCC.
>
> When you bootstrap GCC it *is* a binary built by GCC, so that applies.
>
>>  It says that if e.g. libstdc++.so.6 is in
>> /opt/foo, you need to compile your binary with the -R/opt/foo option
>> (at least on some systems).  In case of the GCC bootstrap, it runs
>> ./configure subinvocations, and I would assume that it knows about
>> passing the -R flag.
>
> You assume wrong.  As that FAQ says, GCC doesn't pass that flag, by design.

Fair enough.

I understand that not setting the RPATH is by design, but I don't
think the following outcome is:

maciej@netra ~/src $ ldd /home/maciej/usr/lib/libstdc++.so
        libm.so.2 =>     /usr/lib/libm.so.2
        libgcc_s.so.1 =>         (file not found)
        libc.so.1 =>     /usr/lib/libc.so.1
        /platform/sun4u/lib/libc_psr.so.1

What is the right way to set the RPATH on the binary / pass
-R/opt/csw/lib to the linker?  By reading the docs, searching the web
and reading code I found out so far the following potential ways:

1. "--with-boot-ldflags=flags - This option may be used to set linker
flags to be used when linking stage 2 and later when bootstrapping
GCC. "

2. exporting LDFLAGS

3. exporting BOOT_LDFLAGS

4. exporting LDFLAGS_FOR_TARGET

Is any of these ways the right way to pass -R/opt/csw/lib? If none,
what is the right way?

>>> It's much easier to build gmp, mpfr and mpc statically by putting them in
>>> the gcc source tree.
>>
>> Thanks for the hint.  So far, I have intentionally avoided this,
>> preferring the divide-and-conquer model.  Porting to Solaris can be
>> tedious, so I generally prefer to build the dependencies once and be
>> done with it.
>
> Exactly how many other packages on your system depend on GMP, MPFR or
> MPC?  I'm guessing it's none.

No dependencies on MPC and MPFR.  There are following dependencies on GMP:

CSWcoreutils (gexpr and gfactor)
CSWlibhogweed2 (libhogweed.so.2.0)
CSWlibnettle-utils (nettle-lfib-stream)
CSWndiff (ndiff)
CSWphp5gmp (php/extensions/no-debug-non-zts-20060613/gmp.so)
CSWpy-crypto (python/site-packages/Crypto/PublicKey/_fastmath.so)

> You say "porting to Solaris" but Solaris is a fully supported and
> tested platform for GCC, it's one of the primary platforms that needs
> to work as part of the release criteria:
> http://gcc.gnu.org/gcc-4.6/criteria.html
>
> Loads of people build GCC on Solaris successfully, I've done so dozens
> of times, so you shouldn't need to do any porting for GCC or any of
> its dependencies.  You seem to be making life unnecessarily difficult
> for yourself.

Perhaps I used the wrong word.  I appreciate the effort to support
Solaris.  Much of my work is related to producing packages that meet
release criteria at OpenCSW.

If possible, I'd like to focus on the issues at hand: how to help
libstdc++ find libgcc_s (e.g. pass -R/opt/csw/lib), and where to find
the source form of GCC build documentation.

Maciej



[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