[asterisk-bugs] [JIRA] (ASTERISK-29709) res_snmp: Not build on recent Debian distributions.

Asterisk Team (JIRA) noreply at issues.asterisk.org
Thu Dec 2 12:46:37 CST 2021


     [ https://issues.asterisk.org/jira/browse/ASTERISK-29709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asterisk Team updated ASTERISK-29709:
-------------------------------------

    Target Release Version/s: 16.23.0

> res_snmp: Not build on recent Debian distributions.
> ---------------------------------------------------
>
>                 Key: ASTERISK-29709
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29709
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_snmp
>    Affects Versions: 16.21.1, 18.7.1
>         Environment: Clang 13 on Ubuntu 21.10
>            Reporter: Alexander Traud
>            Assignee: Alexander Traud
>            Severity: Major
>              Labels: patch
>      Target Release: 16.23.0
>
>         Attachments: clang_res_snmp.patch
>
>
> The automatic build tools (autotools) of Asterisk look for the headers and libraries of the SNMP Agent via its developer tool {{net-snmp-config}}. However, at least in Ubuntu 20.10, that tool explains how the SNMP Agent was build, not how it should be used to build on it. This can be seen after running the script {{./configure}} in the file {{makeopts}}. In other words, instead of giving just the library name(s), {{net-snmp-config}} provides a long list of include and library statements.
> I tested not with GCC but with Clang. Because the build tools of Asterisk include a small test program to run, the compiler/linker has to those long lists already to determine whether the Asterisk module  {{res_snmp}} can be build. However, to compile that test program, Clang 13 requires the additional package {{llvm-13-linker-tools}}. In other works, only with that additional package, {{res_snmp}} is selectable via {{make menuselect}}.
> Even then, Clang warns about the optimization flag {{-ffat-lto-objects}} because it is not supported in Clang. If the developer mode was configured, that warning turns into an error, and the build aborts.
> Long story short, all {{*-config}} tools are deprecated and should be replaced with the tool {{pkg-config}}. Since Debian Bullseye and Ubuntu 21.04, the developer package [libsnmp-dev|https://packages.ubuntu.com/libsnmp-dev] contains the required {{netsnmp-agent.pc}} file for that. Therefore, the solution is to check via {{pkg-config}} first. Only if that fails, the old tool {{net-snmp-config}} should be queried.
> The attached patch implements that approach. After applying the patch, execute the script {{./bootstrap.sh}}.
> *Note 1*:
> The script {{./configure}} queries several other, deprecated {{\*-config}} tools, namely for [neon|https://notroj.github.io/neon/] (used by the extended modules {{res_calendar_*}}) and XML2 (used by the extended module {{res_calendar_caldav}}). Because XML2 is even an essential library for {{make menuselect}}, someone should look into adding {{pkg-config}} for those; both support {{.pc}} files for ages.
> *Note 2*:
> I am not sure why {{net-snmp-config}} gives the headers and libraries with which it was build rather than those which are required to build on. I am not so much into those config tools but would have expected both give the same results. This should be discussed with the (Debian) maintainer of that package.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list