Home/Support/Support Forum/eventfd.h not in toolchain include path
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

eventfd.h not in toolchain include path

0 votes
Why is eventfd.h not available in DigiEL 5.7.2 for the 9M 2443 board, the kernel supports it, the include file is in /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/
but adding that dir to the include path breaks compilation. what change need I make to use eventfd and not break the environment

regards
asked Mar 4, 2015 in Linux by marcL New to the Community (2 points)

Please log in or register to answer this question.

3 Answers

0 votes
please provide more details on what are you are trying to build, how are you compiling and what errors you get
answered Mar 4, 2015 by LeonidM Veteran of the Digi Community (4,290 points)
Well, dig dig...
Even though </usr/local/DigiEL-5.7/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include> is in the project include path
this works
#include "/usr/local/DigiEL-5.7/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include/sys/eventfd.h"
this fails
#include <sys/eventfd.h>

wondering what is missed here but in any case
**** Build of configuration Debug for project DmsApp ****

make all
Building file: ../main.cpp
Invoking arm-linux-g++ (cross)Compiler
arm-linux-g++ -DDMS_DEBUG -D_DMS_MIB_SUPPORT_ -DSTDCXX_98_HEADERS -I/home/marc/work2443/local/include -I"/home/marc/work2443/DmsApp" -I"/home/marc/work2443/DmsApp/agent" -O0 -g3 -Wall -c -fmessage-length=0 -std=gnu++0x -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
../main.cpp:36:25: warning: sys/eventfd.h: No such file or directory
../main.cpp:70: warning: 'loggerModuleName' defined but not used
Finished building: ../main.cpp
 
Building target: DmsApp
Invoking arm-linux-g++ (cross)Linker
arm-linux-g++ -L/home/marc/work2443/local/lib -o"DmsApp"  ./DmsAlimDevice.o ./DmsConfig.o ./DmsCrc.o ./DmsGlobalHelper.o ./DmsGraphic.o ./DmsMonitor.o ./DmsMonitorThread.o ./DmsPicController.o ./DmsPropertiesCTRL.o ./IniFile.o ./main.o ./sysfsgpio.o  ./agent/auxiov1_1203.o ./agent/auxiov2_1201.o ./agent/ntcip1103v0212_report.o ./agent/ntcip1103v0212_security.o ./agent/ntcip1201_v03.o ./agent/ntcip1203.o ./agent/ntcip8004_2008.o ./agent/rfc1155_smi.o ./agent/rfc_1212.o   -lpthread -lagent++ -lagentx++ -ldes -lsnmp++
./main.o: In function `main':
/home/marc/work2443/DmsApp/Debug/../main.cpp:276: undefined reference to `eventfd'
collect2: ld returned 1 exit status
make: *** [DmsApp] Error 1

It wont link, saw a needed patch somewhere on the net for arm + seems to be a bug in uClibc as well in the version used by DigiEL

regards
Well, I am keep looking...
Even though </usr/local/DigiEL-5.7/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include> is in the project include path
this works
#include "/usr/local/DigiEL-5.7/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include/sys/eventfd.h"
this fails
#include <sys/eventfd.h>

wondering what is missed here but in any case
**** Build of configuration Debug for project DmsApp ****

make all
Building file: ../main.cpp
Invoking arm-linux-g++ (cross)Compiler
arm-linux-g++ -DDMS_DEBUG -D_DMS_MIB_SUPPORT_ -DSTDCXX_98_HEADERS -I/home/marc/work2443/local/include -I"/home/marc/work2443/DmsApp" -I"/home/marc/work2443/DmsApp/agent" -O0 -g3 -Wall -c -fmessage-length=0 -std=gnu++0x -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
../main.cpp:36:25: warning: sys/eventfd.h: No such file or directory
../main.cpp:70: warning: 'loggerModuleName' defined but not used
Finished building: ../main.cpp
 
Building target: DmsApp
Invoking arm-linux-g++ (cross)Linker
arm-linux-g++ -L/home/marc/work2443/local/lib -o"DmsApp"  ./DmsAlimDevice.o ./DmsConfig.o ./DmsCrc.o ./DmsGlobalHelper.o ./DmsGraphic.o ./DmsMonitor.o ./DmsMonitorThread.o ./DmsPicController.o ./DmsPropertiesCTRL.o ./IniFile.o ./main.o ./sysfsgpio.o  ./agent/auxiov1_1203.o ./agent/auxiov2_1201.o ./agent/ntcip1103v0212_report.o ./agent/ntcip1103v0212_security.o ./agent/ntcip1201_v03.o ./agent/ntcip1203.o ./agent/ntcip8004_2008.o ./agent/rfc1155_smi.o ./agent/rfc_1212.o   -lpthread -lagent++ -lagentx++ -ldes -lsnmp++
./main.o: In function `main':
/home/marc/work2443/DmsApp/Debug/../main.cpp:276: undefined reference to `eventfd'
collect2: ld returned 1 exit status
make: *** [DmsApp] Error 1

It wont link, saw a needed patch somewhere on the net for arm + seems to be a bug in uClibc as well in the version used by DigiEL

regards
0 votes
Hi, I am porting our message sign to Linux from WinCE. basically a SNMP server. I am compiling within the managed DigiEL IDE. I need to use eventfd() and including the header results in

../main.cpp:33:27: warning: linux/eventfd.h: No such file or directory

looking for it in the toolchain folders /usr/local/DigiEL-5.7

marc@ubuntu:/usr/local/DigiEL-5.7$ find ./ | grep eventfd
./kernel/linux-2.6.35/virt/kvm/eventfd.c
./kernel/linux-2.6.35/include/linux/eventfd.h
./kernel/linux-2.6.35/fs/eventfd.c
./x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include/sys/eventfd.h

So the support is in the kernel (and enabled) and the cortex_a8 toolchain but not with the 9M 2443. So my guess is that all be fine when we get to the MX53 board but we have many 2443 board left.

I have tried (not too sure if it was a good idea in the first place) including .../kernel/linux-2.6.35/include in the search path but then the list of error grows (not declare/redefined...)

after including a few headers...

/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/wait.h:4:1: warning: "WNOHANG" redefined
In file included from /usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/stdlib.h:44,
from ../main.cpp:31:
/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/waitflags.h:26:1: warning: this is the location of the previous definition
In file included from /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:13,
from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/wait.h:5:1: warning: "WUNTRACED" redefined
In file included from /usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/stdlib.h:44,
from ../main.cpp:31:
/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/waitflags.h:27:1: warning: this is the location of the previous definition
In file included from /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:13,
from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/wait.h:6:1: warning: "WSTOPPED" redefined
In file included from /usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/stdlib.h:44,
from ../main.cpp:31:
/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/waitflags.h:30:1: warning: this is the location of the previous definition
In file included from /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:13,
from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/wait.h:7:1: warning: "WEXITED" redefined
In file included from /usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/stdlib.h:44,
from ../main.cpp:31:
/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/waitflags.h:31:1: warning: this is the location of the previous definition
In file included from /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:13,
from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/wait.h:8:1: warning: "WCONTINUED" redefined
In file included from /usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/stdlib.h:44,
from ../main.cpp:31:
/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/waitflags.h:32:1: warning: this is the location of the previous definition
In file included from /usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:12,
from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/file.h:21: error: 'fmode_t' has not been declared
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/file.h: In function 'void fput_light(file*, int)':
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/file.h:26: error: 'unlikely' was not declared in this scope
In file included from ../main.cpp:35:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h: In function 'file* eventfd_file_create(unsigned int, int)':
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:50: error: 'ERR_PTR' was not declared in this scope
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h: In function 'eventfd_ctx* eventfd_ctx_fdget(int)':
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:55: error: 'ERR_PTR' was not declared in this scope
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h: At global scope:
/usr/local/DigiEL-5.7/kernel/linux-2.6.35/include/linux/eventfd.h:75: error: 'wait_queue_t' has not been declared

I first tough this might this be a uClibc version problem but then the cortex_a8 toolchain seems to use the same....

Which leads to another ?... is there any instruction on upgrading the toolchain to a newer version (uCLibc / gcc)

thanks
answered Mar 5, 2015 by marcL New to the Community (2 points)
0 votes
>>>Even though </usr/local/DigiEL-5.7/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/include> is in the project include path

2443 is not cortex_a8 so you can't use anything from that path. 2443 is ARM9 and uses arm-unknown-linux-gnueabi
answered Mar 5, 2015 by LeonidM Veteran of the Digi Community (4,290 points)
I did not include those path, DigiEl did... its under MyApp/includes ?
is it possible to update the toolchain?, uClibc version etc?
...