Initial commit: Uploaded everything from abs/core
[arch-rock.git] / base / klibc-udev / klibc-remove-revert.patch
blob8d9484fe8964235fd9470a58d2a6fc760bfaf708
1 ### Archlinux revert
2 ### revert this patch, crazy udev devs
3 From: Kay Sievers <kay.sievers@suse.de>
4 Date: Fri, 4 Aug 2006 22:02:58 +0000 (+0200)
5 Subject: libvolume_id: read ufs2 label
6 X-Git-Tag: 097
7 X-Git-Url: http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commitdiff;h=eb82b76dedc1482b6434c46fee84d3ef13cb9648
9 libvolume_id: read ufs2 label
11 Taken from the FreeBSD HAL repository.
12 ---
14 --- a/Makefile
15 +++ b/Makefile
16 @@ -33,6 +33,9 @@ USE_GCOV = false
17 # include Security-Enhanced Linux support
18 USE_SELINUX = false
20 +# comile with klibc instead of glibc
21 +USE_KLIBC = false
23 # set this to create statically linked binaries
24 USE_STATIC = false
26 @@ -139,6 +142,12 @@ ifeq ($(strip $(USE_GCOV)),true)
27 LDFLAGS += -fprofile-arcs
28 endif
30 +ifeq ($(strip $(USE_KLIBC)),true)
31 + KLCC = /usr/bin/$(CROSS_COMPILE)klcc
32 + CC = $(KLCC)
33 + LD = $(KLCC)
34 +endif
36 ifeq ($(strip $(USE_SELINUX)),true)
37 UDEV_OBJS += udev_selinux.o
38 LIB_OBJS += -lselinux -lsepol
39 --- a/README
40 +++ b/README
41 @@ -69,6 +69,10 @@ Compile Options:
42 USE_SELINUX
43 If set to 'true', udev will be built with SELinux support
44 enabled. This is disabled by default.
45 + USE_KLIBC
46 + If set to 'true', udev is built and linked against klibc.
47 + Default value is 'false'. KLCC specifies the klibc compiler
48 + wrapper, usually located at /usr/bin/klcc.
49 EXTRAS
50 list of helper programs in extras/ to build.
51 make EXTRAS="extras/cdrom_id extras/scsi_id extras/volume_id"
52 --- a/extras/scsi_id/scsi_id.c
53 +++ b/extras/scsi_id/scsi_id.c
54 @@ -402,7 +402,8 @@ static int set_options(int argc, char **
56 * optind is a global extern used by getopt. Since we can call
57 * set_options twice (once for command line, and once for config
58 - * file) we have to reset this back to 1.
59 + * file) we have to reset this back to 1. [Note glibc handles
60 + * setting this to 0, but klibc does not.]
62 optind = 1;
63 while (1) {
64 --- a/test/simple-build-check.sh
65 +++ b/test/simple-build-check.sh
66 @@ -23,6 +23,14 @@ make clean EXTRAS="$EXTRAS" >/dev/null
67 make all $MAKEOPTS USE_LOG=false EXTRAS="$EXTRAS" || exit
68 echo -e "\n\n"
70 +# klibc build
71 +if [ -n "$KLCC" -a -e "$KLCC" ]; then
72 + echo KLCC: "$KLCC"
73 + make clean EXTRAS="$EXTRAS" >/dev/null
74 + make all -j4 $MAKEOPTS USE_KLIBC=true DEBUG=true EXTRAS="$EXTRAS" KLCC="$KLCC" || exit
75 + echo -e "\n\n"
76 +fi
78 # install in temporary dir and show it
79 TEMPDIR="`pwd`/.tmp"
80 rm -rf $TEMPDIR
81 --- a/udev_libc_wrapper.c
82 +++ b/udev_libc_wrapper.c
83 @@ -30,7 +30,7 @@
85 #include "udev.h"
87 -#ifndef __GLIBC__
88 +#ifdef __KLIBC__
89 #define __OWN_USERDB_PARSER__
90 #endif
92 --- a/udev_libc_wrapper.h
93 +++ b/udev_libc_wrapper.h
94 @@ -105,7 +105,7 @@ static inline int inotify_add_watch(int
96 #else
97 /* needed until /usr/include/sys/inotify.h is working */
98 -#ifndef __GLIBC__
99 +#ifdef __KLIBC__
100 #include <sys/inotify.h>
101 #else
102 static inline int inotify_init(void)
103 @@ -117,7 +117,7 @@ static inline int inotify_add_watch(int
105 return syscall(__NR_inotify_add_watch, fd, name, mask);
107 -#endif /* __GLIBC__ */
108 +#endif /* __KLIBC__ */
109 #endif /* __NR_inotify_init */
111 #ifndef IN_CREATE