Hi all,
When I tried the tutorial how to build Genode for Linux, I have an error :
In file included from /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:21: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_socketcall(int, long unsigned int*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:82: erreur: ‘__NR_socketcall’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_write(int, const void*, Genode::size_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:164: erreur: ‘__NR_write’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_close(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:170: erreur: ‘__NR_close’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_execve(const char*, char* const*, char* const*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:181: erreur: ‘__NR_execve’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void lx_exit(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:187: erreur: ‘__NR_exit’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void lx_exit_group(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:193: erreur: ‘__NR_exit_group’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_open(const char*, int, mode_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:203: erreur: ‘__NR_open’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void* lx_mmap(void*, Genode::size_t, int, int, int, off_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:213: erreur: ‘__NR_mmap2’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_munmap(void*, size_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:220: erreur: ‘__NR_munmap’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_ftruncate(int, long unsigned int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:253: erreur: ‘__NR_ftruncate’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_unlink(const char*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:259: erreur: ‘__NR_unlink’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_stat(const char*, stat64*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:271: erreur: ‘__NR_stat64’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_sigaction(int, void (*)(int))’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:332: erreur: ‘__NR_rt_sigaction’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_kill(int, int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:343: erreur: ‘__NR_kill’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_tgkill(int, int, int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:355: erreur: ‘__NR_tgkill’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘pid_t lx_getpid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:381: erreur: ‘__NR_getpid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘pid_t lx_gettid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:382: erreur: ‘__NR_gettid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘uid_t lx_getuid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:383: erreur: ‘__NR_getuid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_nanosleep(const timespec*, timespec*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:394: erreur: ‘__NR_nanosleep’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘bool lx_sigpending(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:445: erreur: ‘__NR_rt_sigpending’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘bool lx_sigsetmask(int, bool)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:461: erreur: ‘__NR_rt_sigprocmask’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc: In member function ‘void Genode::Ipc_istream::_wait()’: /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:117: erreur: ‘EINTR’ was not declared in this scope make[3]: *** [ipc.o] Erreur 1 make[2]: *** [ipc.lib] Erreur 2 make[1]: *** [gen_deps_and_build_targets] Erreur 2 make[1]: quittant le répertoire « /home/lbtruong/genode.11/buildLinux » Error: Genode build failed make: *** [run/demo] Erreur 252
Would you like guide me how to solve this problem ?
Regards,
TRUONG
Hello Truong,
When I tried the tutorial how to build Genode for Linux, I have an error :
In file included from /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:21: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_socketcall(int, long unsigned int*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:82: erreur: ‘__NR_socketcall’ was not declared in this scope
Genode's syscall bindings for Linux include the host-system's Linux headers containing the syscall opcodes (the definitions are prefixed with SYS_). Those definitions are mapped to __NR_-prefixed defines in '/usr/include/bits/syscall.h'. According our you output, so far, everthing seems to be fine.
On 32-bit Ubuntu Linux, those names are then defined in '/usr/include/asm/unistd_32.h'. For some reason, this last step seems to go wrong on your Linux distribution.
Which Linux distribution are you using? Do you have the Linux kernel headers installed (I assume yes because the compiler does not complain about missing them)?
You could help to resolve the issue by posting result of a grep for '__NR_socketcall' in '/usr/include':
grep -r __NR_socketcall /usr/include
If you see a line containing something like the following
#define __NR_socketcall 102
Could you please tell us the name of the header file where is definition is found on your platform?
Thanks Norman
Hi Norman,
Thanks for your rapid response.
I'm sorry, I forgot to mention my distribution is Ubuntu 11.04.
with grep -r __NR_socketcall /usr/include , I see :
/usr/include/i386-linux-gnu/asm/unistd_32.h:#define __NR_socketcall 102
Regards, TRUONG
Le mercredi 07 septembre 2011 à 16:27 +0200, Norman Feske a écrit :
Hello Truong,
When I tried the tutorial how to build Genode for Linux, I have an error :
In file included from /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:21: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_socketcall(int, long unsigned int*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:82: erreur: ‘__NR_socketcall’ was not declared in this scope
Genode's syscall bindings for Linux include the host-system's Linux headers containing the syscall opcodes (the definitions are prefixed with SYS_). Those definitions are mapped to __NR_-prefixed defines in '/usr/include/bits/syscall.h'. According our you output, so far, everthing seems to be fine.
On 32-bit Ubuntu Linux, those names are then defined in '/usr/include/asm/unistd_32.h'. For some reason, this last step seems to go wrong on your Linux distribution.
Which Linux distribution are you using? Do you have the Linux kernel headers installed (I assume yes because the compiler does not complain about missing them)?
You could help to resolve the issue by posting result of a grep for '__NR_socketcall' in '/usr/include':
grep -r __NR_socketcall /usr/include
If you see a line containing something like the following
#define __NR_socketcall 102
Could you please tell us the name of the header file where is definition is found on your platform?
Thanks Norman
Hello Truong,
ok, now that makes sense. On Ubuntu 11.04, the includes have moved to the 'i386-linux-gnu' subdirectory. When compiling components that use the Linux syscall bindings, we tell the compiler to use the standard include search locations. This works because the Genode tool chain is actually a Linux tool chain. However, at the time when the Genode tool chain was built, those standard include paths did not comprise the 'i386-linux-gnu' subdirectory. So this directory is not searched for includes.
There is a quick fix and a real fix for this problem. The quick fix is the patch attached to this email. The patch adds the new include search location manually to the search paths. Could you please give it a try? If it works for you, I will commit it to our public SVN. If it does not work, could you please post the lines of the log preceding the actual error message?
The real fix would be to use a non-Linux tool chain in the first place and let the Genode build system handle the include-search paths explicitly (rather than relying on gcc's built-in heuristics). This is one topic I am currently working on. I expect that the tool chain will become part of the next release scheduled for November.
Best regards Norman
Hi Norman,
I'm sorry but it doesn't work. My distribution is a French version. So you may have somme difficult to understand the log.
Dans le fichier inclus à partir de /usr/include/sys/socket.h:40, à partir de /usr/include/netinet/in.h:25, à partir de /usr/include/arpa/inet.h:23, à partir de /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:18: /usr/include/bits/socket.h:381:24: attention : asm/socket.h : Aucun fichier ou dossier de ce type Dans le fichier inclus à partir de /usr/include/bits/errno.h:25, à partir de /usr/include/errno.h:36, à partir de /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:19: /usr/include/linux/errno.h:4:23: attention : asm/errno.h : Aucun fichier ou dossier de ce type Dans le fichier inclus à partir de /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:36, à partir de /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:21: /usr/include/sys/syscall.h:25:24: attention : asm/unistd.h : Aucun fichier ou dossier de ce type In file included from /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:21: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_socketcall(int, long unsigned int*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:82: erreur: ‘__NR_socketcall’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_write(int, const void*, Genode::size_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:164: erreur: ‘__NR_write’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_close(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:170: erreur: ‘__NR_close’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_execve(const char*, char* const*, char* const*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:181: erreur: ‘__NR_execve’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void lx_exit(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:187: erreur: ‘__NR_exit’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void lx_exit_group(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:193: erreur: ‘__NR_exit_group’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_open(const char*, int, mode_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:203: erreur: ‘__NR_open’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘void* lx_mmap(void*, Genode::size_t, int, int, int, off_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:213: erreur: ‘__NR_mmap2’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_munmap(void*, size_t)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:220: erreur: ‘__NR_munmap’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_ftruncate(int, long unsigned int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:253: erreur: ‘__NR_ftruncate’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_unlink(const char*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:259: erreur: ‘__NR_unlink’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_stat(const char*, stat64*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:271: erreur: ‘__NR_stat64’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_sigaction(int, void (*)(int))’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:332: erreur: ‘__NR_rt_sigaction’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_kill(int, int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:343: erreur: ‘__NR_kill’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_tgkill(int, int, int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:355: erreur: ‘__NR_tgkill’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘pid_t lx_getpid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:381: erreur: ‘__NR_getpid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘pid_t lx_gettid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:382: erreur: ‘__NR_gettid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘uid_t lx_getuid()’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:383: erreur: ‘__NR_getuid’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘int lx_nanosleep(const timespec*, timespec*)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:394: erreur: ‘__NR_nanosleep’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘bool lx_sigpending(int)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:445: erreur: ‘__NR_rt_sigpending’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h: In function ‘bool lx_sigsetmask(int, bool)’: /home/lbtruong/genode.11/base-linux/src/platform/linux_syscalls.h:461: erreur: ‘__NR_rt_sigprocmask’ was not declared in this scope /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc: In member function ‘void Genode::Ipc_istream::_wait()’: /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:117: erreur: ‘EINTR’ was not declared in this scope make[3]: *** [ipc.o] Erreur 1 make[2]: *** [ipc.lib] Erreur 2 make[1]: *** [gen_deps_and_build_targets] Erreur 2 make[1]: quittant le répertoire « /home/lbtruong/genode.11/buildLinux » Error: Genode build failed make: *** [run/demo] Erreur 252 make: quittant le répertoire « /home/lbtruong/genode.11/buildLinux »
Regards, TRUONG
Le mercredi 07 septembre 2011 à 17:11 +0200, Norman Feske a écrit :
Hello Truong,
ok, now that makes sense. On Ubuntu 11.04, the includes have moved to the 'i386-linux-gnu' subdirectory. When compiling components that use the Linux syscall bindings, we tell the compiler to use the standard include search locations. This works because the Genode tool chain is actually a Linux tool chain. However, at the time when the Genode tool chain was built, those standard include paths did not comprise the 'i386-linux-gnu' subdirectory. So this directory is not searched for includes.
There is a quick fix and a real fix for this problem. The quick fix is the patch attached to this email. The patch adds the new include search location manually to the search paths. Could you please give it a try? If it works for you, I will commit it to our public SVN. If it does not work, could you please post the lines of the log preceding the actual error message?
The real fix would be to use a non-Linux tool chain in the first place and let the Genode build system handle the include-search paths explicitly (rather than relying on gcc's built-in heuristics). This is one topic I am currently working on. I expect that the tool chain will become part of the next release scheduled for November.
Best regards Norman
Using storage to extend the benefits of virtualization and iSCSI Virtualization increases hardware utilization and delivers a new level of agility. Learn what those decisions are and how to modernize your storage and backup environments for virtualization. http://www.accelacomm.com/jaw/sfnl/114/51434361/ _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hello Truong,
thanks a lot! This log was of great help.
Dans le fichier inclus à partir de /usr/include/sys/socket.h:40, à partir de /usr/include/netinet/in.h:25, à partir de /usr/include/arpa/inet.h:23, à partir de /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:18: /usr/include/bits/socket.h:381:24: attention : asm/socket.h : Aucun fichier ou dossier de ce type
The actual problem is the absence of the '/usr/include/asm/' directory. The attached patch adds the new location at the places where needed. However, this should just be an interim fix. Please expect a clean solution in our SVN mid next week.
I hope, the new patch works for you.
Cheers Norman
Hi Norman,
Unbelievable, it works. You dia a great job.
Thanks,
Le Bao TRUONG
Le mercredi 07 septembre 2011 à 17:50 +0200, Norman Feske a écrit :
Hello Truong,
thanks a lot! This log was of great help.
Dans le fichier inclus à partir de /usr/include/sys/socket.h:40, à partir de /usr/include/netinet/in.h:25, à partir de /usr/include/arpa/inet.h:23, à partir de /home/lbtruong/genode.11/base-linux/src/base/ipc/ipc.cc:18: /usr/include/bits/socket.h:381:24: attention : asm/socket.h : Aucun fichier ou dossier de ce type
The actual problem is the absence of the '/usr/include/asm/' directory. The attached patch adds the new location at the places where needed. However, this should just be an interim fix. Please expect a clean solution in our SVN mid next week.
I hope, the new patch works for you.
Cheers Norman
Using storage to extend the benefits of virtualization and iSCSI Virtualization increases hardware utilization and delivers a new level of agility. Learn what those decisions are and how to modernize your storage and backup environments for virtualization. http://www.accelacomm.com/jaw/sfnl/114/51434361/ _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hello Truong,
thank you for testing the patches so quickly. Now I can construct a clean fix.
BTW, please excuse my naive question but what is the correct (and polite) way to refer to your first name. Is it Truong, or Le Bao, or TRUONG? I ask because I want to avoid embarrassing you with greeting you in each mail in a wrong way. .-)
Best regards Norman
Hello Le Bao,
now I have committed a much better solution to the SVN. Instead of duplicating in the 'i386-linux-gnu' paths at several places, the handling of hybrid Linux/Genode applications is now taken care of by the 'syscall' and the new 'lx_hybrid' libraries.
Maybe you would like to give the current SVN version a try?
Cheers Norman
Hi Norman,
Thanks for the good information. I will check it out.
Regards, Le Bao
Le vendredi 16 septembre 2011 à 10:40 +0200, Norman Feske a écrit :
Hello Le Bao,
now I have committed a much better solution to the SVN. Instead of duplicating in the 'i386-linux-gnu' paths at several places, the handling of hybrid Linux/Genode applications is now taken care of by the 'syscall' and the new 'lx_hybrid' libraries.
Maybe you would like to give the current SVN version a try?
Cheers Norman
Hi Norman,
Yours solution works well for me.
Regards, Le Bao
Le vendredi 16 septembre 2011 à 10:40 +0200, Norman Feske a écrit :
Hello Le Bao,
now I have committed a much better solution to the SVN. Instead of duplicating in the 'i386-linux-gnu' paths at several places, the handling of hybrid Linux/Genode applications is now taken care of by the 'syscall' and the new 'lx_hybrid' libraries.
Maybe you would like to give the current SVN version a try?
Cheers Norman