Bug #2653
closedllc detection failure in configure.ac
Description
Hi,
We believe we discovered a bug in configure.ac, relative to the
detection of the LLC compiler, by the m4 macro AC_PROG_PATH
.
In configure.ac, we can read:
AC_PROG_PATH(HAVE_LLC, llc, "yes", "no")
The prototype of AC_PROG_PATH
is:
AC_PATH_PROG (variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])
This means that llc is sought in the path no
, which is obviously
incorrect.
Thus, the following test should be a "not equal no" instead of a "equal yes" if test "$HAVE_LLC" = "yes"; then
To reproduce the issue, one need to have CC equal to exactly clang and have
llc not found in path. This would trigger an error during compilation,
because llc would be used while not being findable.
We would also like to emphasize that the LLC detection instruction
sequence is making the assumption that if CC is clang, then LLC could
be llc or llc-<version> but if CC is clang-<version> then LLC
should also be named llc-<version> and not llc. We believe this assumption
to be excessive; for one, in our linux distro, this was not the case;
clang was named clang-version but LLC was named llc. While this is
probably not a desirable behavior of the LLVM package, we would advise
having a more resilient configure.ac script for Suricata.
Cheers,
ArmatureTech Dev Team
Updated by Eric Leblond about 6 years ago
hello, could you check this branch: https://github.com/regit/suricata/tree/af-packet-exit-5 ?
The last patch of the branch is a cleaning attempt the llc detection logic.
Updated by Gatewatcher Dev Team about 6 years ago
Hi,
We believe
https://github.com/regit/suricata/commit/d6ec50fbe5441de7eaec8e7f21efe90c4fe2f5b1#diff-67e997bcfdac55191033d57a16d1408aR422
and
https://github.com/regit/suricata/commit/d6ec50fbe5441de7eaec8e7f21efe90c4fe2f5b1#diff-67e997bcfdac55191033d57a16d1408aR430
are also using AC_PROG_PATH incorrectly, with respect to its prototype:AC_PATH_PROG (variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])
What we believe would be a correct usage would be something like:
AC_PATH_PROG(HAVE_LLC, llc, "no")
if test "$HAVE_LLC" != "no"; then
or
AC_PATH_PROG(HAVE_LLC, "llc-$llc_version", "no")
if test "$HAVE_LLC" != "no"; then
Also, the if clause between 405 and 418 does not contain the same
kind of logic to verify the existence of "llc-$llc_version" that
was implemented between lines 431 and 438, because there is no
AC_PROG_PATH call between lines 411 and 418.
Cheers,
ArmatureTech Dev Team
Updated by Victor Julien about 6 years ago
- Target version changed from 4.1 to 4.1.1
Updated by Eric Leblond almost 6 years ago
- Status changed from New to Closed
Fix merged via https://github.com/OISF/suricata/pull/3567