Jim Gifford wrote:
I've actually taken the scripts a bit further. Building GLIBC and GCC from the raw kernel headers and only using the sanitized stuff for everything else. On a few of the lists I have seen this done with success and found out that this is the recommended build method for GLIBC, still checking on the status GCC and this situation. I have created http://ftp.jg555.com/headers/headers2 for the sanitized part of my build, but use the raw non-sanitized headers installed in /tools/linux-headers for GCC and GLIBC. copying them straight from the kernel sources. I based my builds off of the current CLFS with minor modifications which I will be posting in the wiki sometime this week.


Ran into difficulties tonight. Need to protect against kernel types that conflict with glibc in linux/types.h.

From self sanitized headers (Jim's and Jurg's):
....
#include <linux/posix_types.h>
#include <asm/types.h>

#ifndef __KERNEL_STRICT_NAMES

typedef __u32 __kernel_dev_t;

typedef __kernel_fd_set         fd_set;
typedef __kernel_dev_t          dev_t;
typedef __kernel_ino_t          ino_t;
typedef __kernel_mode_t         mode_t;
typedef __kernel_nlink_t        nlink_t;
typedef __kernel_off_t          off_t;
typedef __kernel_pid_t          pid_t;
typedef __kernel_daddr_t        daddr_t;
typedef __kernel_key_t          key_t;
typedef __kernel_suseconds_t    suseconds_t;
typedef __kernel_timer_t        timer_t;
typedef __kernel_clockid_t      clockid_t;
typedef __kernel_mqd_t          mqd_t;

typedef __kernel_uid_t          uid_t;
typedef __kernel_gid_t          gid_t;
....

From llh:
....
#include <sys/types.h>
#include <linux/posix_types.h>
#include <asm/types.h>

#ifndef __KERNEL_STRICT_NAMES

typedef __u32 __kernel_dev_t;

#if defined(WANT_KERNEL_TYPES) || !defined(__GLIBC__)
typedef __kernel_fd_set         fd_set;         /* <sys/select.h> */
typedef __kernel_dev_t dev_t; /* <sys/stat.h>, <sys/types.h> */ typedef __kernel_ino_t ino_t; /* <dirent.h>, <sys/stat.h>, <sys/types.h> */ typedef __kernel_mode_t mode_t; /* <sys/ipc.h>, <sys/mman.h>, <sys/stat.h>, <sys/types.h> */ typedef __kernel_nlink_t nlink_t; /* <sys/stat.h>, <sys/types.h> */ typedef __kernel_off_t off_t; /* <unistd.h>, <sys/mman.h>, <sys/stat.h>, <sys/types.h> */ typedef __kernel_pid_t pid_t; /* <signal.h>, <time.h>, <unistd.h>... (lots) */
typedef __kernel_daddr_t        daddr_t;        /* <sys/types.h> */
typedef __kernel_key_t key_t; /* <sys/ipc.h>, <sys/types.h> */typedef __kernel_suseconds_t suseconds_t; /* <sys/select.h>, <sys/time.h>, <sys/types.h> */ typedef __kernel_timer_t timer_t; /* <time.h> [also from <sys/types.h>] */ typedef __kernel_clockid_t clockid_t; /* <time.h> [also from <sys/types.h>] */
typedef __kernel_mqd_t          mqd_t;


typedef __kernel_uid_t uid_t; /* <pwd.h>, <signal.h>, <strops.h>... (lots) */ typedef __kernel_gid_t gid_t; /* <grp.h>, <pwd.h>, <strops.h>... (lots) */
....


I have exactly three instances of 'WANT_KERNEL_TYPES' in my /usr/include tree. :-) I'm honestly not sure why they wern't ripped out completely unless that is something that was PLD specific that was slipped in there as it really doesn't hurt. Might want to check Redhat, Gentoo, Debian, ... sets to see what they do. The quick solution for xorg-server was to remove both instances of linux/types.h in lnx_agp.c. I chose to add the same protected ifdef to linux/types.h and drag in sys/types.h.

HTH

-- DJ Lucas
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to