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