Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with disabled SNMP support #328

Closed
jtru opened this issue Jan 4, 2022 · 4 comments · Fixed by #329
Closed

Build failure with disabled SNMP support #328

jtru opened this issue Jan 4, 2022 · 4 comments · Fixed by #329
Assignees
Labels

Comments

@jtru
Copy link

jtru commented Jan 4, 2022

Describe the bug
When trying to build ltfs as of today's current master on Debian 11/amd64 with --disable-snmp passed to configure, ld fails due to libdl not getting linked via AM_LDFLAGS.

To Reproduce
Steps to reproduce the behavior:

  1. git clone 'https://github.com/LinearTapeFileSystem/ltfs.git' && cd ltfs
  2. ./autogen.sh
  3. ./configure --disable-snmp
  4. make

Expected behavior
The build succeeds and yields binaries/artifacts without SNMP support.

Desktop (please complete the following information):

  • OS: Debian 11 amd64

Additional context

In configure.ac, when building with SNMP support, AM_LDFLAG is ultimately expanded to include the output of the net-snmp-config --agent-libs command, which on my system happens to include the required -ldl argument for the linker to succeed.

I think passing that argument to all build steps where the linker targets objects that had their corresponding source file(s) (at least src/libltfs/ltfslogging.c and src/libltfs/plugin.c) use libdl features should fix the problem.

FWIW, as a workaround, I configured the source with LIBS=-ldl ./configure --disable-snmp, which succeeds.

@piste-jp piste-jp self-assigned this Jan 12, 2022
@piste-jp
Copy link
Member

In my RHEL7 env, -ldl is included into the configuration of ICU.

ICU_MODULE_CFLAGS=' -D_REENTRANT    -I/usr/include '
ICU_MODULE_LIBS='-Wl,-z,relro   -lpthread -ldl -lm   -L/usr/lib64 -licui18n -licuuc -licudata  -lpthread -ldl -lm   '

Did you use custom /usr/bin/icu-config described into #153? Or does Debian11 provide /usr/bin/icu-config into ICU packages?

@jtru
Copy link
Author

jtru commented Jan 12, 2022

Debian 11 does not provide icu-config:

$ dpkg -S icu-config
dpkg-query: no path found matching pattern *icu-config*

However, I did not prepare my build env (my desktop machine) in any way to build ltfs. Both configuration and build phase work for me without icu-config present, with the above-mentioned limitations when disabling SNMP support.

@piste-jp
Copy link
Member

I realized package data for icu-uc is provided in Debian11. So configure script fetch the options from pkg-config.

I will fix the configure.ac to always include -ldl into AM_LDFLAGS. Because it is required in anytime (on Linux).

@jtru
Copy link
Author

jtru commented Jan 17, 2022

I can confirm current master builds successfully on Debian 11. Thanks very much for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants