Ticket #1465 (closed task: fixed in core)
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
Change History
Changed 22 months ago by nschle85
-
attachment
log.do_compile.10976
added
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
-
attachment
dfu-util_0.4.bb
added
.../meta-openembedded/meta-oe/recipes-support/dfu-util/dfu-util_0.4.bb
Changed 22 months ago by GNUtoo
-
attachment
no-usbpath.patch
added
.../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
-
attachment
dfu-util-native_0.4.bb
added
.../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.

failed linking of ststic linked dfu-util