Modify

Opened 6 years ago

Closed 3 years ago

#10604 closed defect (moved_to_github)

Building collectd fails on host with libgcrypt-config

Reported by: kevin@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

When collectd is built on a machine with libgcrypt-config in $PATH, OpenWRT (trunk) fails to build with the following error:

OpenWrt-libtool: link: mips-openwrt-linux-uclibc-gcc -shared  -fPIC -DPIC  .libs/network_la-network.o .libs/network_la-utils_fbhash.o   -L/usr/lib -L/path/to/openwrt/staging_dir/target-mips_r2_uClibc-0.9.32/usr/lib -L/path/to/openwrt/staging_dir/target-mips_r2_uClibc-0.9.32/lib -L/path/to/openwrt/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32/usr/lib -L/path/to/openwrt/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32/lib -lm -lz -lpthread -lgcrypt /usr/lib/libgpg-error.so -ldl  -Os -mips32r2 -mtune=mips32r2 -msoft-float -Wl,-rpath-link=/path/to/openwrt/staging_dir/target-mips_r2_uClibc-0.9.32/usr/lib   -Wl,-soname -Wl,network.so -o .libs/network.so
/path/to/openwrt/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/path/to/openwrt/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/lib/libgpg-error.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[6]: *** [network.la] Error 1

This is because the collectd configure script sets GCRYPT_LDFLAGS="-L$(libgcrypt-config --exec-prefix)/lib" and passes this to ld for the network plugin (network.la).

To avoid the error, either explicitly build without libgcrypt (which I assume is intended as it is not listed as a dependency) or set the location to "$(STAGING_DIR)/usr" as with the dependencies of several other plugins. The attached patch implements the former choice.

Attachments (1)

0001-Explicitly-build-collectd-mod-network-without-libgcr.patch (1.0 KB) - added by kevin@… 6 years ago.
Patch to explicitly build collectd-mod-network without libgcrypt

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by kevin@…

Patch to explicitly build collectd-mod-network without libgcrypt

comment:1 Changed 6 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with r29854

comment:2 Changed 6 years ago by puleglot@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Please, fix this in backfire branch.

comment:3 Changed 6 years ago by gadget@…

Just to note, the patch posted at /changeset/29854.html breaks (an already broken) compile of collectd, attempting to compile Backfire 10.03.1 on a stock Slackware 13.37 system.

In particular, adding: "--without-libgcrypt" at 154 solves this issue, however,
removing "TARGET_CFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" at 144 creates a new problem in that the dependency on iwinfo is broken.

Solution for me was to apply the addition at 154, and leave intact the deletion at 144.

As an aside, how do we register a username on OpenWRT Trac, as I would be willing to contribute?

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:5 Changed 3 years ago by nbd

  • Resolution set to moved_to_github
  • Status changed from reopened to closed

collectd is maintained here: https://github.com/openwrt/packages

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.