Gentoo Archives: gentoo-commits

From: "Jakov Smolić" <jsmolic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/ffcall/, dev-libs/ffcall/files/
Date: Sun, 08 May 2022 19:28:36
Message-Id: 1652038075.27474f966c5c419ea4fd3a7cb050071d0f9d84c6.jsmolic@gentoo
1 commit: 27474f966c5c419ea4fd3a7cb050071d0f9d84c6
2 Author: Raymond Wong <infiwang <AT> pm <DOT> me>
3 AuthorDate: Sun May 8 15:57:29 2022 +0000
4 Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
5 CommitDate: Sun May 8 19:27:55 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27474f96
7
8 dev-libs/ffcall-2.4: add vacall PIC support for Linux/riscv
9
10 Patch is already done upstream, drop on next version bump.
11
12 Closes: https://bugs.gentoo.org/842915
13 Signed-off-by: Raymond Wong <infiwang <AT> pm.me>
14 Closes: https://github.com/gentoo/gentoo/pull/25388
15 Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
16
17 dev-libs/ffcall/ffcall-2.4.ebuild | 7 +-
18 .../ffcall/files/ffcall-2.4-vacall-riscv-pic.patch | 792 +++++++++++++++++++++
19 2 files changed, 798 insertions(+), 1 deletion(-)
20
21 diff --git a/dev-libs/ffcall/ffcall-2.4.ebuild b/dev-libs/ffcall/ffcall-2.4.ebuild
22 index 9e5e111bec68..8a30bf885b1d 100644
23 --- a/dev-libs/ffcall/ffcall-2.4.ebuild
24 +++ b/dev-libs/ffcall/ffcall-2.4.ebuild
25 @@ -19,6 +19,11 @@ LICENSE="GPL-2+"
26 SLOT="0"
27 KEYWORDS="~alpha amd64 ~arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
28
29 +PATCHES=(
30 + # bug 842915, drop on next version bump
31 + "${FILESDIR}"/${PN}-2.4-vacall-riscv-pic.patch
32 +)
33 +
34 src_prepare() {
35 # The build system is a strange mix of autogenerated
36 # files and manual tweaks on top. Uses $CFLAGS / $LDFLAGS randomly.
37 @@ -33,7 +38,7 @@ src_prepare() {
38 -i "${mfi}" || die
39 done
40
41 - eapply_user
42 + default
43 }
44
45 src_configure() {
46
47 diff --git a/dev-libs/ffcall/files/ffcall-2.4-vacall-riscv-pic.patch b/dev-libs/ffcall/files/ffcall-2.4-vacall-riscv-pic.patch
48 new file mode 100644
49 index 000000000000..2bad9a403997
50 --- /dev/null
51 +++ b/dev-libs/ffcall/files/ffcall-2.4-vacall-riscv-pic.patch
52 @@ -0,0 +1,792 @@
53 +https://bugs.gentoo.org/842915
54 +Taken from https://alpha.gnu.org/gnu/libffcall/libffcall-2.4-20220508.tar.gz
55 +
56 +diff -ruN libffcall-2.4/vacall/Makefile.devel libffcall-2.4-20220508/vacall/Makefile.devel
57 +--- libffcall-2.4/vacall/Makefile.devel 2021-06-12 23:11:57.000000000 +0800
58 ++++ libffcall-2.4-20220508/vacall/Makefile.devel 2022-05-08 23:28:37.266397740 +0800
59 +@@ -267,15 +267,21 @@
60 + vacall-riscv32-ilp32d-linux.s : vacall-riscv32.c vacall-internal.h vacall.h $(THISFILE)
61 + $(CROSS_TOOL) riscv32-linux gcc-7.3.0 $(GCCFLAGS) -D__riscv32__ -S vacall-riscv32.c -o vacall-riscv32-ilp32d-linux.s
62 +
63 +-vacall-riscv32-ilp32d-macro.S : vacall-riscv32-ilp32d-linux.s ../common/asm-riscv.sh ../common/noexecstack.h $(THISFILE)
64 +- (../common/asm-riscv.sh < vacall-riscv32-ilp32d-linux.s ; cat ../common/noexecstack.h) > vacall-riscv32-ilp32d-macro.S
65 ++vacall-riscv32-ilp32d-linux-pic.s : vacall-riscv32.c vacall-internal.h vacall.h $(THISFILE)
66 ++ $(CROSS_TOOL) riscv32-linux gcc-7.3.0 $(GCCFLAGS) -fPIC -D__riscv32__ -S vacall-riscv32.c -o vacall-riscv32-ilp32d-linux-pic.s
67 ++
68 ++vacall-riscv32-ilp32d-macro.S : vacall-riscv32-ilp32d-linux.s vacall-riscv32-ilp32d-linux-pic.s ../common/asm-riscv.sh ../common/noexecstack.h $(THISFILE)
69 ++ (echo '#ifdef __PIC__' ; ../common/asm-riscv.sh < vacall-riscv32-ilp32d-linux-pic.s ; echo '#else' ; ../common/asm-riscv.sh < vacall-riscv32-ilp32d-linux.s ; echo '#endif' ; cat ../common/noexecstack.h) > vacall-riscv32-ilp32d-macro.S
70 +
71 +
72 + vacall-riscv64-lp64d-linux.s : vacall-riscv64.c vacall-internal.h vacall.h $(THISFILE)
73 + $(CROSS_TOOL) riscv64-linux gcc-7.3.0 $(GCCFLAGS) -D__riscv64__ -S vacall-riscv64.c -o vacall-riscv64-lp64d-linux.s
74 +
75 +-vacall-riscv64-lp64d-macro.S : vacall-riscv64-lp64d-linux.s ../common/asm-riscv.sh ../common/noexecstack.h $(THISFILE)
76 +- (../common/asm-riscv.sh < vacall-riscv64-lp64d-linux.s ; cat ../common/noexecstack.h) > vacall-riscv64-lp64d-macro.S
77 ++vacall-riscv64-lp64d-linux-pic.s : vacall-riscv64.c vacall-internal.h vacall.h $(THISFILE)
78 ++ $(CROSS_TOOL) riscv64-linux gcc-7.3.0 $(GCCFLAGS) -fPIC -D__riscv64__ -S vacall-riscv64.c -o vacall-riscv64-lp64d-linux-pic.s
79 ++
80 ++vacall-riscv64-lp64d-macro.S : vacall-riscv64-lp64d-linux.s vacall-riscv64-lp64d-linux-pic.s ../common/asm-riscv.sh ../common/noexecstack.h $(THISFILE)
81 ++ (echo '#ifdef __PIC__' ; ../common/asm-riscv.sh < vacall-riscv64-lp64d-linux-pic.s ; echo '#else' ; ../common/asm-riscv.sh < vacall-riscv64-lp64d-linux.s ; echo '#endif' ; cat ../common/noexecstack.h) > vacall-riscv64-lp64d-macro.S
82 +
83 +
84 + # --------------- Rules for debugging test failures ---------------
85 +diff -ruN libffcall-2.4/vacall/Makefile.in libffcall-2.4-20220508/vacall/Makefile.in
86 +--- libffcall-2.4/vacall/Makefile.in 2021-06-12 23:11:57.000000000 +0800
87 ++++ libffcall-2.4-20220508/vacall/Makefile.in 2022-05-08 23:29:18.347087098 +0800
88 +@@ -354,8 +354,8 @@
89 + vacall-powerpc-aix.s \
90 + vacall-powerpc-linux.s vacall-powerpc-linux-macro.S vacall-powerpc-macos.s vacall-powerpc-sysv4-macro.S \
91 + vacall-powerpc64.c vacall-powerpc64-aix.s vacall-powerpc64-linux.S vacall-powerpc64-elfv2-linux.S \
92 +- vacall-riscv32.c vacall-riscv32-ilp32d-linux.s vacall-riscv32-ilp32d-macro.S \
93 +- vacall-riscv64.c vacall-riscv64-lp64d-linux.s vacall-riscv64-lp64d-macro.S \
94 ++ vacall-riscv32.c vacall-riscv32-ilp32d-linux.s vacall-riscv32-ilp32d-linux-pic.s vacall-riscv32-ilp32d-macro.S \
95 ++ vacall-riscv64.c vacall-riscv64-lp64d-linux.s vacall-riscv64-lp64d-linux-pic.s vacall-riscv64-lp64d-macro.S \
96 + vacall-s390.c vacall-s390-linux.s vacall-s390-macro.S \
97 + vacall-s390x.c vacall-s390x-linux.s vacall-s390x-macro.S \
98 + vacall-sparc.c vacall-sparc-linux.s vacall-sparc-linux-pic.s vacall-sparc-macro.S \
99 +diff -ruN libffcall-2.4/vacall/vacall-riscv32-ilp32d-linux-pic.s libffcall-2.4-20220508/vacall/vacall-riscv32-ilp32d-linux-pic.s
100 +--- libffcall-2.4/vacall/vacall-riscv32-ilp32d-linux-pic.s 1970-01-01 08:00:00.000000000 +0800
101 ++++ libffcall-2.4-20220508/vacall/vacall-riscv32-ilp32d-linux-pic.s 2022-05-08 19:41:49.000000000 +0800
102 +@@ -0,0 +1,163 @@
103 ++ .file "vacall-riscv32.c"
104 ++ .option pic
105 ++ .text
106 ++ .align 1
107 ++ .globl vacall_receiver
108 ++ .type vacall_receiver, @function
109 ++vacall_receiver:
110 ++ add sp,sp,-208
111 ++ sw ra,188(sp)
112 ++ sw s0,184(sp)
113 ++ add s0,sp,192
114 ++ la t1,vacall_function
115 ++ lw t1,0(t1)
116 ++ sw a0,-148(s0)
117 ++ add a0,s0,16
118 ++ sw a7,12(s0)
119 ++ sw a1,-144(s0)
120 ++ sw a2,-140(s0)
121 ++ sw a3,-136(s0)
122 ++ sw a4,-132(s0)
123 ++ sw a5,-128(s0)
124 ++ sw a6,-124(s0)
125 ++ sw a7,-120(s0)
126 ++ fsw fa0,-112(s0)
127 ++ fsw fa1,-108(s0)
128 ++ fsw fa2,-104(s0)
129 ++ fsw fa3,-100(s0)
130 ++ fsw fa4,-96(s0)
131 ++ fsw fa5,-92(s0)
132 ++ fsw fa6,-88(s0)
133 ++ fsw fa7,-84(s0)
134 ++ fsd fa0,-80(s0)
135 ++ fsd fa1,-72(s0)
136 ++ fsd fa2,-64(s0)
137 ++ fsd fa3,-56(s0)
138 ++ fsd fa4,-48(s0)
139 ++ fsd fa5,-40(s0)
140 ++ fsd fa6,-32(s0)
141 ++ fsd fa7,-24(s0)
142 ++ sw a0,-168(s0)
143 ++ sw zero,-184(s0)
144 ++ sw zero,-164(s0)
145 ++ sw zero,-160(s0)
146 ++ add a0,s0,-184
147 ++ sw zero,-152(s0)
148 ++ sw zero,-116(s0)
149 ++ jalr t1
150 ++ lw t1,-160(s0)
151 ++ beqz t1,.L1
152 ++ li t3,1
153 ++ beq t1,t3,.L22
154 ++ li t3,2
155 ++ beq t1,t3,.L25
156 ++ li t3,3
157 ++ beq t1,t3,.L22
158 ++ li t3,4
159 ++ beq t1,t3,.L26
160 ++ li t3,5
161 ++ beq t1,t3,.L27
162 ++ li t3,6
163 ++ beq t1,t3,.L23
164 ++ li t3,7
165 ++ beq t1,t3,.L23
166 ++ li t3,8
167 ++ beq t1,t3,.L23
168 ++ li t3,9
169 ++ beq t1,t3,.L23
170 ++ add t3,t1,-10
171 ++ li t4,1
172 ++ bleu t3,t4,.L28
173 ++ li t3,12
174 ++ beq t1,t3,.L29
175 ++ li t3,13
176 ++ beq t1,t3,.L30
177 ++ li t3,14
178 ++ beq t1,t3,.L23
179 ++ li t3,15
180 ++ bne t1,t3,.L1
181 ++ lw t1,-184(s0)
182 ++ and t1,t1,2
183 ++ beqz t1,.L1
184 ++ lw t3,-156(s0)
185 ++ li t1,7
186 ++ add t5,t3,-1
187 ++ bgtu t5,t1,.L1
188 ++ lw t1,-164(s0)
189 ++ lbu t5,0(t1)
190 ++ mv a0,t5
191 ++ beq t3,t4,.L1
192 ++ lbu t4,1(t1)
193 ++ li t6,2
194 ++ sll t4,t4,8
195 ++ or t5,t4,t5
196 ++ mv a0,t5
197 ++ beq t3,t6,.L1
198 ++ lbu t4,2(t1)
199 ++ li t6,3
200 ++ sll t4,t4,16
201 ++ or t4,t4,t5
202 ++ mv a0,t4
203 ++ beq t3,t6,.L1
204 ++ lbu a0,3(t1)
205 ++ li t5,4
206 ++ sll a0,a0,24
207 ++ or a0,a0,t4
208 ++ beq t3,t5,.L1
209 ++ lbu t5,4(t1)
210 ++ li t4,5
211 ++ mv a1,t5
212 ++ beq t3,t4,.L1
213 ++ lbu t4,5(t1)
214 ++ li t6,6
215 ++ sll t4,t4,8
216 ++ or t5,t4,t5
217 ++ mv a1,t5
218 ++ beq t3,t6,.L1
219 ++ lbu t4,6(t1)
220 ++ li t6,8
221 ++ sll t4,t4,16
222 ++ or t4,t4,t5
223 ++ mv a1,t4
224 ++ bne t3,t6,.L1
225 ++ lbu a1,7(t1)
226 ++ sll a1,a1,24
227 ++ or a1,a1,t4
228 ++.L1:
229 ++ lw ra,188(sp)
230 ++ lw s0,184(sp)
231 ++ add sp,sp,208
232 ++ jr ra
233 ++.L22:
234 ++ lbu a0,-176(s0)
235 ++ lw ra,188(sp)
236 ++ lw s0,184(sp)
237 ++ add sp,sp,208
238 ++ jr ra
239 ++.L23:
240 ++ lw a0,-176(s0)
241 ++ j .L1
242 ++.L25:
243 ++ lb a0,-176(s0)
244 ++ lw ra,188(sp)
245 ++ lw s0,184(sp)
246 ++ add sp,sp,208
247 ++ jr ra
248 ++.L26:
249 ++ lh a0,-176(s0)
250 ++ j .L1
251 ++.L27:
252 ++ lhu a0,-176(s0)
253 ++ j .L1
254 ++.L28:
255 ++ lw a0,-176(s0)
256 ++ lw a1,-172(s0)
257 ++ j .L1
258 ++.L29:
259 ++ flw fa0,-176(s0)
260 ++ j .L1
261 ++.L30:
262 ++ fld fa0,-176(s0)
263 ++ j .L1
264 ++ .size vacall_receiver, .-vacall_receiver
265 ++ .ident "GCC: (GNU) 7.3.0"
266 +diff -ruN libffcall-2.4/vacall/vacall-riscv32-ilp32d-macro.S libffcall-2.4-20220508/vacall/vacall-riscv32-ilp32d-macro.S
267 +--- libffcall-2.4/vacall/vacall-riscv32-ilp32d-macro.S 2021-06-13 02:30:16.000000000 +0800
268 ++++ libffcall-2.4-20220508/vacall/vacall-riscv32-ilp32d-macro.S 2022-05-08 19:41:49.000000000 +0800
269 +@@ -1,3 +1,167 @@
270 ++#ifdef __PIC__
271 ++ .file "vacall-riscv32.c"
272 ++ .option pic
273 ++ .text
274 ++ .align 1
275 ++ .globl vacall_receiver
276 ++ .type vacall_receiver, @function
277 ++vacall_receiver:
278 ++ add sp,sp,-208
279 ++ sw ra,188(sp)
280 ++ sw s0,184(sp)
281 ++ add s0,sp,192
282 ++ la t1,vacall_function
283 ++ lw t1,0(t1)
284 ++ sw a0,-148(s0)
285 ++ add a0,s0,16
286 ++ sw a7,12(s0)
287 ++ sw a1,-144(s0)
288 ++ sw a2,-140(s0)
289 ++ sw a3,-136(s0)
290 ++ sw a4,-132(s0)
291 ++ sw a5,-128(s0)
292 ++ sw a6,-124(s0)
293 ++ sw a7,-120(s0)
294 ++ fsw fa0,-112(s0)
295 ++ fsw fa1,-108(s0)
296 ++ fsw fa2,-104(s0)
297 ++ fsw fa3,-100(s0)
298 ++ fsw fa4,-96(s0)
299 ++ fsw fa5,-92(s0)
300 ++ fsw fa6,-88(s0)
301 ++ fsw fa7,-84(s0)
302 ++ fsd fa0,-80(s0)
303 ++ fsd fa1,-72(s0)
304 ++ fsd fa2,-64(s0)
305 ++ fsd fa3,-56(s0)
306 ++ fsd fa4,-48(s0)
307 ++ fsd fa5,-40(s0)
308 ++ fsd fa6,-32(s0)
309 ++ fsd fa7,-24(s0)
310 ++ sw a0,-168(s0)
311 ++ sw zero,-184(s0)
312 ++ sw zero,-164(s0)
313 ++ sw zero,-160(s0)
314 ++ add a0,s0,-184
315 ++ sw zero,-152(s0)
316 ++ sw zero,-116(s0)
317 ++ jalr t1
318 ++ lw t1,-160(s0)
319 ++ beqz t1,.L1
320 ++ li t3,1
321 ++ beq t1,t3,.L22
322 ++ li t3,2
323 ++ beq t1,t3,.L25
324 ++ li t3,3
325 ++ beq t1,t3,.L22
326 ++ li t3,4
327 ++ beq t1,t3,.L26
328 ++ li t3,5
329 ++ beq t1,t3,.L27
330 ++ li t3,6
331 ++ beq t1,t3,.L23
332 ++ li t3,7
333 ++ beq t1,t3,.L23
334 ++ li t3,8
335 ++ beq t1,t3,.L23
336 ++ li t3,9
337 ++ beq t1,t3,.L23
338 ++ add t3,t1,-10
339 ++ li t4,1
340 ++ bleu t3,t4,.L28
341 ++ li t3,12
342 ++ beq t1,t3,.L29
343 ++ li t3,13
344 ++ beq t1,t3,.L30
345 ++ li t3,14
346 ++ beq t1,t3,.L23
347 ++ li t3,15
348 ++ bne t1,t3,.L1
349 ++ lw t1,-184(s0)
350 ++ and t1,t1,2
351 ++ beqz t1,.L1
352 ++ lw t3,-156(s0)
353 ++ li t1,7
354 ++ add t5,t3,-1
355 ++ bgtu t5,t1,.L1
356 ++ lw t1,-164(s0)
357 ++ lbu t5,0(t1)
358 ++ mv a0,t5
359 ++ beq t3,t4,.L1
360 ++ lbu t4,1(t1)
361 ++ li t6,2
362 ++ sll t4,t4,8
363 ++ or t5,t4,t5
364 ++ mv a0,t5
365 ++ beq t3,t6,.L1
366 ++ lbu t4,2(t1)
367 ++ li t6,3
368 ++ sll t4,t4,16
369 ++ or t4,t4,t5
370 ++ mv a0,t4
371 ++ beq t3,t6,.L1
372 ++ lbu a0,3(t1)
373 ++ li t5,4
374 ++ sll a0,a0,24
375 ++ or a0,a0,t4
376 ++ beq t3,t5,.L1
377 ++ lbu t5,4(t1)
378 ++ li t4,5
379 ++ mv a1,t5
380 ++ beq t3,t4,.L1
381 ++ lbu t4,5(t1)
382 ++ li t6,6
383 ++ sll t4,t4,8
384 ++ or t5,t4,t5
385 ++ mv a1,t5
386 ++ beq t3,t6,.L1
387 ++ lbu t4,6(t1)
388 ++ li t6,8
389 ++ sll t4,t4,16
390 ++ or t4,t4,t5
391 ++ mv a1,t4
392 ++ bne t3,t6,.L1
393 ++ lbu a1,7(t1)
394 ++ sll a1,a1,24
395 ++ or a1,a1,t4
396 ++.L1:
397 ++ lw ra,188(sp)
398 ++ lw s0,184(sp)
399 ++ add sp,sp,208
400 ++ jr ra
401 ++.L22:
402 ++ lbu a0,-176(s0)
403 ++ lw ra,188(sp)
404 ++ lw s0,184(sp)
405 ++ add sp,sp,208
406 ++ jr ra
407 ++.L23:
408 ++ lw a0,-176(s0)
409 ++ j .L1
410 ++.L25:
411 ++ lb a0,-176(s0)
412 ++ lw ra,188(sp)
413 ++ lw s0,184(sp)
414 ++ add sp,sp,208
415 ++ jr ra
416 ++.L26:
417 ++ lh a0,-176(s0)
418 ++ j .L1
419 ++.L27:
420 ++ lhu a0,-176(s0)
421 ++ j .L1
422 ++.L28:
423 ++ lw a0,-176(s0)
424 ++ lw a1,-172(s0)
425 ++ j .L1
426 ++.L29:
427 ++ flw fa0,-176(s0)
428 ++ j .L1
429 ++.L30:
430 ++ fld fa0,-176(s0)
431 ++ j .L1
432 ++ .size vacall_receiver, .-vacall_receiver
433 ++#else
434 + .file "vacall-riscv32.c"
435 + .option nopic
436 + .text
437 +@@ -160,6 +324,7 @@
438 + fld fa0,-176(s0)
439 + j .L1
440 + .size vacall_receiver, .-vacall_receiver
441 ++#endif
442 + #if defined __linux__ || defined __FreeBSD__ || defined __FreeBSD_kernel__ || defined __DragonFly__
443 + .section .note.GNU-stack,"",@progbits
444 + #endif
445 +diff -ruN libffcall-2.4/vacall/vacall-riscv64-lp64d-linux-pic.s libffcall-2.4-20220508/vacall/vacall-riscv64-lp64d-linux-pic.s
446 +--- libffcall-2.4/vacall/vacall-riscv64-lp64d-linux-pic.s 1970-01-01 08:00:00.000000000 +0800
447 ++++ libffcall-2.4-20220508/vacall/vacall-riscv64-lp64d-linux-pic.s 2022-05-08 19:41:49.000000000 +0800
448 +@@ -0,0 +1,190 @@
449 ++ .file "vacall-riscv64.c"
450 ++ .option pic
451 ++ .text
452 ++ .align 1
453 ++ .globl vacall_receiver
454 ++ .type vacall_receiver, @function
455 ++vacall_receiver:
456 ++ add sp,sp,-288
457 ++ sd ra,264(sp)
458 ++ sd s0,256(sp)
459 ++ sd s1,248(sp)
460 ++ add s0,sp,272
461 ++ la t1,vacall_function
462 ++ ld t1,0(t1)
463 ++ sd a0,-200(s0)
464 ++ add a0,s0,16
465 ++ sd a7,8(s0)
466 ++ sd a1,-192(s0)
467 ++ sd a2,-184(s0)
468 ++ sd a3,-176(s0)
469 ++ sd a4,-168(s0)
470 ++ sd a5,-160(s0)
471 ++ sd a6,-152(s0)
472 ++ sd a7,-144(s0)
473 ++ fsw fa0,-132(s0)
474 ++ fsw fa1,-128(s0)
475 ++ fsw fa2,-124(s0)
476 ++ fsw fa3,-120(s0)
477 ++ fsw fa4,-116(s0)
478 ++ fsw fa5,-112(s0)
479 ++ fsw fa6,-108(s0)
480 ++ fsw fa7,-104(s0)
481 ++ fsd fa0,-96(s0)
482 ++ fsd fa1,-88(s0)
483 ++ fsd fa2,-80(s0)
484 ++ fsd fa3,-72(s0)
485 ++ fsd fa4,-64(s0)
486 ++ fsd fa5,-56(s0)
487 ++ fsd fa6,-48(s0)
488 ++ fsd fa7,-40(s0)
489 ++ sd a0,-240(s0)
490 ++ sw zero,-264(s0)
491 ++ sd zero,-232(s0)
492 ++ add a0,s0,-264
493 ++ sw zero,-224(s0)
494 ++ sw zero,-208(s0)
495 ++ sw zero,-136(s0)
496 ++ jalr t1
497 ++ lw t1,-224(s0)
498 ++ beqz t1,.L1
499 ++ li t3,1
500 ++ beq t1,t3,.L25
501 ++ li t3,2
502 ++ beq t1,t3,.L29
503 ++ li t3,3
504 ++ beq t1,t3,.L25
505 ++ li t3,4
506 ++ beq t1,t3,.L30
507 ++ li t3,5
508 ++ beq t1,t3,.L31
509 ++ li t3,6
510 ++ beq t1,t3,.L32
511 ++ li t3,7
512 ++ beq t1,t3,.L33
513 ++ and t3,t1,-3
514 ++ li t4,8
515 ++ beq t3,t4,.L27
516 ++ li t4,9
517 ++ beq t3,t4,.L27
518 ++ li t3,12
519 ++ beq t1,t3,.L34
520 ++ li t3,13
521 ++ beq t1,t3,.L35
522 ++ li t3,14
523 ++ beq t1,t3,.L27
524 ++ li t3,15
525 ++ bne t1,t3,.L1
526 ++ lw t3,-264(s0)
527 ++ and t3,t3,1024
528 ++ beqz t3,.L1
529 ++ ld t0,-216(s0)
530 ++ add t3,t0,-1
531 ++ bgtu t3,t1,.L1
532 ++ ld t5,-232(s0)
533 ++ li s1,8
534 ++ and t6,t5,7
535 ++ add t2,t0,t6
536 ++ and t5,t5,-8
537 ++ sext.w t6,t6
538 ++ sllw t1,t2,3
539 ++ ld t4,0(t5)
540 ++ sll t3,t6,3
541 ++ bgtu t0,s1,.L15
542 ++ bgtu t2,s1,.L16
543 ++ addw t1,t1,-1
544 ++ li a0,2
545 ++ sll a0,a0,t1
546 ++ add a0,a0,-1
547 ++ and a0,a0,t4
548 ++ sra a0,a0,t3
549 ++.L1:
550 ++ ld ra,264(sp)
551 ++ ld s0,256(sp)
552 ++ ld s1,248(sp)
553 ++ add sp,sp,288
554 ++ jr ra
555 ++.L25:
556 ++ lbu a0,-256(s0)
557 ++ ld ra,264(sp)
558 ++ ld s0,256(sp)
559 ++ ld s1,248(sp)
560 ++ add sp,sp,288
561 ++ jr ra
562 ++.L29:
563 ++ lb a0,-256(s0)
564 ++ ld ra,264(sp)
565 ++ ld s0,256(sp)
566 ++ ld s1,248(sp)
567 ++ add sp,sp,288
568 ++ jr ra
569 ++.L30:
570 ++ lh a0,-256(s0)
571 ++ j .L1
572 ++.L33:
573 ++ lwu a0,-256(s0)
574 ++ j .L1
575 ++.L31:
576 ++ lhu a0,-256(s0)
577 ++ j .L1
578 ++.L27:
579 ++ ld a0,-256(s0)
580 ++ j .L1
581 ++.L32:
582 ++ lw a0,-256(s0)
583 ++ j .L1
584 ++.L34:
585 ++ flw fa0,-256(s0)
586 ++ j .L1
587 ++.L35:
588 ++ fld fa0,-256(s0)
589 ++ j .L1
590 ++.L15:
591 ++ li s1,16
592 ++ sra t4,t4,t3
593 ++ ld t0,8(t5)
594 ++ bleu t2,s1,.L36
595 ++ li a1,-8
596 ++ mulw t6,a1,t6
597 ++ addw t1,t1,-129
598 ++ ld a0,16(t5)
599 ++ li a1,2
600 ++ sll a1,a1,t1
601 ++ add a1,a1,-1
602 ++ and a1,a1,a0
603 ++ sra t3,t0,t3
604 ++ addw t1,t6,64
605 ++ sll a0,t0,t1
606 ++ sll a1,a1,t1
607 ++ or a0,a0,t4
608 ++ or a1,a1,t3
609 ++ j .L1
610 ++.L16:
611 ++ li a0,-8
612 ++ mulw t6,a0,t6
613 ++ addw t1,t1,-65
614 ++ ld t5,8(t5)
615 ++ li a0,2
616 ++ sll a0,a0,t1
617 ++ add a0,a0,-1
618 ++ and a0,a0,t5
619 ++ sra t4,t4,t3
620 ++ sll a0,a0,t6
621 ++ or a0,a0,t4
622 ++ j .L1
623 ++.L36:
624 ++ li a1,-4
625 ++ mulw t6,a1,t6
626 ++ addw t1,t1,-65
627 ++ li a0,2
628 ++ sll a0,a0,t1
629 ++ add a0,a0,-1
630 ++ and a0,a0,t0
631 ++ sra a1,a0,t3
632 ++ addw t1,t6,32
633 ++ sll a0,a0,t1
634 ++ sll a0,a0,t1
635 ++ or a0,a0,t4
636 ++ j .L1
637 ++ .size vacall_receiver, .-vacall_receiver
638 ++ .ident "GCC: (GNU) 7.3.0"
639 +diff -ruN libffcall-2.4/vacall/vacall-riscv64-lp64d-macro.S libffcall-2.4-20220508/vacall/vacall-riscv64-lp64d-macro.S
640 +--- libffcall-2.4/vacall/vacall-riscv64-lp64d-macro.S 2021-06-13 02:30:16.000000000 +0800
641 ++++ libffcall-2.4-20220508/vacall/vacall-riscv64-lp64d-macro.S 2022-05-08 19:41:49.000000000 +0800
642 +@@ -1,3 +1,194 @@
643 ++#ifdef __PIC__
644 ++ .file "vacall-riscv64.c"
645 ++ .option pic
646 ++ .text
647 ++ .align 1
648 ++ .globl vacall_receiver
649 ++ .type vacall_receiver, @function
650 ++vacall_receiver:
651 ++ add sp,sp,-288
652 ++ sd ra,264(sp)
653 ++ sd s0,256(sp)
654 ++ sd s1,248(sp)
655 ++ add s0,sp,272
656 ++ la t1,vacall_function
657 ++ ld t1,0(t1)
658 ++ sd a0,-200(s0)
659 ++ add a0,s0,16
660 ++ sd a7,8(s0)
661 ++ sd a1,-192(s0)
662 ++ sd a2,-184(s0)
663 ++ sd a3,-176(s0)
664 ++ sd a4,-168(s0)
665 ++ sd a5,-160(s0)
666 ++ sd a6,-152(s0)
667 ++ sd a7,-144(s0)
668 ++ fsw fa0,-132(s0)
669 ++ fsw fa1,-128(s0)
670 ++ fsw fa2,-124(s0)
671 ++ fsw fa3,-120(s0)
672 ++ fsw fa4,-116(s0)
673 ++ fsw fa5,-112(s0)
674 ++ fsw fa6,-108(s0)
675 ++ fsw fa7,-104(s0)
676 ++ fsd fa0,-96(s0)
677 ++ fsd fa1,-88(s0)
678 ++ fsd fa2,-80(s0)
679 ++ fsd fa3,-72(s0)
680 ++ fsd fa4,-64(s0)
681 ++ fsd fa5,-56(s0)
682 ++ fsd fa6,-48(s0)
683 ++ fsd fa7,-40(s0)
684 ++ sd a0,-240(s0)
685 ++ sw zero,-264(s0)
686 ++ sd zero,-232(s0)
687 ++ add a0,s0,-264
688 ++ sw zero,-224(s0)
689 ++ sw zero,-208(s0)
690 ++ sw zero,-136(s0)
691 ++ jalr t1
692 ++ lw t1,-224(s0)
693 ++ beqz t1,.L1
694 ++ li t3,1
695 ++ beq t1,t3,.L25
696 ++ li t3,2
697 ++ beq t1,t3,.L29
698 ++ li t3,3
699 ++ beq t1,t3,.L25
700 ++ li t3,4
701 ++ beq t1,t3,.L30
702 ++ li t3,5
703 ++ beq t1,t3,.L31
704 ++ li t3,6
705 ++ beq t1,t3,.L32
706 ++ li t3,7
707 ++ beq t1,t3,.L33
708 ++ and t3,t1,-3
709 ++ li t4,8
710 ++ beq t3,t4,.L27
711 ++ li t4,9
712 ++ beq t3,t4,.L27
713 ++ li t3,12
714 ++ beq t1,t3,.L34
715 ++ li t3,13
716 ++ beq t1,t3,.L35
717 ++ li t3,14
718 ++ beq t1,t3,.L27
719 ++ li t3,15
720 ++ bne t1,t3,.L1
721 ++ lw t3,-264(s0)
722 ++ and t3,t3,1024
723 ++ beqz t3,.L1
724 ++ ld t0,-216(s0)
725 ++ add t3,t0,-1
726 ++ bgtu t3,t1,.L1
727 ++ ld t5,-232(s0)
728 ++ li s1,8
729 ++ and t6,t5,7
730 ++ add t2,t0,t6
731 ++ and t5,t5,-8
732 ++ sext.w t6,t6
733 ++ sllw t1,t2,3
734 ++ ld t4,0(t5)
735 ++ sll t3,t6,3
736 ++ bgtu t0,s1,.L15
737 ++ bgtu t2,s1,.L16
738 ++ addw t1,t1,-1
739 ++ li a0,2
740 ++ sll a0,a0,t1
741 ++ add a0,a0,-1
742 ++ and a0,a0,t4
743 ++ sra a0,a0,t3
744 ++.L1:
745 ++ ld ra,264(sp)
746 ++ ld s0,256(sp)
747 ++ ld s1,248(sp)
748 ++ add sp,sp,288
749 ++ jr ra
750 ++.L25:
751 ++ lbu a0,-256(s0)
752 ++ ld ra,264(sp)
753 ++ ld s0,256(sp)
754 ++ ld s1,248(sp)
755 ++ add sp,sp,288
756 ++ jr ra
757 ++.L29:
758 ++ lb a0,-256(s0)
759 ++ ld ra,264(sp)
760 ++ ld s0,256(sp)
761 ++ ld s1,248(sp)
762 ++ add sp,sp,288
763 ++ jr ra
764 ++.L30:
765 ++ lh a0,-256(s0)
766 ++ j .L1
767 ++.L33:
768 ++ lwu a0,-256(s0)
769 ++ j .L1
770 ++.L31:
771 ++ lhu a0,-256(s0)
772 ++ j .L1
773 ++.L27:
774 ++ ld a0,-256(s0)
775 ++ j .L1
776 ++.L32:
777 ++ lw a0,-256(s0)
778 ++ j .L1
779 ++.L34:
780 ++ flw fa0,-256(s0)
781 ++ j .L1
782 ++.L35:
783 ++ fld fa0,-256(s0)
784 ++ j .L1
785 ++.L15:
786 ++ li s1,16
787 ++ sra t4,t4,t3
788 ++ ld t0,8(t5)
789 ++ bleu t2,s1,.L36
790 ++ li a1,-8
791 ++ mulw t6,a1,t6
792 ++ addw t1,t1,-129
793 ++ ld a0,16(t5)
794 ++ li a1,2
795 ++ sll a1,a1,t1
796 ++ add a1,a1,-1
797 ++ and a1,a1,a0
798 ++ sra t3,t0,t3
799 ++ addw t1,t6,64
800 ++ sll a0,t0,t1
801 ++ sll a1,a1,t1
802 ++ or a0,a0,t4
803 ++ or a1,a1,t3
804 ++ j .L1
805 ++.L16:
806 ++ li a0,-8
807 ++ mulw t6,a0,t6
808 ++ addw t1,t1,-65
809 ++ ld t5,8(t5)
810 ++ li a0,2
811 ++ sll a0,a0,t1
812 ++ add a0,a0,-1
813 ++ and a0,a0,t5
814 ++ sra t4,t4,t3
815 ++ sll a0,a0,t6
816 ++ or a0,a0,t4
817 ++ j .L1
818 ++.L36:
819 ++ li a1,-4
820 ++ mulw t6,a1,t6
821 ++ addw t1,t1,-65
822 ++ li a0,2
823 ++ sll a0,a0,t1
824 ++ add a0,a0,-1
825 ++ and a0,a0,t0
826 ++ sra a1,a0,t3
827 ++ addw t1,t6,32
828 ++ sll a0,a0,t1
829 ++ sll a0,a0,t1
830 ++ or a0,a0,t4
831 ++ j .L1
832 ++ .size vacall_receiver, .-vacall_receiver
833 ++#else
834 + .file "vacall-riscv64.c"
835 + .option nopic
836 + .text
837 +@@ -187,6 +378,7 @@
838 + or a0,a0,t4
839 + j .L1
840 + .size vacall_receiver, .-vacall_receiver
841 ++#endif
842 + #if defined __linux__ || defined __FreeBSD__ || defined __FreeBSD_kernel__ || defined __DragonFly__
843 + .section .note.GNU-stack,"",@progbits
844 + #endif