diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-02-01 04:49:49 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-02 14:40:43 +0000 |
commit | e1b45cb8e15458dde21f5e86ea1cbb619fb5c4cf (patch) | |
tree | aea9f5c62a21de6d1bd0a1e7458e2f0fff6363bc /meta/recipes-devtools/libtool | |
parent | 15531f8ba83174bc36aa2566721dd80188a8d465 (diff) | |
download | openembedded-core-e1b45cb8e15458dde21f5e86ea1cbb619fb5c4cf.tar.gz openembedded-core-e1b45cb8e15458dde21f5e86ea1cbb619fb5c4cf.tar.bz2 openembedded-core-e1b45cb8e15458dde21f5e86ea1cbb619fb5c4cf.zip |
libtool-cross: Unset pre|post dep objects
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@gmail.com>
Diffstat (limited to 'meta/recipes-devtools/libtool')
-rw-r--r-- | meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb | 6 |
1 files changed, 5 insertions, 1 deletions
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 847880270d..0204d347ba 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/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool 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/ |