RTL8821CE(wifi) driver installation issue: KBUILD_MODNAME - linux

I downloaded the following driver for my new HP 17z laptop running Linux Mint 19: https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce
Upon modifying the makefile by instruction I ran the "make" command and get the following error:
z
ermacroyd#DALEK:~/Downloads/rtl8821ce$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.15.0-20-generic/build M=/home/zermacroyd/Downloads/rtl8821ce modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-20-generic'
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_cmd.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_security.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_debug.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_io.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ioctl_query.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ioctl_set.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ieee80211.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mlme.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mlme_ext.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mi.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_wlan_util.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_vht.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_pwrctrl.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_rf.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_recv.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_sta_mgt.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ap.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_xmit.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_p2p.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_tdls.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o
In file included from ./include/linux/printk.h:350:0,
from ./include/linux/kernel.h:14,
from ./include/linux/skbuff.h:17,
from ./include/linux/if_arp.h:26,
from /home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.c:23:
./include/net/inet_connection_sock.h: In function ‘inet_csk_clear_xmit_timer’:
./include/linux/dynamic_debug.h:77:14: error: ‘KBUILD_MODNAME’ undeclared (first use in this function); did you mean ‘KBUILD_BASENAME’?
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:216:3: note: in expansion of macro ‘pr_debug’
pr_debug("%s", inet_csk_timer_bug_msg);
^~~~~~~~
./include/linux/dynamic_debug.h:77:14: note: each undeclared identifier is reported only once for each function it appears in
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:216:3: note: in expansion of macro ‘pr_debug’
pr_debug("%s", inet_csk_timer_bug_msg);
^~~~~~~~
./include/net/inet_connection_sock.h: In function ‘inet_csk_reset_xmit_timer’:
./include/linux/dynamic_debug.h:77:14: error: ‘KBUILD_MODNAME’ undeclared (first use in this function); did you mean ‘KBUILD_BASENAME’?
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:232:3: note: in expansion of macro ‘pr_debug’
pr_debug("reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n",
^~~~~~~~
scripts/Makefile.build:332: recipe for target '/home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o' failed
make[2]: *** [/home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o] Error 1
Makefile:1552: recipe for target '_module_/home/zermacroyd/Downloads/rtl8821ce' failed
make[1]: *** [_module_/home/zermacroyd/Downloads/rtl8821ce] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-20-generic'
Makefile:1897: recipe for target 'modules' failed
make: *** [modules] Error 2
The problem file is rtw_br_ext.c which uses headers from the Linux kernel. So there are NO KBUILD flags in the makefile. What is the best way to fix this?

do not make changes to the make file.
without making changes run the file and it will run Ok.
On that Github url, there is no instruction for changing the make file.

Related

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?

Unable to make redis on windows machine

I am trying to use redis in my nodejs project. I see that to build redis you need make command and gcc. I have instaled cygwin on my windows machine and then installed both make and gcc.
I downloaded redis from here https://redis.io/download and as per the instructions -
$ wget http://download.redis.io/releases/redis-3.2.8.tar.gz
$ tar xzf redis-3.2.8.tar.gz
$ cd redis-3.2.8
$ make
I am trying to do same, but facing some issues while building this. Here are the logs :-
D:\Node.JS\redis-3.2.8>make
cd src && make all
make[1]: Entering directory '/cygdrive/d/Node.JS/redis-3.2.8/src'
CC adlist.o
CC quicklist.o
CC ae.o
In file included from ae.c:58:0:
ae_select.c: In function 'aeApiResize':
ae_select.c:52:37: warning: unused parameter 'eventLoop' [-Wunused-parameter]
static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
^~~~~~~~~
CC anet.o
CC dict.o
CC server.o
CC sds.o
CC zmalloc.o
zmalloc.c: In function 'zmalloc_get_memory_size':
zmalloc.c:421:1: warning: control reaches end of non-void function [-Wreturn-typ
e]
}
^
CC lzf_c.o
CC lzf_d.o
CC pqsort.o
CC zipmap.o
CC sha1.o
CC ziplist.o
CC release.o
CC networking.o
CC util.o
CC object.o
CC db.o
CC replication.o
CC rdb.o
CC t_string.o
CC t_list.o
CC t_set.o
CC t_zset.o
CC t_hash.o
CC config.o
CC aof.o
CC pubsub.o
CC multi.o
CC debug.o
debug.c: In function 'watchdogSignalHandler':
debug.c:1138:60: warning: unused parameter 'secret' [-Wunused-parameter]
void watchdogSignalHandler(int sig, siginfo_t *info, void *secret) {
^~~~~~
CC sort.o
CC intset.o
CC syncio.o
CC cluster.o
CC crc16.o
CC endianconv.o
CC slowlog.o
CC scripting.o
CC bio.o
CC rio.o
CC rand.o
CC memtest.o
CC crc64.o
CC bitops.o
CC sentinel.o
CC notify.o
CC setproctitle.o
CC blocked.o
CC hyperloglog.o
CC latency.o
CC sparkline.o
CC redis-check-rdb.o
CC geo.o
LINK redis-server
cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
cc: error: ../deps/geohash-int/geohash.o: No such file or directory
cc: error: ../deps/geohash-int/geohash_helper.o: No such file or directory
make[1]: *** [Makefile:185: redis-server] Error 1
make[1]: Leaving directory '/cygdrive/d/Node.JS/redis-3.2.8/src'
make: *** [Makefile:6: all] Error 2
D:\Node.JS\redis-3.2.8>m
Can anyone help me what could be the issue ?
here the new redis 5 version compiled with info on how to do it
https://github.com/meiry/redis5_compiled_for_windows10
As #FluffyNights suggested that redis does not support windows. I made it in working mode using https://github.com/MSOpenTech/redis
Download releases from here https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip then extract this compressed file.
You will find redis-server.exe there, just execute it to start redis server. This has redis client also which you can use to execute its commands to save, get etc

`make V=99` not showing the compiler command

[il#vmarch openwrt]$ make V=99
...
make -C /home/il/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.36 HOSTCFLAGS="-O2 -I/home/il/openwrt/staging_dir/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="mips-openwrt-linux-uclibc-" ARCH="mips" KBUILD_HAVE_NLS=no CONFIG_SHELL="/usr/bin/bash" V='' CC="mips-openwrt-linux-uclibc-gcc" modules
make[5]: Entering directory '/home/il/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.36'
...
CC [M] net/netfilter/xt_comment.o
net/netfilter/xt_comment.c:1:1: error: expected identifier or '(' before numeric constant
0 0
^
How to make it print gcc ... instead of CC [M]
According to make help:
make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
No V=99 anywhere... just use V=1 to see the commands run.

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