]> git.pld-linux.org Git - packages/libcap.git/blob - libcap-link.patch
- updated link patch to use -fPIC when compiling shared library
[packages/libcap.git] / libcap-link.patch
1 --- libcap-1.92/libcap/Makefile.orig    Fri Apr 23 08:15:10 1999
2 +++ libcap-1.92/libcap/Makefile Tue Oct 22 23:33:28 2002
3 @@ -34,12 +34,12 @@
4  #      @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
5  
6  $(MINLIBNAME): $(OBJS)
7 -       $(LD) -soname $(MAJLIBNAME) -x -shared -o $@ $(OBJS)
8 +       $(CC) -Wl,-soname -Wl,$(MAJLIBNAME) -Wl,-x -shared -o $@ $(OBJS)
9         ln -sf $(MINLIBNAME) $(MAJLIBNAME)
10         ln -sf $(MAJLIBNAME) $(LIBNAME)
11  
12  %.o: %.c $(INCLS)
13 -       $(CC) $(CFLAGS) -c $< -o $@
14 +       $(CC) $(CFLAGS) -fPIC -c $< -o $@
15  
16  install: all
17         mkdir -p -m 0755 $(INCDIR)/sys
18 --- libcap-1.92/libcap/cap_sys.c.orig   1999-04-23 08:16:31.000000000 +0200
19 +++ libcap-1.92/libcap/cap_sys.c        2003-07-26 23:46:58.000000000 +0200
20 @@ -11,6 +11,25 @@
21  #define __LIBRARY__
22  #include <linux/unistd.h>
23  
24 +#ifdef __i386__
25 +/* ugh, _syscall{1+} don't support PIC on x86 :/ */
26 +int capget(cap_user_header_t header, cap_user_data_t data)
27 +{ int __res;
28 +  __asm__ volatile ("pushl %%ebx\nmovl %%edx, %%ebx\nint $0x80\npopl %%ebx" \
29 +       : "=a" (__res) \
30 +       : "0" (__NR_capget), "d" (header), "c" (data));
31 +  printf("%d", _libcap_kernel_version);
32 +  __syscall_return(int, __res);
33 +}
34 +
35 +int capset(cap_user_header_t header, const cap_user_data_t data)
36 +{ int __res;
37 +  __asm__ volatile ("pushl %%ebx\nmovl %%edx, %%ebx\nint $0x80\npopl %%ebx" \
38 +       : "=a" (__res) \
39 +       : "0" (__NR_capset), "d" (header), "c" (data));
40 +  __syscall_return(int, __res);
41 +}
42 +#else
43  _syscall2(int, capget,
44           cap_user_header_t, header,
45           cap_user_data_t, data)
46 @@ -18,6 +37,7 @@
47  _syscall2(int, capset,
48           cap_user_header_t, header,
49           const cap_user_data_t, data)
50 +#endif
51  
52  /* library defaults to agreeing with the kernel under which it was
53     compiled */
This page took 0.03438 seconds and 4 git commands to generate.