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.
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?
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.
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).
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