This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: How to 'Compile against glibc build tree' ?


Hi Arjun

Thanks for your answer and for updating the wiki.

> Remember that this is only for test builds. i.e. binaries built this way will 
> always run against the glibc located at the non-standard location that 
> you passed when compiling them.

I think I understand that.  I want my application to always run against glibc 2.22, while I leave the system glibc at 2.19.  So would you agree that I am using the correct method?

Best regards

David

> -----Original Message-----
> From: Arjun Shankar [mailto:arjun.is@lostca.se]
> Sent: 01 December 2015 13:50
> To: David Aldrich <David.Aldrich@EMEA.NEC.COM>
> Cc: libc-help@sourceware.org
> Subject: Re: How to 'Compile against glibc build tree' ?
> 
> > Now I am following instructions:
> > https://sourceware.org/glibc/wiki/Testing/Builds#Compile_against_glibc
> > _build_tree
> 
> Remember that this is only for test builds. i.e. binaries built this way will
> always run against the glibc located at the non-standard location that you
> passed when compiling them.
> 
> > BUILD=<path to the GLIBC build directory>
> >
> > gcc \
> >   -Wl,-rpath=${GLIBC}:\
> > ${GLIBC}/math:\
> > ${GLIBC}/elf:\
> > ${GLIBC}/dlfcn:\
> > ${GLIBC}/nss:\
> > ${GLIBC}/nis:\
> > ${GLIBC}/rt:\
> > ${GLIBC}/resolv:\
> > ${GLIBC}/crypt:\
> > ${GLIBC}/nptl:\
> > ${GLIBC}/dfp \
> >   -Wl,--dynamic-linker=${BUILD}/lib/ld.so
> >   <other compiler flags> -o <application> <application>.c
> 
> > I'm not sure what is going on here. ${BUILD} seems to be the path to
> > the build directory.  What is ${GLIBC} ?
> 
> This looks like a typo. I fixed it in the wiki to be:
> 
> GLIBC=<path to the GLIBC build directory>
> 
> gcc \
>   -Wl,-rpath=${GLIBC}:\
> ${GLIBC}/math:\
> ${GLIBC}/elf:\
> ${GLIBC}/dlfcn:\
> ${GLIBC}/nss:\
> ${GLIBC}/nis:\
> ${GLIBC}/rt:\
> ${GLIBC}/resolv:\
> ${GLIBC}/crypt:\
> ${GLIBC}/nptl:\
> ${GLIBC}/dfp \
>   -Wl,--dynamic-linker=${GLIBC}/elf/ld.so
>   <other compiler flags> -o <application> <application>.c
> 
> Note that the dynamic linker is at elf/, not lib/.
> 
> > And, what is rpath for?
> 
> It is a linker option.
> $ man ld
>  ...should tell you what it does.
> 
> Cheers,
> Arjun
> 
> 
>  Click
> https://www.mailcontrol.com/sr/+UaKwcGiryXGX2PQPOmvUsQN7C0BBstkv
> mSY!TDARBite2RT2dNwsURqhFhrnBxMp5bWKNAyzh!36NGKki70Ug==  to
> report this email as spam.


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