summaryrefslogtreecommitdiffstats
path: root/sys-apps/util-linux/files/util-linux-2.12i-pic.patch
blob: 8fb91be8b79562bc54117ba0568072a564317dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -ur util-linux-2.12i.orig/fdisk/llseek.c util-linux-2.12i/fdisk/llseek.c
--- util-linux-2.12i.orig/fdisk/llseek.c	2004-11-11 20:08:34.074942938 -0500
+++ util-linux-2.12i/fdisk/llseek.c	2004-11-11 20:09:43.040353443 -0500
@@ -3,6 +3,9 @@
  *
  * Copyright (C) 1994 Remy Card.  This file may be redistributed
  * under the terms of the GNU Public License.
+ *
+ * Changes:
+ * 20030712 - Alexander Gabert <pappy@nikita.ath.cx> - adding PIC defines
  */
 
 #include <sys/types.h>
@@ -19,7 +22,9 @@
 
 #else	/* HAVE_LLSEEK */
 
-#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
+/* do not use assembler to put together syscalls at compile time (for llseek for example) when using PIC */
+#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__) \
+    || defined(__PIC__) || defined(__pic__)
 
 #define my_llseek lseek
 
diff -ur util-linux-2.12i.orig/fdisk/sfdisk.c util-linux-2.12i/fdisk/sfdisk.c
--- util-linux-2.12i.orig/fdisk/sfdisk.c	2004-11-11 20:08:34.074942938 -0500
+++ util-linux-2.12i/fdisk/sfdisk.c	2004-11-11 20:11:07.242982424 -0500
@@ -30,6 +30,7 @@
  * 19990319 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> - i18n
  * 20040428 - Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> - added PACKED
  * 20040824 - David A. Wheeler <dwheeler@dwheeler.com> - warnings to stderr
+ * 20030712 - Alexander Gabert <pappy@nikita.ath.cx> - adding PIC defines
  */
 
 #define PROGNAME "sfdisk"
@@ -172,7 +173,9 @@
  * Note: we use 512-byte sectors here, irrespective of the hardware ss.
  */
 #undef use_lseek
-#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__)
+/* do not use the assembler constructed syscalls for seeking if compiled as PIC */
+#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__) \
+    || defined(__PIC__) && defined(__pic__)
 #define use_lseek
 #endif
 
diff -ur util-linux-2.12i.orig/partx/partx.c util-linux-2.12i/partx/partx.c
--- util-linux-2.12i.orig/partx/partx.c	2004-11-11 20:08:34.155928155 -0500
+++ util-linux-2.12i/partx/partx.c	2004-11-11 20:12:34.740010020 -0500
@@ -333,7 +333,8 @@
 /*
  * sseek: seek to specified sector
  */
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
+#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__) \
+    && !defined(__PIC__) && !defined(__pic__)
 #define NEED__llseek
 #endif