Ticket #1465 (closed task: fixed in core)

Opened 22 months ago

Last modified 21 months ago

shr-core: dfu-util-native: static linking of dfu-util fails

Reported by: nschle85 Owned by: jama
Priority: blocker Milestone:
Component: SHR Image Version: SHR-core
Keywords: Cc:

Description

building shr-core: shr-lite-image fails to link the native static linked dfu-util program. In the same task the dynamically linked version is sucessfully build.

compilerflags are identical, except additional -static for static linking

This behavior can be reproduced on 2 independent machines.

Attachments

log.do_compile.10976 Download (8.3 KB) - added by nschle85 22 months ago.
failed linking of ststic linked dfu-util
dfu-util_0.4.bb Download (90 bytes) - added by GNUtoo 22 months ago.
.../meta-openembedded/meta-oe/recipes-support/dfu-util/dfu-util_0.4.bb
no-usbpath.patch Download (752 bytes) - added by GNUtoo 22 months ago.
.../meta-oe/recipes-support/dfu-util/dfu-util-0.4/no-usbpath.patch
dfu-util-native_0.4.bb Download (368 bytes) - added by GNUtoo 22 months ago.
.../meta-openembedded/meta-oe/recipes-support/dfu-util/dfu-util-native_0.4.bb

Change History

Changed 22 months ago by nschle85

failed linking of ststic linked dfu-util

comment:1 Changed 22 months ago by nschle85

  • Owner changed from mrmoku to jama
  • Priority changed from major to blocker
  • Status changed from new to assigned

comment:2 Changed 22 months ago by jama

work around I'm using is:
sed -i 's/-lusb/-lusb -lusb-1.0 -lpthread -lusbpath -lrt/g' ../tmp/sysroots/x86_64-linux/usr/lib/pkgconfig/libusb.pc
bitbake -c cleansstate dfu-util-native
bitbake dfu-util-native

proper fix is to add version 0.4 which depends on libusb-1.0 API only
 http://www.mail-archive.com/devel@lists.openmoko.org/msg06601.html
GNUtoo said he started working on 0.4 recipes so I'm waiting for him..

Changed 22 months ago by GNUtoo

.../meta-openembedded/meta-oe/recipes-support/dfu-util/dfu-util_0.4.bb

Changed 22 months ago by GNUtoo

.../meta-oe/recipes-support/dfu-util/dfu-util-0.4/no-usbpath.patch

comment:3 Changed 22 months ago by GNUtoo

here's a work in progress... thanks to nschle85 for an idea on how to fix it...

Denis.

comment:4 Changed 22 months ago by GNUtoo

it now fails with:
| + install -m 0755 src/dfu-util_static .../oe-core/oetmps/shr/deploy/tools/dfu-util-0.4

Changed 22 months ago by GNUtoo

.../meta-openembedded/meta-oe/recipes-support/dfu-util/dfu-util-native_0.4.bb

comment:5 Changed 22 months ago by jama

I've started to add those .bb files and got a bit disappointed.
SRC_URI checksums are missing, FILESPATH is not set so -native version cannot find no-usbpath.patch which is appended to SRC_URI twice and with obsolete "apply=yes" which shouldn't be used...

And why it wasn't in one single git patch I could apply easily or also sent to shr-devel or oe-devel ML to be able to pick it from patchwork..

But thanks! (I'm complaining just to improve future patches :))

comment:6 Changed 22 months ago by jama

dfu-util_static is not built since:
 http://cgit.openezx.org/dfu-util/commit/?id=fe0426ddc04f503d148c5e5f931f16b8f674f071

removing that install line from recipe makes only invalid symlink in deploy dir, which is wrong. To provide static binary from -native recipe:
I've tried
#do_configure_prepend() {
# sed -i "s/AC_PROG_CC/AC_PROG_CC\nAC_DISABLE_SHARED\nAC_ENABLE_STATIC\nAC_PROG_LIBTOOL\nPKG_CONFIG=\"\${PKG_CONFIG} --static\"/g" ${S}/configure.ac
# #sed -i "s/AC_PROG_CC/AC_PROG_CC/PKG_CONFIG=\"\${PKG_CONFIG} --static\"/g" ${S}/configure.ac
# sed -i "s/-Wall/-Wall -static/g" ${S}/src/Makefile.am
#}

#EXTRA_OECONF += "--disable-shared --enable-static"
#export LDFLAGS=-static

but in the end I've reverted that commit and updated it a bit

pushed to meta-oe-contrib:
 http://git.openembedded.org/cgit.cgi/meta-openembedded-contrib/commit/?h=shr&id=c5ba433b740fdb88f1a7631fa884ea39c03df35a

please test in runtime and then I'll include it in next pull request for upstream meta-oe.

comment:7 Changed 22 months ago by dos

  • Version changed from SHR-custom-builds to SHR-core

comment:8 Changed 22 months ago by GNUtoo

  • Type changed from defect to task

runtime test still needed, compiles fine.

Denis.

comment:9 Changed 21 months ago by nschle85

  • Status changed from assigned to closed
  • Resolution set to fixed in core

tested dfu-util-0.4 static version with GTA02, flashing a new kernel and image works

Note: See TracTickets for help on using tickets.