How to add CFLAGS to my Makefile? - makefile

I'm using LEDE SDK and trying to compile latest reaver from git, but cant add CFLAGS="-O0 -g3" to my Makefile ? Do I need to just add them to
CONFIGURE_ARGS += --enable-savetocurrent
or what ? Here is my Makefile
#
# Copyright (C) 2012-2015 OpenWrt.org
# Copyright (C) 2017 Yousong Zhou
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=reaver
PKG_VERSION:=1.6.3
PKG_RELEASE:=2
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech#gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/t6x/reaver-wps-fork-t6x/releases/download/v$(PKG_VERSION)
PKG_HASH:=191f785f53030e4803260ada1a29ca4b42c848d56f6f3982e320d03b6117aaf2
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=docs/LICENSE
PKG_USE_MIPS16:=0
PKG_AUTOMAKE_PATHS:=src
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
CONFIGURE_PATH:=src
MAKE_PATH:=src
CONFIGURE_ARGS += --enable-savetocurrent
define Package/reaver
SECTION:=net
CATEGORY:=Network
SUBMENU:=wireless
TITLE:=Efficient brute force attack against Wifi Protected Setup
URL:=https://github.com/t6x/reaver-wps-fork-t6x
DEPENDS:=+libpcap
endef
define Package/reaver/description
Reaver has been designed to be a robust and practical attack against Wi-Fi
Protected Setup (WPS) registrar PINs in order to recover WPA/WPA2
passphrases. It has been tested against a wide variety of access points and
WPS implementations.
This is reaver-wps-fork-t6x, a community forked version, which has included
various bug fixes and additional attack method (the offline Pixie Dust
attack).
endef
define Package/reaver/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/
endef
$(eval $(call BuildPackage,reaver))

Ok if anyone else need it
"Advanced configuration"->"Target Options" and that change
-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc
to
-O0 -g3 -pipe -mno-branch-likely -mips32r2 -mtune=24kc

Related

How to add conditional configuration in configure.ac based on presence of a compilation flag?

In my autotools project, a config flag is used, CONFIG_ABC in abc.mk as below
#abc.mk
if CONFIG_ABC
src_CPPFLAGS += $(XML_CFLAGS)
src_CPPFLAGS += -I$(top_srcdir)/src/abc -I$(top_srcdir)/src/def
src_LDADD = $(ABC_LIBS)
src_LDADD += $(XML_LIBS)
endif
In configure.ac, I want below lines to be performed only if CONFIG_ABC is defined.
$PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6)
AC_CHECK_LIB([xml2], [xmlCleanupParser], [XML_LIBS=" -lxml2 -lz -lm"],
[AC_MSG_ERROR([Cannot find xmlCleanupParser in xml2.])])
LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libxml-2.0`"
CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libxml-2.0`"
AC_CHECK_HEADERS([libxml/parser.h], [], [AC_MSG_ERROR([cannot find libxml/parser.h])])
Reason I need to do it:
Build goes through for my project. But because it is shared in bigger projects, the other projects' build fails as it cannot find libxml.
Those projects don't need libxml anyway.
So I want the libxml to be included in build only for project ABC.
How do I do that?
Below are my failed attempts in configure.ac
1) AM_COND_IF([CONFIG_ABC],
AC_CHECK_LIB([xml2], [xmlCleanupParser], [XML_LIBS=" -lxml2 -lz -lm"])
AC_SUBST(XML_LIBS)
,)
2) Check if libxml is present (with_libxml), do PKG_CHECK_MODULES()
I need to put this in case because build error occurs for syntax for PKG_CHECK_MODULES.
AS_CASE(
["$with_libxml"],
[yes], [PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6], [HAVE_LIBXML_PARSER_H=1],
[AC_MSG_ERROR("libxml-2.0 >= 2.6 is not installed")])],
[no], [HAVE_LIBXML_PARSER_H=0],
[PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6, [HAVE_LIBXML_PARSER_H=1],[HAVE_LIBXML_PARSER_H=0])])
3) AS_IF([test "x$CONFIG_ABC" != ""],
[PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6)],
[AC_MSG_ERROR([CONFIG_ABC is blank])])
I picked up the name "HAVE_LIBXML_PARSER_H" from the build.
Can someone please help me understand what I am doing wrong?
Will using if test----fi help here?

How do you set configure.ac (autoconf) in my own application to auto-discover LAPACK, ATLAS, OpenBLAS, and KMP?

I'm new to autoconf as well as linear algebra libraries. So far as I can tell, LAPACK, ATLAS, OpenBLAS, and KML can co-exist on the filesystem but you can only use one of the libraries at link-time and I would like to let ./configure choose whatever is available or let the user select it with ./configure --something.
Different distributions put things in different directories and it would be nice if autoconf can figure that out.
LAPACK is -llapack
ATLAS is -lsatlas -L /usr/lib64/atlas # CentOS
or -ltatlas for the threaded version
OpenBLAS is -lopenblas
or -lopenblasp for the pthread version
or -lopenblaso for the OpenMP version
Questions:
Is there already a "proper" way to do this with AC_ macros?
Do AC_ macros already exist for these libraries?
How would you setup configure.ac to find the first available library that is installed but default to threaded ATLAS if available?
How would you setup configure.ac to allow the user to select, for example, the OpenMP version of OpenBLAS?
Would you use an option like --with-openblas-openmp ?
What would the configure.ac code look like?
Thank you for your help!
The PSFEX package does this, see https://github.com/astromatic/psfex/blob/master/configure.ac#L285 :
# Provide special options for INTEL MKL and force the use of icc
AC_MSG_CHECKING([whether INTEL's MKL is enabled])
AC_ARG_ENABLE(mkl,
[AS_HELP_STRING([--enable-mkl],
[Use INTEL's MKL for solvers and FFTs (default = no)])],
enable_icc="yes"
CC="icc"
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no]))
# Provide special options for ATLAS
AC_ARG_WITH(atlas-libdir,
[AS_HELP_STRING([--with-atlas-libdir=<ATLAS library path>],
[Provide an alternative path to the ATLAS library])])
AC_ARG_WITH(atlas-incdir,
[AS_HELP_STRING([--with-atlas-incdir=<ATLAS header dir>],
[Provide an alternative path to the ATLAS header directory])])
# Provide special options for OpenBLAS
AC_MSG_CHECKING([whether OpenBLAS is enabled])
AC_ARG_ENABLE(openblas,
[AS_HELP_STRING([--enable-openblas],
[Use the OpenBLAS library instead of ATLAS (default = no)])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no]))
AC_ARG_WITH(openblas-libdir,
[AS_HELP_STRING([--with-openblas-libdir=<OpenBLAS library path>],
[Provide an alternative path to the OpenBLAS library])])
AC_ARG_WITH(openblas-incdir,
[AS_HELP_STRING([--with-openblas-incdir=<OpenBLAS header dir>],
[Provide an alternative path to the OpenBLAS header directory])])
############ handle the INTEL MKL library (FFTW + LAPACKe) ###########
if test "$enable_mkl" = "yes"; then
convlibs="${srcdir}/../src/wcs/libwcs_c.a,${srcdir}/../src/levmar/liblevmar.a"
ACX_MKL($with_mkl_dir,no,$enable_best_link,$convlibs)
AC_MSG_CHECKING([for the INTEL MKL])
if test "$MKL_WARN" == ""; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_WARN([$MKL_WARN])
fi
AM_CFLAGS="$AM_CFLAGS $MKL_CFLAGS "
AM_LDFLAGS="$AM_LDFLAGS $MKL_LDFLAGS "
LIBS="$LIBS $MKL_LIBS"
############ Select either openblas or atlas ############
else
if test "x$enable_openblas" = "xyes"; then
######## Handle the OpenBLAS library (linear algebra: BLAS + LAPACKe) ########
ACX_OPENBLAS($with_openblas_libdir, $with_openblas_incdir, $use_pthreads, no,
[
AM_CFLAGS="$AM_CFLAGS $OPENBLAS_CFLAGS "
AM_LDFLAGS="$AM_LDFLAGS $OPENBLAS_LDFLAGS "
LIBS="$OPENBLAS_LIBS $LIBS"
if test "$OPENBLAS_WARN" != ""; then
AC_MSG_WARN([$OPENBLAS_WARN])
fi
],
AC_MSG_ERROR([$OPENBLAS_ERROR Exiting.])
)
else
######### handle the ATLAS library (linear algebra: BLAS + cLAPACK) ##########
ACX_ATLAS($with_atlas_libdir, $with_atlas_incdir, $use_pthreads,
[
[LIBS="$ATLAS_LIBS $LIBS"]
if test "$ATLAS_WARN" != ""; then
AC_MSG_WARN([$ATLAS_WARN])
fi
],
AC_MSG_ERROR([$ATLAS_ERROR Exiting. You could try --enable-openblas if Atlas is unavailable.])
)
fi
fi
AC_ARG_WITH([lapack],
[AS_HELP_STRING([--without-lapack],
[disable support for lapack])],
[],
[with_lapack=no])
LIBLAPACK=
AS_IF([test "x$with_lapack" != xno],
[
AX_BLAS([], [AC_MSG_ERROR([BLAS library not found])])
AX_LAPACK([], [AC_MSG_ERROR([LAPACK library not found])])
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
AC_CHECK_LIB(
[lapack], [zgetrf],
[AC_SUBST([LIBLAPACK], ["$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"]) AC_DEFINE([LAPACK], [1], [Define if you have liblapack])],
[AC_MSG_FAILURE([lapack library test failed (--without-lapack to disable)])],
[])
])
Also note that you will need their macro libraries (available here) which are too big to paste into the answer:
acx_mkl.m4
acx_atlas.m4
acx_openblas.m4
You could use dlopen() to dynamically load the library functions that you need. Then you needn't worry about configure.ac settings since your application would auto-detect the available libraries at runtime.
The xnec2c antenna simulator does this using their mathlib.c and mathlib.h implementations for the zgetrf() and zgetrs() calls. It could be extended to support other linear algebra calls as well. Maybe someone will write a unified linear algebra meta-library to dynamically back all the various implementations in one front-end library! (If you do, be sure to tell the xnec2c maintainer so they might use your changes.)
The mathlib.c file contains a typedef struct mathlib_t that defines the library names, shared object path, and function prefix for each library. It supports shared object library names for autodetecting Ubuntu/Debian, CentOS/RHEL, and openSUSE at runtime; other distributions more-or-less use the same library names, so, effectively, far more than just the above listed distributions are supported:
static mathlib_t mathlibs[] = {
{.type = MATHLIB_ATLAS, .lib = "libtatlas.so.3", .name = "ATLAS, Threaded", .f_prefix = "clapack_"},
{.type = MATHLIB_OPENBLAS, .lib = "libopenblaso.so", .name = "OpenBLAS+LAPACKe, OpenMP", .f_prefix = "LAPACKE_"},
}
Note that ATLAS and OpenBLAS use different function prefixes: clapack_ vs LAPACKE_; so having a wrapper around the different libraries is useful. Xnec2c supports ATLAS, OpenBLAS+LAPACK, and Intel MKL.

How to set LOCAL_LDFLAGS/LOCAL_CPPFLAGS with cmake in ndk?

How to set LOCAL_CPPFLAGS/LOCAL_CFLAGS/LOCAL_LDFLAGS with cmake? I want to reduce so size, but the tutorials i have read are all about mk files. What should I do in cmakelists.txt?
I directly set LOCAL_CPPFLAGS/LOCAL_CFLAGS/LOCAL_LDFLAGS, but it seems not work.
set(LOCAL_CPPFLAGS "${LOCAL_CPPFLAGS} -ffunction-sections,-fdata-sections")
set(LOCAL_CFLAGS "${LOCAL_CFLAGS} -ffunction-sections,-fdata-sections")
set(LOCAL_LDFLAGS "${LOCAL_LDFLAGS} -Wl,--gc-sections,--icf=safe")
You should be able to do that using something like this:
target_compile_options(mytarget PRIVATE -ffunction-sections -fdata-sections)
target_link_libraries(mytarget -Wl,--gc-sections,--icf=safe)
Note that -ffunction-sections has been enabled by default for a while when using the NDK's Clang. And if you're using NDK r19c or later I believe -fdata-sections is enabled by default too. So only the linker flags should be necessary for you to specify explicitly.

Cannot find libNrrdIO link library

This question is an extension of the following:
Cannot find a link library (lNrrdIO)
The solution given by Tsyvarev worked for lNrrdIO.a, compiled from NrrdIO version 1.9.0, but when i tried the same thing from NrrdIO version 1.11.0, which generates a library libNrrdIO.a. I did exactly the same things for both, just modifying the cmakelists.txt in the LINK_LIBRARIES line, by changing NrrdIO to ibNrrdIO. Bu this is giving the following error:
[ 7%] Linking CXX executable ijkmcube
/usr/bin/ld: cannot find -libNrrdIO
collect2: error: ld returned 1 exit status
CMakeFiles/ijkmcube.dir/build.make:406: recipe for target 'ijkmcube'
failed
make[2]: *** [ijkmcube] Error 1
CMakeFiles/Makefile2:131: recipe for target
'CMakeFiles/ijkmcube.dir/all' failed
make[1]: *** [CMakeFiles/ijkmcube.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The CMakeLists.txt is as follows:
PROJECT(IJKMCUBE)
#---------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF (NOT DEFINED ${IJK_DIR})
GET_FILENAME_COMPONENT(IJK_ABSOLUTE_PATH "../.." ABSOLUTE)
SET(IJK_DIR ${IJK_ABSOLUTE_PATH} CACHE PATH "IJK directory")
ENDIF (NOT DEFINED ${IJK_DIR})
SET(CMAKE_INSTALL_PREFIX "${IJK_DIR}/")
SET(LIBRARY_OUTPUT_PATH ${IJK_DIR}/lib CACHE PATH "Library directory")
SET(IJKMCUBE_DIR "src/ijkmcube")
SET(NRRD_LIBDIR "${IJK_DIR}/lib")
SET(IJK_ISOTABLE_DIR "${IJK_DIR}/isotable" CACHE PATH "Isotable directory")
#---------------------------------------------------------
IF (NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE Release CACHE STRING
"Default build type: Release" FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
INCLUDE_DIRECTORIES("${IJK_DIR}/include")
LINK_DIRECTORIES("${NRRD_LIBDIR}")
LINK_LIBRARIES(expat ibNrrdIO z)
ADD_DEFINITIONS(-DIJK_ISOTABLE_DIR=\"${IJK_ISOTABLE_DIR}\")
ADD_EXECUTABLE(ijkmcube ijkmcube_main.cxx ijkmcubeIO.cxx ijkmcube.cxx
ijkmcube_datastruct.cxx ijkmcube_sub.cxx
ijkmcube_extract.cxx ijkmcube_util.cxx ijksnapmc.cxx
ijktable.cxx ijktable_poly.cxx ijktable_ambig.cxx
ijkoctree.cxx ijkxitIO.cxx)
ADD_LIBRARY(ijkmcubeL STATIC EXCLUDE_FROM_ALL ijkmcubeIO.cxx ijkmcube.cxx ijkmcube_datastruct.cxx ijkmcube_sub.cxx ijkmcube_extract.cxx ijkmcube_util.cxx ijksnapmc.cxx ijktable.cxx ijkoctree.cxx ijkxitIO.cxx)
SET_TARGET_PROPERTIES(ijkmcubeL PROPERTIES OUTPUT_NAME ijkmcube)
ADD_CUSTOM_TARGET(lib DEPENDS ijkmcubeL)
SET(CMAKE_INSTALL_PREFIX ${IJK_DIR})
INSTALL(TARGETS ijkmcube DESTINATION "bin/linux")
ADD_CUSTOM_TARGET(tar WORKING_DIRECTORY ../.. COMMAND tar cvfh ${IJKMCUBE_DIR}/ijkmcube.tar ${IJKMCUBE_DIR}/README ${IJKMCUBE_DIR}/INSTALL ${IJKMCUBE_DIR}/RELEASE_NOTES ${IJKMCUBE_DIR}/*.cxx ${IJKMCUBE_DIR}/*.h ${IJKMCUBE_DIR}/*.txx ${IJKMCUBE_DIR}/CMakeLists.txt ${IJKMCUBE_DIR}/man/* ${IJKMCUBE_DIR}/ijkmcube_doxygen.config)
ADD_CUSTOM_TARGET(doc COMMAND doxygen ijkmcube_doxygen.config)
Can someone help identify what the problem could be? Is it possible to make cmake search for the library libNrrdIO.a? using some in-built function?
Thanks
The problem was finally resolved, with the help of Dr. Wenger from the Ohio State University, he suggested making 2 modifications to the CMakeLists of NrrdIO version 1.11.0, by setting the QNANHABIT value to 1 and uncommenting the line ADD_DEFINITIONS(-DTEEM_ZLIB=1) I've attached the modified CMakeLists file for reference:
# NrrdIO: stand-alone code for basic nrrd functionality
# Copyright (C) 2011, 2010, 2009 University of Chicago
# Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any
# damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any
# purpose, including commercial applications, and to alter it and
# redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must
# not claim that you wrote the original software. If you use this
# software in a product, an acknowledgment in the product
# documentation would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must
# not be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(NrrdIO)
INCLUDE_REGULAR_EXPRESSION("^.*.h$")
#
# This CMake file configures the NrrdIO library build. NrrdIO
# is used by Insight/Code/IO/itkNrrdIO for reading/writing
# "Nearly Raw Raster Data" within the open-source Teem software
# package. See http://teem.sourceforge.net for more information.
#
SET(nrrdio_SRCS comment.c enumsNrrd.c mop.c string.c 754.c defaultsNrrd.c
parseAir.c dio.c format.c parseNrrd.c formatEPS.c encoding.c
formatNRRD.c encodingAscii.c formatPNG.c encodingBzip2.c
formatPNM.c accessors.c encodingGzip.c formatText.c
array.c encodingHex.c formatVTK.c read.c arraysNrrd.c encodingRaw.c
gzio.c reorder.c write.c axis.c endianAir.c keyvalue.c
biffbiff.c biffmsg.c endianNrrd.c methodsNrrd.c sane.c enum.c
miscAir.c simple.c )
# Turn on TEEM_BUILD so that the proper dll export def's are
# used on windows builds.
ADD_DEFINITIONS(-DTEEM_BUILD=1)
#The QNANHIBIT variable is configured by the root level CMakeLists.txt
IF(QNANHIBIT)
ADD_DEFINITIONS(-DTEEM_QNANHIBIT=1)
ELSE(QNANHIBIT)
ADD_DEFINITIONS(-DTEEM_QNANHIBIT=1)
ENDIF(QNANHIBIT)
#DirectIO is the fast way to do multi-gigabyte I/O and currently only available
#for SGI platforms. Use of DirectIO is enabled manually for now.
#OPTION(USE_DIRECTIO "Use DirectIO for Nrrd file IO. Only valid on SGI systems." 0)
#MARK_AS_ADVANCED(USE_DIRECTIO)
#IF(USE_DIRECTIO)
# ADD_DEFINITIONS(-DTEEM_DIO=1)
#ELSE(USE_DIRECTIO)
ADD_DEFINITIONS(-DTEEM_DIO=0)
#ENDIF(USE_DIRECTIO)
# Possibly turn on usage of zlib compression (requires linking with libz)
# (i.e., programs compiled with ITKNrrdIO must also be compiled with zlib)
ADD_DEFINITIONS(-DTEEM_ZLIB=1)
ADD_LIBRARY(NrrdIO ${nrrdio_SRCS} )
## These are ITK-specific
#TARGET_LINK_LIBRARIES(NrrdIO ${ITK_ZLIB_LIBRARIES} )
#INSTALL_TARGETS(/lib/InsightToolkit ITKNrrdIO)
#INSTALL_FILES(/include/InsightToolkit/Utilities/NrrdIO "(\\.h)$")

Buildroot gcc headers don't match linux-headers

I'm using Buildroot 2018.02.7 to build a simple Linux system for i386 PC, as a precursor to doing the same thing for an embedded ARM system. I keep running into problems like this one, in building the util-linux module:
CC lib/libcommon_la-path.lo
lib/pager.c:11:17: fatal error: err.h: No such file or directory
#include <err.h>
^
compilation terminated.
Makefile:8596: recipe for target 'lib/libcommon_la-pager.lo' failed
make[3]: *** [lib/libcommon_la-pager.lo] Error 1
When I look in the linux-headers source tree in .../output/build/linux-headers-4.13.8, the file is found. But Buildroot is pointing to a different set of headers, the one built into its GCC:
devuser#3faf730b4a1b:~/pc/buildroot-2018.02.7/output/build/util-linux-2.31.1$ ../../host/bin/i686-buildroot-linux-uclibc-gcc -print-sysroot
/home/devuser/pc/buildroot-2018.02.7/output/host/i686-buildroot-linux-uclibc/sysroot
devuser#3faf730b4a1b:~/pc/buildroot-2018.02.7/output/build/util-linux-2.31.1$
And the two /usr/include subdirectories are significantly different.
Have I missed a configuration setting somewhere in the defconfig file? This is the defconfig:
BR2_x86_core2=y
BR2_SSP_REGULAR=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_13=y
BR2_UCLIBC_CONFIG="board/pc/dsa_pc_i386_uclibc.config"
BR2_TOOLCHAIN_BUILDROOT_USE_SSP=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_GETTY_PORT="tty1"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image.sh support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/pc/genimage-bios.cfg"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.13.8"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/pc/linux.config"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_LINUX_KERNEL_EXT_XENOMAI=y
BR2_PACKAGE_BUSYBOX_CONFIG="board/pc/dsa_pc_i386_busybox.config"
BR2_PACKAGE_LINUX_FIRMWARE=y
BR2_PACKAGE_LINUX_FIRMWARE_ATHEROS_9170=y
BR2_PACKAGE_LINUX_FIRMWARE_ATHEROS_9271=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3160=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3168=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_5000=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_6000G2A=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_6000G2B=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_7260=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_7265D=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8000C=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8265=y
BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT73=y
BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
BR2_PACKAGE_ACPID=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_ZLIB=y
BR2_PACKAGE_LIBFFI=y
BR2_PACKAGE_PCRE=y
BR2_PACKAGE_PCRE_UCP=y
BR2_PACKAGE_READLINE=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_GENIMAGE=y
Enable UCLIBC_HAS_BSD_ERR in uClibc.
You have a custom uClibc configuration. That falls squarely in the "you know what you are doing" category, since it allows you to remove features that other packages rely on.
In this case, util-linux relies on the non-Posix err.h include. This is only installed if UCLIBC_HAS_BSD_ERR is enabled in the uClibc configuration.
There is a high risk of running into similar issues with a custom uClibc configuration.

Resources