[OE-core] [PATCH 5/8] libtool-cross: Unset pre|post dep objects

Khem Raj raj.khem at gmail.com
Mon Feb 1 17:29:05 UTC 2016


> On Jan 31, 2016, at 9:08 PM, Khem Raj <raj.khem at gmail.com> wrote:
> 
> predep_objects and postdep_objects are specifying the duplicate objects
> which are better computed by gcc/g++ driver, since we want to generate
> PIE, PIC and non-PIC combinations, let gcc decide on this, since it
> knows best about linker options to use in each of these situations.
> When we defer the linker options to driver, we also need to remove
> -nostdlib from linker commandline options.
> 
> Remove duplicate directory creation for ${D}${bindir_crossscripts}/
> 
> This fixes a frequent problem we see during -fpie links e.g.
> 
> |
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/include/c++/5.3.0/iostream:74:
> undefined reference to `__dso_handle'
> |
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld:
> .libs/cxx_channel.o: relocation R_X86_64_PC32 against undefined hidden
> symbol `__dso_handle' can not be used when making a shared object
> |
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld:
> final link failed: Bad value
> 
> After this change libtool gets changed as below
> 
> old_archive_from_expsyms_cmds=""
> 
> # Commands used to build a shared archive.
> -archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects
> \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname
> \$wl\$soname -o \$lib"
> -archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects
> \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname
> \$wl\$soname \$wl-retain-symbols-file \$wl\$export_symbols -o \$lib"
> +archive_cmds="\$CC \$pic_flag -shared  \$predep_objects \$libobjs
> \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o
> \$lib"
> +archive_expsym_cmds="\$CC \$pic_flag -shared  \$predep_objects
> \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname
> \$wl\$soname \$wl-retain-symbols-file \$wl\$export_symbols -o \$lib"
> 
> # Commands used to build a loadable module if different from building
> # a shared archive.
> @@ -11908,8 +11908,8 @@
> 
> # Dependencies to place before and after the objects being linked to
> # create a shared library.
> -predep_objects="/home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/lib/../lib/Scrt1.o
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/lib/../lib/crti.o
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/lib/../lib/x86_64-oe-linux/5.3.0/crtbeginS.o"
> -postdep_objects="/home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/lib/../lib/x86_64-oe-linux/5.3.0/crtendS.o
> /home/ubuntu/work/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86-64/usr/lib/../lib/crtn.o"
> +predep_objects=""
> +postdep_objects=""
> predeps=""
> postdeps="-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc"
> 
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
> meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
> index 8478802..432f010 100644
> --- a/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
> +++ b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
> @@ -16,7 +16,11 @@ do_configure_prepend () {
> do_install () {
> 	install -d ${D}${bindir_crossscripts}/
> 	install -m 0755 ${HOST_SYS}-libtool ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
> -	install -d ${D}${bindir_crossscripts}/
> +	sed -e 's@^\(predep_objects="\).*@\1"@' \
> +	    -e 's@^\(postdep_objects="\).*@\1"@' \
> +	    -i ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
> +	sed -i '/^archive_cmds=/s/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
> +	sed -i '@^archive_expsym_cmds=@s at -nostdlib@@g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool

a self review after strong tea revealed that I did not commit my local change on top of this so this patch was wrong
I have not squashed the local remaining change into this and updated the kraj/pu branch.

> 	GREP='/bin/grep' SED='sed' ${S}/build-aux/inline-source libtoolize > ${D}${bindir_crossscripts}/libtoolize
> 	chmod 0755 ${D}${bindir_crossscripts}/libtoolize
> 	install -d ${D}${target_datadir}/libtool/build-aux/
> --
> 2.7.0
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160201/850d024d/attachment-0002.sig>


More information about the Openembedded-core mailing list