[devel-ports] /usr/include/asm/unistd.h linux_2.6.18 проблема системных вызовов

gosha =?iso-8859-1?q?gosha_=CE=C1_elins=2Eru?=
Пт Дек 14 17:47:11 MSK 2007


                                           Добрый день,

    Невезуха.

    Ситуация такова, что все пакеты, использующие #define системных вызовов 
файла /usr/include/asm/unistd.h не собираются.


Причина следующая: 
/* /usr/include/asm/unistd.h: */
#ifdef __KERNEL__

#ifndef __ASSEMBLY__
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall1(type,name,atype,a) \
type name(atype a) \
{ \
	register unsigned long __a0 asm("$4") = (unsigned long) a; \
	register unsigned long __a3 asm("$7"); \
	unsigned long __v0; \
	\
	__asm__ volatile ( \
	".set\tnoreorder\n\t" \
	"li\t$2, %3\t\t\t# " #name "\n\t" \
	"syscall\n\t" \
	"move\t%0, $2\n\t" \
	".set\treorder" \
	: "=&r" (__v0), "=r" (__a3) \
	: "r" (__a0), "i" (__NR_##name) \
	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
	  "memory"); \
	\
	if (__a3 == 0) \
		return (type) __v0; \
	errno = __v0; \
	return (type) -1; \
}
..................................................................................................................................
#endif
#endif


напр компилируется coreutils:
exit.c :
#include <linux/unistd.h>
int errno;
_syscall1(void,exit,int,status);
void _start(void)
{exit(STATUS);}


Как я понял, при сборке не выставлен флаг -D __KERNEL__ .  и, поэтому, не 
обрабатывается препроцессором _syscall1(void,exit,int,status)

соотв получаем ошибки типа.
llseek.c:34: error: expected declaration specifiers or '...' before '_llseek'
llseek.c:34: error: expected declaration specifiers or '...' before 'fd'
llseek.c:34: error: expected declaration specifiers or '...' 
before 'offset_high'
llseek.c:35: error: expected declaration specifiers or '...' 
before 'offset_low'
llseek.c:35: error: expected declaration specifiers or '...' before 'result'
llseek.c:36: error: expected declaration specifiers or '...' before 'origin'

==============================================
Где могли бы быть неправильные настройки сборки?

Как победить ?

     Спасибо.
-- 
С Уваженим,
       gosha.


Подробная информация о списке рассылки devel-ports