Package xtables was not found in the pkg-config search path - linux

I have downloaded iproute2. When I make ./configure && make && make install I get these errors.
TC schedulers
ATM no
IPT Package xtables was not found in the pkg-config search path.
Perhaps you should add the directory containing `xtables.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xtables' found
using iptables
IPSET yes
iptables modules directory: /lib/xtables
libc has setns: yes
SELinux support: no
ELF support: no
libmnl support: no
Berkeley DB: no
docs: latex: no
WARNING: no docs can be built from LaTeX files
sgml2html: no
WARNING: no HTML docs can be built from SGML
make[1]: Entering directory `/home/mininet/iproute2-4.6.0/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/lib'
make[1]: Entering directory `/home/mininet/iproute2-4.6.0/ip'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/ip'
make[1]: Entering directory `/home/mininet/iproute2-4.6.0/tc'
gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DCONFIG_GACT -DCONFIG_GACT_PROB -DIPT_LIB_DIR=\"/lib/xtables\" -DYY_NO_INPUT -c -o m_ipt.o m_ipt.c
In file included from m_ipt.c:17:0:
../include/linux/if.h:106:19: error: redeclaration of enumerator ‘IFF_UP’
#define IFF_UP IFF_UP
^
../include/linux/if.h:79:2: note: previous definition of ‘IFF_UP’ was here
IFF_UP = 1<<0, /* sysfs */
^
../include/linux/if.h:107:25: error: redeclaration of enumerator ‘IFF_BROADCAST’
#define IFF_BROADCAST IFF_BROADCAST
^
../include/linux/if.h:80:2: note: previous definition of ‘IFF_BROADCAST’ was here
IFF_BROADCAST = 1<<1, /* __volatile__ */
^
../include/linux/if.h:108:21: error: redeclaration of enumerator ‘IFF_DEBUG’
#define IFF_DEBUG IFF_DEBUG
^
../include/linux/if.h:81:2: note: previous definition of ‘IFF_DEBUG’ was here
IFF_DEBUG = 1<<2, /* sysfs */
^
../include/linux/if.h:109:24: error: redeclaration of enumerator ‘IFF_LOOPBACK’
#define IFF_LOOPBACK IFF_LOOPBACK
^
../include/linux/if.h:82:2: note: previous definition of ‘IFF_LOOPBACK’ was here
IFF_LOOPBACK = 1<<3, /* __volatile__ */
^
../include/linux/if.h:110:27: error: redeclaration of enumerator ‘IFF_POINTOPOINT’
#define IFF_POINTOPOINT IFF_POINTOPOINT
^
../include/linux/if.h:83:2: note: previous definition of ‘IFF_POINTOPOINT’ was here
IFF_POINTOPOINT = 1<<4, /* __volatile__ */
^
../include/linux/if.h:111:26: error: redeclaration of enumerator ‘IFF_NOTRAILERS’
#define IFF_NOTRAILERS IFF_NOTRAILERS
^
../include/linux/if.h:84:2: note: previous definition of ‘IFF_NOTRAILERS’ was here
IFF_NOTRAILERS = 1<<5, /* sysfs */
^
../include/linux/if.h:112:23: error: redeclaration of enumerator ‘IFF_RUNNING’
#define IFF_RUNNING IFF_RUNNING
^
../include/linux/if.h:85:2: note: previous definition of ‘IFF_RUNNING’ was here
IFF_RUNNING = 1<<6, /* __volatile__ */
^
../include/linux/if.h:113:21: error: redeclaration of enumerator ‘IFF_NOARP’
#define IFF_NOARP IFF_NOARP
^
../include/linux/if.h:86:2: note: previous definition of ‘IFF_NOARP’ was here
IFF_NOARP = 1<<7, /* sysfs */
^
../include/linux/if.h:114:23: error: redeclaration of enumerator ‘IFF_PROMISC’
#define IFF_PROMISC IFF_PROMISC
^
../include/linux/if.h:87:2: note: previous definition of ‘IFF_PROMISC’ was here
IFF_PROMISC = 1<<8, /* sysfs */
^
../include/linux/if.h:115:24: error: redeclaration of enumerator ‘IFF_ALLMULTI’
#define IFF_ALLMULTI IFF_ALLMULTI
^
../include/linux/if.h:88:2: note: previous definition of ‘IFF_ALLMULTI’ was here
IFF_ALLMULTI = 1<<9, /* sysfs */
^
../include/linux/if.h:116:22: error: redeclaration of enumerator ‘IFF_MASTER’
#define IFF_MASTER IFF_MASTER
^
../include/linux/if.h:89:2: note: previous definition of ‘IFF_MASTER’ was here
IFF_MASTER = 1<<10, /* __volatile__ */
^
../include/linux/if.h:117:21: error: redeclaration of enumerator ‘IFF_SLAVE’
#define IFF_SLAVE IFF_SLAVE
^
../include/linux/if.h:90:2: note: previous definition of ‘IFF_SLAVE’ was here
IFF_SLAVE = 1<<11, /* __volatile__ */
^
../include/linux/if.h:118:25: error: redeclaration of enumerator ‘IFF_MULTICAST’
#define IFF_MULTICAST IFF_MULTICAST
^
../include/linux/if.h:91:2: note: previous definition of ‘IFF_MULTICAST’ was here
IFF_MULTICAST = 1<<12, /* sysfs */
^
../include/linux/if.h:119:23: error: redeclaration of enumerator ‘IFF_PORTSEL’
#define IFF_PORTSEL IFF_PORTSEL
^
../include/linux/if.h:92:2: note: previous definition of ‘IFF_PORTSEL’ was here
IFF_PORTSEL = 1<<13, /* sysfs */
^
../include/linux/if.h:120:25: error: redeclaration of enumerator ‘IFF_AUTOMEDIA’
#define IFF_AUTOMEDIA IFF_AUTOMEDIA
^
../include/linux/if.h:93:2: note: previous definition of ‘IFF_AUTOMEDIA’ was here
IFF_AUTOMEDIA = 1<<14, /* sysfs */
^
../include/linux/if.h:121:23: error: redeclaration of enumerator ‘IFF_DYNAMIC’
#define IFF_DYNAMIC IFF_DYNAMIC
^
../include/linux/if.h:94:2: note: previous definition of ‘IFF_DYNAMIC’ was here
IFF_DYNAMIC = 1<<15, /* sysfs */
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:111:8: error: redefinition of ‘struct ifmap’
struct ifmap
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:189:8: note: originally defined here
struct ifmap {
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:126:8: error: redefinition of ‘struct ifreq’
struct ifreq
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:226:8: note: originally defined here
struct ifreq {
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:176:8: error: redefinition of ‘struct ifconf’
struct ifconf
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:278:8: note: originally defined here
struct ifconf {
^
In file included from ../include/iptables.h:5:0,
from m_ipt.c:18:
../include/xtables.h:34:29: fatal error: xtables-version.h: No such file or directory
#include <xtables-version.h>
^
compilation terminated.
make[1]: *** [m_ipt.o] Error 1
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/tc'
make: *** [all] Error 2
please help
UPDATE
I ended up updating the kernel and it work!

TC schedulers
ATM no
IPT Package xtables was not found in the pkg-config search path.
Install libxtables-dev on Ubuntu. I can't find a similar package from Fedora. On Fedora you may need to build from sources.
Ubuntu:
$ apt-cache search xtables
libip4tc-dev - Development files for libiptc
libip4tc0 - netfilter libi4pt library
libip6tc-dev - Development files for libiptc
libip6tc0 - netfilter libipt library
libiptc-dev - Development files for libiptc
libiptc0 - netfilter libipt library
libxtables-dev - netfilter xtables library
libxtables11 - netfilter xtables library
Fedora:
$ dnf search xtables
No matches found.
$ dnf search libxtables
No matches found.
Perhaps you should add the directory containing `xtables.pc'
to the PKG_CONFIG_PATH environment variable
If you install into /usr/local/lib on Ubuntu (or /usr/local/lib64 on Fedora`), then you will see something like this:
$ ls -Al /usr/local/lib/pkgconfig/
total 88
-rw-r--r-- 1 root root 228 Oct 22 08:15 expat.pc
-rw-r--r-- 1 root root 726 Oct 19 23:56 gnutls-dane.pc
-rw-r--r-- 1 root root 911 Oct 19 23:56 gnutls.pc
-rw-r--r-- 1 root root 1199 Oct 22 08:53 guile-2.2.pc
-rw-r--r-- 1 root root 563 Oct 22 08:13 hogweed.pc
-rw-r--r-- 1 root root 315 Oct 16 06:56 libcrypto.pc
-rw-r--r-- 1 root root 1678 Oct 16 06:58 libcurl.pc
-rw-r--r-- 1 root root 860 Oct 16 06:52 libidn.pc
...
When you configure you can you can do something like:
INSTALL_PREFIX="/usr/local"
INSTALL_LIBDIR="$INSTALL_PREFIX/lib"
OPT_PKGCONFIG=("$INSTALL_LIBDIR/pkgconfig")
OPT_CPPFLAGS=("-I$INSTALL_PREFIX/include" "-DNDEBUG")
OPT_CFLAGS=("$SH_MARCH" "$SH_NATIVE")
OPT_CXXFLAGS=("$SH_MARCH" "$SH_NATIVE")
OPT_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
OPT_LIBS=("-ldl" "-lpthread")
...
PKG_CONFIG_PATH="${OPT_PKGCONFIG[*]}" \
CPPFLAGS="${OPT_CPPFLAGS[*]}" \
CFLAGS="${OPT_CFLAGS[*]}" CXXFLAGS="${OPT_CXXFLAGS[*]}" \
LDFLAGS="${OPT_LDFLAGS[*]}" LIBS="${OPT_LIBS[*]}" \
./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"
<other config options>

Related

Build error for gnutls-3.7.8 on Ubuntu 20.04.5 - weirdness with streebog512_ctx

I am trying to install gnutls 3.7.8 on an Ubuntu 20.04.5 server. Had to install nettle first.
Command I am running for configure:
PKG_CONFIG_PATH="/usr/lib/pkgconfig/:$PKG_CONFIG_PATH" ./configure --prefix=/usr --with-included-unistring --with-included-libtasn1
Running "make --debug=j", this is where things start to go sideways; everything is running smoothly until then:
Making all in nettle
make\[4\]: Entering directory '/home/meowmeow/Installed_Programs/gnutls-3.7.8/lib/nettle'
Putting child 0x56123e85f740 (mac.lo) PID 1065461 on the chain.
Live child 0x56123e85f740 (mac.lo) PID 1065461
CC mac.lo
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:48: warning: "streebog256_init" redefined
48 | #define streebog256_init \_gnutls_streebog256_init
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:44: note: this is the location of the previous definition
44 | #define streebog256_init nettle_streebog256_init
|
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:49: warning: "streebog256_digest" redefined
49 | #define streebog256_digest \_gnutls_streebog256_digest
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:45: note: this is the location of the previous definition
45 | #define streebog256_digest nettle_streebog256_digest
|
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:50: warning: "streebog512_init" redefined
50 | #define streebog512_init \_gnutls_streebog512_init
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:46: note: this is the location of the previous definition
46 | #define streebog512_init nettle_streebog512_init
|
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:51: warning: "streebog512_update" redefined
51 | #define streebog512_update \_gnutls_streebog512_update
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:47: note: this is the location of the previous definition
47 | #define streebog512_update nettle_streebog512_update
|
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:52: warning: "streebog512_digest" redefined
52 | #define streebog512_digest \_gnutls_streebog512_digest
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:48: note: this is the location of the previous definition
48 | #define streebog512_digest nettle_streebog512_digest
|
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:62:8: error: redefinition of 'struct streebog512_ctx'
62 | struct streebog512_ctx
| ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:58:8: note: originally defined here
58 | struct streebog512_ctx
| ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~
In file included from gost/hmac-gost.h:42,
from mac.c:39:
gost/streebog.h:92: warning: "streebog256_update" redefined
92 | #define streebog256_update \_gnutls_streebog512_update
|
In file included from /usr/include/nettle/hmac.h:44,
from mac.c:33:
/usr/include/nettle/streebog.h:88: note: this is the location of the previous definition
88 | #define streebog256_update nettle_streebog512_update
|
In file included from mac.c:39:
gost/hmac-gost.h:51: warning: "hmac_streebog256_set_key" redefined
51 | #define hmac_streebog256_set_key \_gnutls_hmac_streebog256_set_key
|
In file included from mac.c:33:
/usr/include/nettle/hmac.h:80: note: this is the location of the previous definition
80 | #define hmac_streebog256_set_key nettle_hmac_streebog256_set_key
|
In file included from mac.c:39:
gost/hmac-gost.h:52: warning: "hmac_streebog256_digest" redefined
52 | #define hmac_streebog256_digest \_gnutls_hmac_streebog256_digest
|
In file included from mac.c:33:
/usr/include/nettle/hmac.h:81: note: this is the location of the previous definition
81 | #define hmac_streebog256_digest nettle_hmac_streebog256_digest
|
In file included from mac.c:39:
gost/hmac-gost.h:53: warning: "hmac_streebog512_set_key" redefined
53 | #define hmac_streebog512_set_key \_gnutls_hmac_streebog512_set_key
|
In file included from mac.c:33:
/usr/include/nettle/hmac.h:82: note: this is the location of the previous definition
82 | #define hmac_streebog512_set_key nettle_hmac_streebog512_set_key
|
In file included from mac.c:39:
gost/hmac-gost.h:54: warning: "hmac_streebog512_update" redefined
54 | #define hmac_streebog512_update \_gnutls_hmac_streebog512_update
|
In file included from mac.c:33:
/usr/include/nettle/hmac.h:83: note: this is the location of the previous definition
83 | #define hmac_streebog512_update nettle_hmac_streebog512_update
|
In file included from mac.c:39:
gost/hmac-gost.h:55: warning: "hmac_streebog512_digest" redefined
55 | #define hmac_streebog512_digest \_gnutls_hmac_streebog512_digest
|
In file included from mac.c:33:
/usr/include/nettle/hmac.h:84: note: this is the location of the previous definition
84 | #define hmac_streebog512_digest nettle_hmac_streebog512_digest
|
In file included from mac.c:39:
gost/hmac-gost.h:60:8: error: redefinition of 'struct hmac_streebog512_ctx'
60 | struct hmac_streebog512_ctx HMAC_CTX(struct streebog512_ctx);
| ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
In file included from mac.c:33:
/usr/include/nettle/hmac.h:254:8: note: originally defined here
254 | struct hmac_streebog512_ctx HMAC_CTX(struct streebog512_ctx);
| ^\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
Reaping losing child 0x56123e85f740 PID 1065461
make\[4\]: \*\*\* \[Makefile:2346: mac.lo\] Error 1
Removing child 0x56123e85f740 PID 1065461 from chain.
make\[4\]: Leaving directory '/home/meowmeow/Installed_Programs/gnutls-3.7.8/lib/nettle'
Reaping losing child 0x562065819fa0 PID 1065420
make\[3\]: \*\*\* \[Makefile:2901: all-recursive\] Error 1
Removing child 0x562065819fa0 PID 1065420 from chain.
make\[3\]: Leaving directory '/home/meowmeow/Installed_Programs/gnutls-3.7.8/lib'
Reaping losing child 0x557239209220 PID 1065419
make\[2\]: \*\*\* \[Makefile:2505: all\] Error 2
Removing child 0x557239209220 PID 1065419 from chain.
make\[2\]: Leaving directory '/home/meowmeow/Installed_Programs/gnutls-3.7.8/lib'
Reaping losing child 0x563a8ddd7ab0 PID 1065402
make\[1\]: \*\*\* \[Makefile:2257: all-recursive\] Error 1
Removing child 0x563a8ddd7ab0 PID 1065402 from chain.
make\[1\]: Leaving directory '/home/meowmeow/Installed_Programs/gnutls-3.7.8'
Reaping losing child 0x55f76896c820 PID 1065391
make: \*\*\* \[Makefile:2182: all\] Error 2
Removing child 0x55f76896c820 PID 1065391 from chain.
I am a biologist, I just want to be able to run remote blast on my server and am basically a monkey typing commands when it comes to compiling things - so at this point, I'm pretty much out of knowledge.
I have tried to reinstall nettle many times using different options; have tried searching through the Makefile trying to find what is happening here; have tried multiple configurations of ./configure for gnutls, googled this every which way. I was expecting...to install gnutls.

problem with make command in arch linux (while trying to install RTL8723DE driver)

make -C /lib/modules/5.18.12-arch1-1/build M=/home/rim/Downloads/rtw88_8723de-master
make[1]: Entering directory '/usr/lib/modules/5.18.12-arch1-1/build'
CC [M] /home/rim/Downloads/rtw88_8723de-master/mac80211.o
In file included from ././include/linux/kconfig.h:5,
from <command-line>:
./include/generated/autoconf.h:1332: warning: "CONFIG_RTW88_DEBUGFS" redefined
1332 | #define CONFIG_RTW88_DEBUGFS 1
|
<command-line>: note: this is the location of the previous definition
./include/generated/autoconf.h:6997: warning: "CONFIG_RTW88_DEBUG" redefined
6997 | #define CONFIG_RTW88_DEBUG 1
|
<command-line>: note: this is the location of the previous definition
/home/rim/Downloads/rtw88_8723de-master/mac80211.c:741:35: error: initialization of ‘void (*)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *)’ from incompatible pointer type ‘void (*)(struct ieee80211_hw *, struct ieee80211_vif *, u16)’ {aka ‘void (*)(struct ieee80211_hw *, struct ieee80211_vif *, short unsigned int)’} [-Werror=incompatible-pointer-types]
741 | .mgd_prepare_tx = rtw_ops_mgd_prepare_tx,
| ^~~~~~~~~~~~~~~~~~~~~~
/home/rim/Downloads/rtw88_8723de-master/mac80211.c:741:35: note: (near initialization for ‘rtw_ops.mgd_prepare_tx’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:288: /home/rim/Downloads/rtw88_8723de-master/mac80211.o] Error 1
make[1]: *** [Makefile:1838: /home/rim/Downloads/rtw88_8723de-master] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.18.12-arch1-1/build'
make: *** [Makefile:44: all] Error 2
[rim#archie rtw88_8723de-master]$
I have no idea why is this happening, I tried to install RTL8723_DE driver because I want to connect my computer to web.
Driver I used: https://github.com/rtlwifi-linux/rtw88_8723de
Can somebody help, please?

System crashed during glibc compile, refuses to compile again even after remaking build directory

I am chrooted into the temporary system (/tools). During the compile of glibc (step 6.9 of LFS), my computer unexpectedly shut down. After booting back up, remaking the build directory, running configure and make, it fails. Here is the log:
root:/sources/glibc-2.24/build# make
make -r PARALLELMFLAGS="" -C .. objdir=`pwd` all
make[1]: Entering directory '/sources/glibc-2.24'
make subdir=csu -C csu ..=../ subdir_lib
make[2]: Entering directory '/sources/glibc-2.24/csu'
gawk -f ../scripts/gen-as-const.awk ../sysdeps/x86_64/nptl/tcb-offsets.sym \
| gcc -S -o /sources/glibc-2.24/build/tcb-offsets.hT3 -std=gnu11 -fgnu89-inline -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes -Wold-style-definition -ftls-model=initial-exec -I../include -I/sources/glibc-2.24/build/csu -I/sources/glibc-2.24/build -I../sysdeps/unix/sysv/linux/x86_64/64 -I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/wordsize-64 -I../sysdeps/x86_64/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/64 -I../sysdeps/x86_64/fpu/multiarch -I../sysdeps/x86_64/fpu -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu -I../sysdeps/x86_64/multiarch -I../sysdeps/x86_64 -I../sysdeps/x86 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -D_LIBC_REENTRANT -include /sources/glibc-2.24/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -x c - \
-MD -MP -MF /sources/glibc-2.24/build/tcb-offsets.h.dT -MT '/sources/glibc-2.24/build/tcb-offsets.h.d /sources/glibc-2.24/build/tcb-offsets.h'
In file included from ../sysdeps/generic/hp-timing-common.h:42:0,
from ../sysdeps/x86_64/hp-timing.h:38,
from ../include/libc-internal.h:7,
from ../sysdeps/x86_64/nptl/tls.h:29,
from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:24,
from <stdin>:1:
../sysdeps/generic/_itoa.h:32:25: error: "LONG_MAX" is not defined [-Werror=undef]
# define _ITOA_NEEDED (LONG_MAX != LLONG_MAX)
^
../sysdeps/generic/_itoa.h:97:6: note: in expansion of macro '_ITOA_NEEDED'
#if !_ITOA_NEEDED
^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../Makerules:224: /sources/glibc-2.24/build/tcb-offsets.h] Error 1
make[2]: Leaving directory '/sources/glibc-2.24/csu'
make[1]: *** [Makefile:214: csu/subdir_lib] Error 2
make[1]: Leaving directory '/sources/glibc-2.24'
make: *** [Makefile:9: all] Error 2
root:/sources/glibc-2.24/build#
It seems like limits.h doesn't exist, but I checked, and it does indeed exist.
root:/usr/include/linux# ls | grep "limits.h"
limits.h
EDIT: I catted limits.h and noticed that LONG_MAX indeed was not included in the file. Here is the file:
#ifndef _LINUX_LIMITS_H
#define _LINUX_LIMITS_H
#define NR_OPEN 1024
#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue */
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
#define RTSIG_MAX 32
#endif
root:/usr/include/linux# ls | grep "limits.h"
limits.h
root:/usr/include/linux# cat limits.h
#ifndef _LINUX_LIMITS_H
#define _LINUX_LIMITS_H
#define NR_OPEN 1024
#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue */
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
#define RTSIG_MAX 32
#endif
#ifndef _LINUX_LIMITS_H
This is include/linux/limits.h. The LONG_MAX is supposed to come from include/limits.h, which is a different file.
It's likely that your sources got corrupted after unclean shutdown. You should restore them from a pristine copy.

error: implicit declaration of function 'strtok_r'

I am a newbie in Linux programming (Linux 3.7.10). I tried to compile a program that I got for github but run in to problems with the error. The main program is from ntop where I downloaded the ndpi (https://svn.ntop.org/svn/ntop/trunk/nDPI/) and that compiled ok. The second part is the kernel mode filter that I got from github (https://github.com/ewildgoose/ndpi-netfilter).
First, I could not locate strtok_r function declared in any of the header files. I searched the whole system, is it a prebuild function with in the system?. Please any pointers would be highly appreciated. Thanks.
CC [M] /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.o
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c: In function 'check_content_type_and_change_protocol':
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:610:4: error: implicit declaration of function 'strtok_r' [-Werror=implicit-function-declaration]
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:610:10: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:617:14: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:623:9: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:627:11: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:632:13: warning: assignment makes pointer from integer without a cast [enabled by default]
cc1: some warnings being treated as errors
make[2]: *** [/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.o] Error 1
make[1]: *** [_module_/home/mtot/ndpi/ndpi-netfilter/src] Error 2
Adding more details
I have located the string.h that has the strtok_r in the /usr/include. What I did was to add the in the http.c file and also the -I/usr/include in the ccflags-y in the Makefile. I got the following errors. Help really needed. Thanks.
CC [M] /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.o
In file included from include/linux/compiler.h:48:0,
from include/uapi/linux/stddef.h:1,
`enter code here` from include/linux/stddef.h:4,
from /usr/src/linux-3.7.10/include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/uapi/linux/byteorder/little_endian.h:11,
from include/linux/byteorder/little_endian.h:4,
from /usr/src/linux-3.7.10/arch/x86/include/asm/byteorder.h:4,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_main.h:49,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_protocols.h:29,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:25:
include/linux/compiler-gcc.h:93:0: warning: "__attribute_const__" redefined [enabled by default]
In file included from /usr/include/features.h:375:0,
from /usr/include/string.h:25,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:24:
/usr/include/sys/cdefs.h:237:0: note: this is the location of the previous definition
In file included from include/linux/compiler.h:48:0,
from include/uapi/linux/stddef.h:1,
from include/linux/stddef.h:4,
from /usr/src/linux-3.7.10/include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/uapi/linux/byteorder/little_endian.h:11,
from include/linux/byteorder/little_endian.h:4,
from /usr/src/linux-3.7.10/arch/x86/include/asm/byteorder.h:4,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_main.h:49,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_protocols.h:29,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:25:
include/linux/compiler-gcc.h:112:0: warning: "__always_inline" redefined [enabled by default]
In file included from /usr/include/features.h:375:0,
from /usr/include/string.h:25,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:24:
/usr/include/sys/cdefs.h:308:0: note: this is the location of the previous definition
In file included from include/linux/bitops.h:22:0,
from include/linux/kernel.h:10,
from include/linux/skbuff.h:17,
from include/linux/ip.h:20,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_main.h:105,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_protocols.h:29,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:25:
/usr/src/linux-3.7.10/arch/x86/include/asm/bitops.h:406:19: error: static declaration of 'ffs' follows non-static declaration
In file included from /usr/src/linux-3.7.10/arch/x86/include/asm/string.h:4:0,
from include/linux/string.h:17,
from include/linux/bitmap.h:8,
from include/linux/cpumask.h:11,
from /usr/src/linux-3.7.10/arch/x86/include/asm/cpumask.h:4,
from /usr/src/linux-3.7.10/arch/x86/include/asm/msr.h:18,
from /usr/src/linux-3.7.10/arch/x86/include/asm/processor.h:20,
from /usr/src/linux-3.7.10/arch/x86/include/asm/thread_info.h:22,
from include/linux/thread_info.h:54,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/mm_types.h:8,
from include/linux/kmemcheck.h:4,
from include/linux/skbuff.h:18,
from include/linux/ip.h:20,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_main.h:105,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_protocols.h:29,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:25:
/usr/src/linux-3.7.10/arch/x86/include/asm/string_64.h:64:5: error: expected identifier or '(' before '__extension__'
/usr/src/linux-3.7.10/arch/x86/include/asm/string_64.h:64:5: error: expected identifier or '(' before ')' token
In file included from include/linux/bitmap.h:8:0,
from include/linux/cpumask.h:11,
from /usr/src/linux-3.7.10/arch/x86/include/asm/cpumask.h:4,
from /usr/src/linux-3.7.10/arch/x86/include/asm/msr.h:18,
from /usr/src/linux-3.7.10/arch/x86/include/asm/processor.h:20,
from /usr/src/linux-3.7.10/arch/x86/include/asm/thread_info.h:22,
from include/linux/thread_info.h:54,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/mm_types.h:8,
from include/linux/kmemcheck.h:4,
from include/linux/skbuff.h:18,
from include/linux/ip.h:20,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_main.h:105,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/include/ndpi_protocols.h:29,
from /home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.c:25:
include/linux/string.h:38:12: error: expected identifier or '(' before '__extension__'
include/linux/string.h:38:12: error: expected identifier or '(' before ')' token
include/linux/string.h:41:12: error: expected identifier or '(' before '__extension__'
include/linux/string.h:53:15: error: expected identifier or '(' before '__extension__'
include/linux/string.h:83:15: error: expected identifier or '(' before '__extension__'
include/linux/string.h:83:15: error: expected identifier or '(' before ')' token
include/linux/string.h:86:15: error: expected identifier or '(' before '__extension__'
include/linux/string.h:86:15: error: expected identifier or '(' before ')' token
include/linux/string.h:89:24: error: expected identifier or '(' before '__extension__'
include/linux/string.h:89:24: error: expected identifier or '(' before ')' token
include/linux/string.h:92:24: error: expected identifier or '(' before '__extension__'
include/linux/string.h:92:24: error: expected identifier or '(' before ')' token
make[2]: *** [/home/mtot/ndpi/ndpi-netfilter/src/ndpi_cpy/lib/protocols/http.o] Error 1
make[1]: *** [_module_/home/mtot/ndpi/ndpi-netfilter/src] Error 2
make[1]: Leaving directory `/usr/src/linux-3.7.10'
make: *** [all] Error 2
-----MakeFile
NDPI_PATH2 := ${NDPI_PATH}/src
NDPI_SRC := ndpi_cpy
NDPI_PRO := ${NDPI_SRC}/lib/protocols
NDPI_THIRD := $(NDPI_SRC)/lib/third_party/src
SYS_HDR := /usr/include
ccflags-y += -I${src}/${NDPI_SRC}/include -I${src}/${NDPI_SRC}/lib -I${src}/${NDPI_SRC}/lib/third_party/include -I${SYS_HDR} -DOPENDPI_NETFILTER_MODULE
EXTRA_CFLAGS := $(ccflags-y)
#MODULES_DIR := /lib/modules/$(shell uname -r)
#KERNEL_DIR := ${MODULES_DIR}/build
obj-m := xt_ndpi.o
xt_ndpi-y := main.o \
${NDPI_SRC}/lib/ndpi_main.o \
${NDPI_THIRD}/ahocorasick.o \
${NDPI_THIRD}/node.o \
${NDPI_THIRD}/sort.o \
${NDPI_PRO}/afp.o \
${NDPI_PRO}/http.o
all:
if test -d ${NDPI_SRC}; then \
cp ${NDPI_PATH2}/* ${NDPI_SRC} -R; \
else \
mkdir ${NDPI_SRC}; \
cp ${NDPI_PATH2}/* ${NDPI_SRC} -R; \
fi
make -C ${KERNEL_DIR} M=$$PWD;
rm -r ${NDPI_SRC}
modules:
make -C ${KERNEL_DIR} M=$$PWD $#;
modules_install:
make -C ${KERNEL_DIR} M=$$PWD $#;
depmod -a;
clean:
make -C ${KERNEL_DIR} M=$$PWD $#;
strtok_r is typically in string.h. On a Linux system with man-pages installed you can do
man strtok_r
and that will give the manual page:
STRTOK(3) Linux Programmer’s Manual STRTOK(3)
NAME
strtok, strtok_r - extract tokens from strings
SYNOPSIS
#include <string.h>
char *strtok(char *str, const char *delim);
char *strtok_r(char *str, const char *delim, char **saveptr);
...
The include line tells you which file it is in (and must include in your code that uses it). Have you checked to see if you have string.h on your system? It is typically under /usr/include.
A lot of distributions have development packages, have you installed such packages to gain a fully development environment?
Type
man strtok_r
in a terminal. You should get a man page like strtok_r(3) (please follow that link).
Be sure to have installed the appropriate development and documentation packages like libc6-dev (or libc-dev), glibc-doc, manpages-dev. (The actual name depends upon the distribution).

toolchain arm glibc 2.12.1 error

I try to create cross toolchian for arm
but have this error:
In file included from dl-lookup.c:28:0:
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:29:0: warning: "VALID_ELF_ABIVERSION" redefined
In file included from dynamic-link.h:88:0,
from dl-load.c:34:
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:29:0: warning: "VALID_ELF_ABIVERSION" redefined
../sysdeps/unix/sysv/linux/ldsodefs.h:62:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:30:0: warning: "VALID_ELF_OSABI" redefined
../sysdeps/unix/sysv/linux/ldsodefs.h:60:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:32:0: warning: "VALID_ELF_HEADER" redefined
../sysdeps/unix/sysv/linux/ldsodefs.h:58:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h: In function 'elf_machine_load_address':
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:81:38: warning: taking address of expression of type 'void'
../sysdeps/unix/sysv/linux/ldsodefs.h:62:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:30:0: warning: "VALID_ELF_OSABI" redefined
../sysdeps/unix/sysv/linux/ldsodefs.h:60:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:32:0: warning: "VALID_ELF_HEADER" redefined
../sysdeps/unix/sysv/linux/ldsodefs.h:58:0: note: this is the location of the previous definition
../glibc-ports-2.11/sysdeps/arm/dl-machine.h: In function 'elf_machine_load_address':
../glibc-ports-2.11/sysdeps/arm/dl-machine.h:81:38: warning: taking address of expression of type 'void'
dl-load.c: In function 'open_verify':
dl-load.c:1663:41: error: macro "VALID_ELF_ABIVERSION" passed 2 arguments, but takes just 1
dl-load.c:1662:12: error: 'VALID_ELF_ABIVERSION' undeclared (first use in this function)
dl-load.c:1662:12: note: each undeclared identifier is reported only once for each function it appears in
dl-load.c:1708:36: error: macro "VALID_ELF_ABIVERSION" passed 2 arguments, but takes just 1
dl-load.c:1577:3: warning: unused variable 'expected2'
make[2]: *** [/home/pahlevan/Desktop/rezaee/sources/glibc-build/elf/dl-load.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/pahlevan/Desktop/rezaee/sources/glibc-2.12.1/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/pahlevan/Desktop/rezaee/sources/glibc-2.12.1'
my configuration is :
gcc-4.5.1+linux.2.6.35.4+binutils-2.20.51+glibc-2.12.1+port-2.11
CLFS_TARGET="arm-pahlevan-linux-gnu"
cd /sources
tar -jxf glibc-2.12.1.tar.bz2
cd ./glibc-2.12.1
tar -jxf ../glibc-ports-2.11.tar.bz2
cp -v Makeconfig{,.orig}
sed -e 's/-lgcc_eh//g' Makeconfig.orig > Makeconfig
patch -Np1 -i ../glibc-2.12.1-gcc_fix-1.patch
patch -Np1 -i ../glibc-2.12.1-makefile_fix-1.patch
mkdir -v ../glibc-build
cd ../glibc-build
export CC="${CLFS_TARGET}-gcc"
export LD="${CLFS_TARGET}-ld"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
../glibc-2.12.1/configure --prefix=/tools \
--host=${CLFS_TARGET} --build=${CLFS_HOST} --with-tls --with-__thread \
--disable-profile --enable-add-ons --with-binutils=/cross-tools/bin --with-headers=/tools/include \
--enable-kernel=2.6.22.5 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes libc_cv_gnu89_inline=yes
make
make install
cd ..
rm -rf glibc-2.12.1 glibc-build
I solved my compile error (glic-ports-2.12.1)
the problem in this file
"glibc-ports-2.12.1/sysdeps/arm/dl-machine.h"
you must erase this lines :
#define VALID_ELF_ABIVERSION(ver) (ver == 0)
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV || osabi == ELFOSABI_ARM)
#define VALID_ELF_HEADER(hdr,exp,size) memcmp (hdr,exp,size-2) == 0 && VALID_ELF_OSABI (hdr[EI_OSABI]) && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
and replace with lines :
#ifndef VALID_ELF_ABIVERSION
#define VALID_ELF_ABIVERSION(ver) (ver == 0)
#endif
#ifndef VALID_ELF_OSABI
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV || osabi == ELFOSABI_ARM)
#endif
#ifndef VALID_ELF_HEADER
#define VALID_ELF_HEADER(hdr,exp,size) memcmp (hdr,exp,size-2) == 0 && VALID_ELF_OSABI (hdr[EI_OSABI]) && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
#endif

Resources