This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libgo] PATCH: Handle system call numbers "(0x40000000 | (234))"


On Fri, Dec 9, 2011 at 2:47 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>
>> Some my Linux system, system call numbers are defined as
>>
>> #define __NR_x32_rt_sigaction ? ? ? ? ? ? ? ? __NR_X32_SYSCALL(0)
>>
>> and
>>
>> __NR_X32_SYSCALL(0) is expanded to (0x40000000 | (512 + 0)). ?This patch
>> tries to deal with by checking '^// unknowndefine SYS_[a-z]' and uses
>> "${CC} -E" to extract the real number. ?Tested on Linux/x86-64. ?OK
>> to install?
>
> This patch might be a little simpler. ?Does it solve the problem?
>

It doesn't work. I didn't define all system call numbers which are mapped to
sys_ni_syscall in kernel.  If you use them, you will get a compile
time error since those __NR_XXXX aren't defined.  I used

+    ${CC} -E unknown-syscalls.c | \
+      grep "^const SYS_.*=" | \
+      grep -v __NR_ >> ${OUT}

to filter them out.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]