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