Skip to contentSkip to conversation

Recent binutils releases and linux kernel 2.5.69+

DISCUSSION H. J. Lu 3 participants 8 messages May 29, 2003 – May 30, 2003 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

H. J. Lu

author
#2 lore raw

This is a kernel issue and should be fixed in kernel unless we want to do something in <sys/sysctl.h>.

H.J.
---

linux/sysctl.h renamed from linux/sysctl.h.user +5 -0
@@ -28,6 +28,11 @@
 #include <linux/types.h>
 #include <linux/list.h>
 
+#ifdefine __KERNEL__
+#undef __user
+#define __user
+#endif
+
 struct file;
 
 #define CTL_MAXNAME 10		/* how many path components do we allow in a
Quoted 37 lines · ismail donmez
Quoted 2 lines · --- "H. J. Lu

What is the problem? Does linux/sysctl.h include
linux/compiler.h?

No it doesnt include it directly. It includes linux/kernel.h and linux/kernel.h does a trick like

#ifdef __KERNEL__
.......
#include <linux/compiler.h>

So we never get __user defined.

Quoted 2 lines

Does your compiler define __CHECKER__?

No.

Would it be too bad to a trick like

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,70)
#define __user
#endif

What do you think?

Regards,
/ismail

=====
Microsoft Windows: made for the internet
The Internet: made for UNIX

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

#3 lore raw
Quoted 2 lines · H. J. Lu

This is a kernel issue and should be fixed in kernel unless we want to do something in <sys/sysctl.h>.

You should not include kernel headers from userspace.

#4 lore raw

Hi,

Quoted 5 lines · H. J. Lu
Quoted 2 lines

This is a kernel issue and should be fixed in kernel unless we want to do something in <sys/sysctl.h>.

You should not include kernel headers from userspace.

Old story I know but I dont think binutils would use kernel headers if it doesnt need it.

Regards,
/ismail

P.S: Yeah I am [email protected]

author
#5 lore raw
Quoted 10 lines · ismail (cartman) donmez

Hi,

Quoted 5 lines · H. J. Lu
Quoted 2 lines

This is a kernel issue and should be fixed in kernel unless we want to do something in <sys/sysctl.h>.

You should not include kernel headers from userspace.

Old story I know but I dont think binutils would use kernel headers if it doesnt need it.

<sys/sysctl.h> includes <linux/sysctl.h>. That is what I meant by "do something in <sys/sysctl.h>."

H.J.

#6 lore raw
Quoted 11 lines · H. J. Lu
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This is a kernel issue and should be fixed in kernel unless we want to do something in <sys/sysctl.h>.

You should not include kernel headers from userspace.

Old story I know but I dont think binutils would use kernel headers if it doesnt need it.

<sys/sysctl.h> includes <linux/sysctl.h>. That is what I meant by "do something in <sys/sysctl.h>."

I know. and <linux/sysctl.h> is a kernel header libc shouldn't include. So you want to do something to <sys/sysctl.h>, namely get rid of it's depency on kernel headers.

#7 lore raw
Quoted 3 lines · Christoph Hellwig

I know. and <linux/sysctl.h> is a kernel header libc shouldn't include. So you want to do something to <sys/sysctl.h>, namely get rid of it's depency on kernel headers.

Wouldn't this result in glibc-kernel inconsistency in headers?

Regards,
/ismail

#8 lore raw
Quoted 5 lines · ismail (cartman) donmez
Quoted 3 lines · Christoph Hellwig

I know. and <linux/sysctl.h> is a kernel header libc shouldn't include. So you want to do something to <sys/sysctl.h>, namely get rid of it's depency on kernel headers.

Wouldn't this result in glibc-kernel inconsistency in headers?

How so? If the sysctl values change you're screwed anyway.

#9 lore raw
Quoted 1 line · Christoph Hellwig

How so? If the sysctl values change you're screwed anyway.

Heh that was what I mean like what if glibc header and kernel header differs a lot. Its bringing more harm than goodness but including linux/sysctl.h in sys/sysctl.h makes two header synchronised.

Wondering what glibc guys think to solve this ? Ulrich Drepper or some other glibc hacker make a comment please?

Regards,
/ismail