This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++ and --with-sysroot


On Tue, Nov 18, 2008 at 11:13 AM, Andrew Haley <aph@redhat.com> wrote:
> Jon Dufresne wrote:
>
>> I am creating a cross toolchain using gnu. So far it has been working great.
>>
>> However, one problem I noticed is that libstdc++ isn't installed into
>> the specified sysroot duing "make install".
>>
>> After I have binutils, a static gcc, linux-headers, and glibc compiled
>> this is how I build gcc:
>>
>> ${BUILD}/gcc-${GCC_VERSION}/configure \
>>                       --prefix=${TOOLS} \
>>                       --build=${HOST} \
>>                       --host=${HOST} \
>>                       --target=${TARGET} \
>>                       --with-sysroot=${ROOTFS} \
>>                       --enable-languages=c,c++ \
>>                       --disable-multilib \
>>                       --disable-nls \
>>                       --enable-shared \
>>                       --enable-threads=posix \
>>                       --enable-__cxa_atexit \
>>                       --disable-libunwind-exceptions \
>>                       --enable-c99 \
>>                       --enable-long-long
>>
>> make
>> make install
>>
>> The things to notice are that I use the "--with-sysroot" option and enable c++.
>>
>> After the compile finishes libstdc++ is installed to
>> ${TOOLS}/${TARGET}/lib and I need to manually copy it over to the
>> ${ROOTFS}/usr/lib. Is this a bug in the gcc Makefile? Should libstdc++
>> install to the sysroot by default like the c runtime library does? Or
>> is this preferred behavior?
>
> It's doing what it's supposed to do.  All target libs are installed in
> the prefix, along with the cross-compiler.  The libs have to be there because
> the cross-compiler needs them.
>
> So, you need the target libs in two places: in /usr/lib on the target and
> in prefix/*lib on the cross compiling host.

Makes sense, but why doesn't the Makefile install the target libs into
both places, since that is what is needed? Copying them manually is
easy enough, but if they libraries are required in two places, it
seems the installation should put them in two places.

Regards,
Jon


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