]> git.pld-linux.org Git - packages/kernel-tools.git/blame - x32.patch
- adjusted x32 patch to work with gcc 10.2 (which defines __ILP32__ also for plain...
[packages/kernel-tools.git] / x32.patch
CommitLineData
dbaf19f8
JB
1FIXME: regs_load.S need complete x32 ABI support; now it will just compile, but tests won't run properly.
2--- linux-4.7/tools/scripts/Makefile.arch~ 2015-02-09 03:54:22.000000000 +0100
3+++ linux-4.7/tools/scripts/Makefile.arch 2015-04-11 12:17:45.107911011 +0200
e1e434f5 4@@ -24,8 +24,15 @@
bedc6c43
JR
5 ARCH ?= $(RAW_ARCH)
6
7 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
8+ILP32 := $(shell echo __ILP32__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
e1e434f5 9+X86_64 := $(shell echo __x86_64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
bedc6c43
JR
10 ifeq ($(LP64), 1)
11 IS_64_BIT := 1
12 else
13 IS_64_BIT := 0
14 endif
e1e434f5 15+ifeq ($(x86_64)_$(ILP32), 1_1)
bedc6c43
JR
16+ IS_X32_BIT := 1
17+else
18+ IS_X32_BIT := 0
19+endif
51feff82
JB
20--- linux-4.8/tools/perf/Makefile.config~ 2015-04-11 12:12:31.000000000 +0200
21+++ linux-4.8/tools/perf/Makefile.config 2015-04-11 12:19:05.011244885 +0200
388d18e6 22@@ -41,6 +41,11 @@
51feff82 23 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
bedc6c43
JR
24 endif
25 NO_PERF_REGS := 0
26+ ifeq (${IS_X32_BIT}, 1)
27+ CFLAGS += -DHAVE_ARCH_X32_SUPPORT
388d18e6
JR
28+ ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
29+ LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
bedc6c43
JR
30+ endif
31 endif
32
33 ifeq ($(ARCH),arm)
def4eb6e
JB
34--- linux-5.5/tools/perf/arch/x86/tests/regs_load.S.orig 2020-01-27 20:52:02.819752368 +0100
35+++ linux-5.5/tools/perf/arch/x86/tests/regs_load.S 2020-01-27 20:56:05.908435444 +0100
36@@ -63,14 +63,20 @@
37 SYM_FUNC_END(perf_regs_load)
bedc6c43 38 #else
def4eb6e 39 SYM_FUNC_START(perf_regs_load)
bedc6c43
JR
40- push %edi
41+#ifdef HAVE_ARCH_X32_SUPPORT
42+#else
43+ pushl %edi
44+#endif
45 movl 8(%esp), %edi
46 movl %eax, AX(%edi)
47 movl %ebx, BX(%edi)
48 movl %ecx, CX(%edi)
49 movl %edx, DX(%edi)
50 movl %esi, SI(%edi)
51- pop %eax
52+#ifdef HAVE_ARCH_X32_SUPPORT
53+#else
54+ popl %eax
55+#endif
56 movl %eax, DI(%edi)
57 movl %ebp, BP(%edi)
58
bedc6c43
JR
59--- linux-3.19/tools/perf/bench/sched-messaging.c~ 2015-02-09 03:54:22.000000000 +0100
60+++ linux-3.19/tools/perf/bench/sched-messaging.c 2015-04-11 12:33:22.587917365 +0200
61@@ -310,13 +310,24 @@
62 printf("# %d groups == %d %s run\n\n",
63 num_groups, num_groups * 2 * num_fds,
64 thread_mode ? "threads" : "processes");
65+#if defined(__x86_64__) && !defined(__ILP32__)
66 printf(" %14s: %lu.%03lu [sec]\n", "Total time",
67 diff.tv_sec,
2c8f0d44 68 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
69+#else
70+ printf(" %14s: %llu.%03llu [sec]\n", "Total time",
71+ diff.tv_sec,
2c8f0d44 72+ (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
73+#endif
74 break;
75 case BENCH_FORMAT_SIMPLE:
76+#if defined(__x86_64__) && !defined(__ILP32__)
77 printf("%lu.%03lu\n", diff.tv_sec,
2c8f0d44 78 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
79+#else
80+ printf("%llu.%03llu\n", diff.tv_sec,
2c8f0d44 81+ (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
82+#endif
83 break;
84 default:
85 /* reaching here is something disaster */
86--- linux-3.19/tools/perf/bench/sched-pipe.c~ 2015-02-09 03:54:22.000000000 +0100
87+++ linux-3.19/tools/perf/bench/sched-pipe.c 2015-04-11 12:34:32.727917841 +0200
88@@ -156,9 +156,15 @@
89 result_usec = diff.tv_sec * 1000000;
90 result_usec += diff.tv_usec;
91
92+#if defined(__x86_64__) && !defined(__ILP32__)
93 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
94 diff.tv_sec,
2c8f0d44 95 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
96+#else
97+ printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
98+ diff.tv_sec,
2c8f0d44 99+ (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
100+#endif
101
102 printf(" %14lf usecs/op\n",
103 (double)result_usec / (double)loops);
104@@ -168,9 +174,15 @@
105 break;
106
107 case BENCH_FORMAT_SIMPLE:
108+#if defined(__x86_64__) && !defined(__ILP32__)
109 printf("%lu.%03lu\n",
110 diff.tv_sec,
2c8f0d44 111 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
112+#else
113+ printf("%llu.%03llu\n",
114+ diff.tv_sec,
2c8f0d44 115+ (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
bedc6c43
JR
116+#endif
117 break;
118
119 default:
bedc6c43
JR
120--- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100
121+++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
122@@ -565,7 +565,11 @@
123 gettimeofday(&tv, NULL);
124 if (localtime_r(&tv.tv_sec, &ltime)) {
125 strftime(date, sizeof(date), "%H:%M:%S", &ltime);
126+#if defined(__x86_64__) && !defined(__ILP32__)
127 pr_info("%s.%06ld", date, tv.tv_usec);
128+#else
129+ pr_info("%s.%06lld", date, tv.tv_usec);
130+#endif
131 } else
132 pr_info("00:00:00.000000");
133
388d18e6
JR
134--- linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2019-05-06 02:42:58.000000000 +0200
135+++ linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c 2019-05-18 12:32:31.916685600 +0200
136@@ -8,7 +8,7 @@
137 #include "../../util/debug.h"
138 #endif
139
140-#ifdef HAVE_ARCH_X86_64_SUPPORT
141+#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
142 int LIBUNWIND__ARCH_REG_ID(int regnum)
143 {
144 int id;
This page took 0.068292 seconds and 4 git commands to generate.