]>
Commit | Line | Data |
---|---|---|
26c94a74 BS |
1 | --- kicad-5.0.0/common/system/libcontext.cpp.orig 2018-07-13 21:53:52.000000000 +0200 |
2 | +++ kicad-5.0.0/common/system/libcontext.cpp 2018-08-12 12:01:30.930309888 +0200 | |
3 | @@ -258,12 +258,10 @@ | |
4 | #endif | |
5 | ||
6 | #if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc) | |
7 | +intptr_t LIBCONTEXT_CALL_CONVENTION libcontext::jump_fcontext( libcontext::fcontext_t* ofc, libcontext::fcontext_t nfc, | |
8 | + intptr_t vp, bool preserve_fpu ) | |
9 | +{ | |
10 | __asm ( | |
11 | -".text\n" | |
12 | -".globl jump_fcontext\n" | |
13 | -".align 2\n" | |
14 | -".type jump_fcontext,@function\n" | |
15 | -"jump_fcontext:\n" | |
16 | " movl 0x10(%esp), %ecx\n" | |
17 | " pushl %ebp \n" | |
18 | " pushl %ebx \n" | |
19 | @@ -293,19 +291,16 @@ | |
20 | " popl %edx\n" | |
21 | " movl %eax, 0x4(%esp)\n" | |
22 | " jmp *%edx\n" | |
23 | -".size jump_fcontext,.-jump_fcontext\n" | |
24 | -".section .note.GNU-stack,\"\",%progbits\n" | |
25 | ); | |
26 | +} | |
27 | ||
28 | #endif | |
29 | ||
30 | #if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc) | |
31 | +libcontext::fcontext_t LIBCONTEXT_CALL_CONVENTION libcontext::make_fcontext( void* sp, size_t size, | |
32 | + void (* fn)( intptr_t ) ) | |
33 | +{ | |
34 | __asm ( | |
35 | -".text\n" | |
36 | -".globl make_fcontext\n" | |
37 | -".align 2\n" | |
38 | -".type make_fcontext,@function\n" | |
39 | -"make_fcontext:\n" | |
40 | " movl 0x4(%esp), %eax\n" | |
41 | " leal -0x8(%eax), %eax\n" | |
42 | " andl $-16, %eax\n" | |
43 | @@ -327,19 +322,16 @@ | |
44 | " movl %eax, (%esp)\n" | |
45 | " call _exit@PLT\n" | |
46 | " hlt\n" | |
47 | -".size make_fcontext,.-make_fcontext\n" | |
48 | -".section .note.GNU-stack,\"\",%progbits\n" | |
49 | ); | |
50 | +} | |
51 | ||
52 | #endif | |
53 | ||
54 | #if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc) | |
55 | +intptr_t LIBCONTEXT_CALL_CONVENTION libcontext::jump_fcontext( libcontext::fcontext_t* ofc, libcontext::fcontext_t nfc, | |
56 | + intptr_t vp, bool preserve_fpu ) | |
57 | +{ | |
58 | __asm ( | |
59 | -".text\n" | |
60 | -".globl jump_fcontext\n" | |
61 | -".type jump_fcontext,@function\n" | |
62 | -".align 16\n" | |
63 | -"jump_fcontext:\n" | |
64 | " pushq %rbp \n" | |
65 | " pushq %rbx \n" | |
66 | " pushq %r15 \n" | |
67 | @@ -370,19 +362,16 @@ | |
68 | " movq %rdx, %rax\n" | |
69 | " movq %rdx, %rdi\n" | |
70 | " jmp *%r8\n" | |
71 | -".size jump_fcontext,.-jump_fcontext\n" | |
72 | -".section .note.GNU-stack,\"\",%progbits\n" | |
73 | ); | |
74 | +} | |
75 | ||
76 | #endif | |
77 | ||
78 | #if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc) | |
79 | +libcontext::fcontext_t LIBCONTEXT_CALL_CONVENTION libcontext::make_fcontext( void* sp, size_t size, | |
80 | + void (* fn)( intptr_t ) ) | |
81 | +{ | |
82 | __asm ( | |
83 | -".text\n" | |
84 | -".globl make_fcontext\n" | |
85 | -".type make_fcontext,@function\n" | |
86 | -".align 16\n" | |
87 | -"make_fcontext:\n" | |
88 | " movq %rdi, %rax\n" | |
89 | " andq $-16, %rax\n" | |
90 | " leaq -0x48(%rax), %rax\n" | |
91 | @@ -396,9 +385,8 @@ | |
92 | " xorq %rdi, %rdi\n" | |
93 | " call _exit@PLT\n" | |
94 | " hlt\n" | |
95 | -".size make_fcontext,.-make_fcontext\n" | |
96 | -".section .note.GNU-stack,\"\",%progbits\n" | |
97 | ); | |
98 | +} | |
99 | ||
100 | #endif | |
101 | ||
102 | --- kicad-5.0.0/include/system/libcontext.h.orig 2018-07-13 21:53:52.000000000 +0200 | |
103 | +++ kicad-5.0.0/include/system/libcontext.h 2018-08-12 11:59:20.941248992 +0200 | |
104 | @@ -30,15 +30,19 @@ | |
105 | #if defined(__x86_64__) || defined(__amd64__) | |
106 | #define LIBCONTEXT_PLATFORM_linux_x86_64 | |
107 | #define LIBCONTEXT_CALL_CONVENTION | |
108 | + #define LIBCONTEXT_FUNCTION_ALIGN 16 | |
109 | #elif __i386__ | |
110 | #define LIBCONTEXT_PLATFORM_linux_i386 | |
111 | #define LIBCONTEXT_CALL_CONVENTION | |
112 | + #define LIBCONTEXT_FUNCTION_ALIGN 2 | |
113 | #elif __arm__ | |
114 | #define LIBCONTEXT_PLATFORM_linux_arm32 | |
115 | #define LIBCONTEXT_CALL_CONVENTION | |
116 | + #define LIBCONTEXT_FUNCTION_ALIGN 2 | |
117 | #elif __aarch64__ | |
118 | #define LIBCONTEXT_PLATFORM_linux_arm64 | |
119 | #define LIBCONTEXT_CALL_CONVENTION | |
120 | + #define LIBCONTEXT_FUNCTION_ALIGN 2 | |
121 | #endif | |
122 | ||
123 | #elif defined(__MINGW32__) || defined(__MINGW64__) | |
124 | @@ -74,22 +78,15 @@ | |
125 | ||
126 | typedef void* fcontext_t; | |
127 | ||
128 | -#ifdef __cplusplus | |
129 | -extern "C" { | |
130 | -#endif | |
131 | ||
132 | ||
133 | intptr_t LIBCONTEXT_CALL_CONVENTION jump_fcontext( fcontext_t* ofc, fcontext_t nfc, | |
134 | - intptr_t vp, bool preserve_fpu = true ); | |
135 | + intptr_t vp, bool preserve_fpu = true ) __attribute__ ((naked, aligned(LIBCONTEXT_FUNCTION_ALIGN) )); | |
136 | fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext( void* sp, size_t size, | |
137 | - void (* fn)( intptr_t ) ); | |
138 | + void (* fn)( intptr_t ) ) __attribute__ ((naked, aligned(LIBCONTEXT_FUNCTION_ALIGN) )); | |
139 | ||
140 | #ifdef __cplusplus | |
141 | } // namespace | |
142 | #endif | |
143 | ||
144 | -#ifdef __cplusplus | |
145 | -} // extern "C" | |
146 | -#endif | |
147 | - | |
148 | #endif |