This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
forked from libffi/libffi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
15095 lines (10187 loc) · 469 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
commit 3d0ce1e6fcf19f853894862abcbac0ae78a7be60
Author: Anthony Green <green@moxielogic.org>
Date: Sun Feb 18 09:22:51 2024 -0500
chore: update version to 3.4.6 and fix long double regression on mips64 and alpha
commit 94eaedb40e67e26d2fa35d1c22d8818f4d9f4c2d
Author: Anthony Green <green@moxielogic.org>
Date: Sun Feb 18 08:41:04 2024 -0500
Update sparc64 host
commit e1dcf03b4642e75a1058799a3023e0ebd0024258
Author: Anthony Green <green@moxielogic.org>
Date: Sun Feb 18 08:02:45 2024 -0500
Update cfarm hostnames
commit cd78b539125ae615d76df5a57039fe70ebd56c27
Author: Anthony Green <green@moxielogic.org>
Date: Sun Feb 18 07:48:51 2024 -0500
Always define long double types.
commit 012fcaf96c87ab617ba34babce9b6b259188fcf0
Author: Anthony Green <green@moxielogic.org>
Date: Thu Feb 15 08:35:02 2024 -0500
Update
commit d1597239af492240770692b8e453f0dca70fc551
Author: Anthony Green <green@moxielogic.org>
Date: Thu Feb 15 08:32:42 2024 -0500
update copyright year in libffi.texi
commit 91739a1a912476adbf1e0e4dcb091b9a2c5007d9
Author: Anthony Green <green@moxielogic.org>
Date: Thu Feb 15 08:30:09 2024 -0500
Update version, copyright and testsuite info.
commit 9752a622d12e696eaf9a4c46d4f09b58bca6bb83
Author: Anthony Green <green@moxielogic.org>
Date: Thu Feb 15 08:03:21 2024 -0500
Fix test filename reference
commit 404355317b3314da14a9ead0c0a50c040212e1fc
Author: Anthony Green <green@moxielogic.org>
Date: Thu Feb 15 08:01:43 2024 -0500
docs(README): update release details for libffi-3.4.5
commit 04f6fa310ddec494cfcf32fd3685cefe35a8d2a2
Author: Xi Ruoyao <xry111@xry111.site>
Date: Thu Feb 15 20:52:13 2024 +0800
mips: Fix N32 ABI return value handling (#813)
In N32 ABI, 8-bit or 16-bit integers should be extended following the
signedness of the integer, but 32-bit integers should always be
sign-extended to 64-bit (note that N32 ABI only works on 64-bit CPUs).
So handling this in everything using libffi would be nasty. And the
libffi code for architectures with a similar rule (LoongArch & RISC-V)
also properly handle this. Let's do this work in libffi for MIPS N32
too.
This fixes two failures in Python 3.12.1 ctypes test.
commit 00c0c87773910a320d82f026bb481eea31b50206
Author: 杨屿杰 <30362409+scylaac@users.noreply.github.com>
Date: Thu Feb 15 20:51:40 2024 +0800
Fix loongarch64 soft-float build (#816) (#817)
commit b3091029ed85339c856224c243826022ae93c041
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Thu Feb 15 04:51:12 2024 -0800
Emscripten: Don't unbox single element structs if they are larger than 16 bytes (#818)
This arguably is a compensation for a Python ctypes bug / strange behavior
described here:
https://github.com/python/cpython/blob/a16a9f978f42b8a09297c1efbf33877f6388c403/Modules/_ctypes/stgdict.c#L718-L779
If a struct is larger than 16 bytes, Python does not bother to accurately report
its contents figuring that we don't need to know.
commit 98881ecb8eec6d5f2beaaced96d9f625b0dee499
Author: Bill Roberts <152999275+billatarm@users.noreply.github.com>
Date: Thu Feb 15 06:50:40 2024 -0600
aarch64: add BTI flag to ELF notes (#822)
When a program is loaded and linked, the first ELF file that doesn't
declare that BTI is supported in the GNU NOTES section disables BTI
support.
Example:
readelf -n ./aarch64-unknown-linux-gnu/.libs/libffi.so
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI
Fixes: #823
Signed-off-by: Bill Roberts <bill.roberts@arm.com>
commit f9da12e944c947e797e5f3a98f3860c2a0ed055e
Author: Dan Horák <dan@danny.cz>
Date: Thu Feb 15 13:50:13 2024 +0100
don't skip ffi_type_longdouble symbols (#814) (#824)
Seems there are configurations (ppc64 or ppc64le) that define
HAVE_LONG_DOUBLE_VARIANT in fficonfig.h, but do not define
HAVE_LONG_DOUBLE, and still want ffi_type_{,complex_}longdouble
symbols. Update the condition in libffi.map.in accordingly.
commit f8ed78f1b2e65f2741455612d38477424e321850
Author: Xi Ruoyao <xry111@xry111.site>
Date: Thu Feb 15 20:49:27 2024 +0800
LoongArch: Fix a build error with GCC 14 (#825)
Fix the build error with GCC 14:
../src/loongarch64/ffi.c: In function 'ffi_prep_closure_loc':
../src/loongarch64/ffi.c:525:7: error: implicit declaration of
function 'ffi_tramp_set_parms' [-Wimplicit-function-declaration]
commit 0b1dd62bef4192b61153182f7687edf7e885611c
Author: bartoli <perso.olivier.barthelemy@gmail.com>
Date: Thu Feb 1 04:54:57 2024 +0100
Update README.md (#820)
For cygwin/MSVC build, CXXCPP is also needed to pass configure checks
commit c07c40ee9444e029bc595860a669de32b7af282a
Author: Anthony Green <green@moxielogic.org>
Date: Wed Jan 31 22:43:38 2024 -0500
`feat(github-actions): add new build workflow for warp`
commit 622caabcd25f4e11f752241417d06c9062acdf1f
Author: Chongyun Lee <45286352+licy183@users.noreply.github.com>
Date: Sun Dec 24 23:38:32 2023 +0800
Put more optional symbols behind ifdefs (#812)
commit a1c391bd8e604c611c7e9c8f6705dc723d403eb5
Author: Виктор Чернякин <56512186+LocalSpook@users.noreply.github.com>
Date: Fri Dec 22 03:30:50 2023 -0700
Fix a variety of warnings (#811)
commit 3a62a08af7bd0b5d540a087590dc54cdc312416b
Author: Anthony Green <green@moxielogic.org>
Date: Thu Dec 21 15:19:44 2023 -0500
Remove warnings
commit d96fa2117cc6ca2923de9a2f34311ef0219b7590
Author: Anthony Green <green@moxielogic.org>
Date: Thu Dec 21 14:04:19 2023 -0500
Eliminate warning
commit 5b1944b4ce4b03e28a5843d36812756168d66b08
Author: Martin Storsjö <martin@martin.st>
Date: Wed Nov 29 00:38:13 2023 +0200
aarch64: Write the BTI instructions as "hint" instructions (#810)
GNU binutils refuses to assemble the direct BTI instructions unless
the target architecture explicitly supports BTI, ending up with errors
such as
../src/aarch64/sysv.S: Assembler messages:
../src/aarch64/sysv.S:87: Error: selected processor does not support `bti c'
../src/aarch64/sysv.S:156: Error: selected processor does not support `bti j'
Building with -march=armv8.5-a fixes building this.
However, the BTI instructions assemble into hint instructions, that
are ignored by processors that don't implement them. Therefore it is
possible to assemble them for the baseline armv8.0-a target as well,
by replacing "bti j" with "hint #36", "bti c" with "hint #34" and
"bti jc" with "hint #38"; this assembles into the same instruction
bits.
commit 11af2196d5f4e8c756758cf86e4ab79dda89f405
Author: Anthony Green <green@moxielogic.org>
Date: Thu Nov 23 09:22:20 2023 -0500
Reference recent changes
commit d7f5e98b437a242ac712cda8df3e47b205339711
Author: David Tenty <daltenty.dev@gmail.com>
Date: Thu Nov 23 09:16:56 2023 -0500
Fix visibility check for AIX (#804)
commit 7f960d9a062fab0624302e9f63ef8b025f51dd10
Author: David Tenty <daltenty.dev@gmail.com>
Date: Thu Nov 23 09:16:35 2023 -0500
[powerpc][AIX] fix layout issues for nested struct types (#805)
* [powerpc][AIX] fix layout issues for nested struct types
On AIX under the default power alignment rules, the layout
of struct types which are nested inside other structs may
be different than the layout of those types on their own.
Specifically the first member double rules which would
apply an eight byte alignment if that type appears in the
first position of a struct:
1) apply recursively if the struct appear in the first member
of another struct
2) do not apply if that struct is itself a member of another struct
and not the first member.
The current implementation of the rules in libffi doesn't handle these
cases, causing a mismatch with the compiler and causing some crashes
we see when OpenJ9 is used with libffi on AIX.
This PR corrects this and adds some representative test cases.
* Fix code style
* Add a size check
* Add additional test
* Fix padding in internal structs
* Flip condition back to original form
* Add a comment
commit d93c0be8a0f11f207e8232770c5f0590406efad1
Author: Tobias Heider <tobias.heider@stusta.de>
Date: Thu Nov 23 15:15:29 2023 +0100
Add bti intructions to aarch64 assembly to work with strict (#808)
BTI enforcement on OpenBSD.
commit adbcf2b247696dde2667ab552cb93e0c79455c84
Author: Daily Price Depot Droid <anthony@atgreen.org>
Date: Sat Oct 21 09:58:28 2023 -0400
Disable firefox testing
commit 357755eef44735676de1cec458192c7784fb3aa8
Author: Daily Price Depot Droid <anthony@atgreen.org>
Date: Sat Oct 21 09:05:48 2023 -0400
Try logging
commit c23e9a1c81a84ea4804d001865845b25ff8d4c8a
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
Date: Sat Oct 21 20:44:24 2023 +0900
Check if FFI_GO_CLOSURES is defined (#796)
This macro is always defined to 1 if defined, or undefined.
With `-Wundef` option, checking the value without checking if it is defined causes warnings:
```
/opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef]
#if FFI_GO_CLOSURES
^
```
commit a4be0b7210b5a7fd67770d2f4d63105900bc459a
Author: Yn0ga <ynoga@protonmail.com>
Date: Sat Oct 21 13:43:43 2023 +0200
Add support for Haikuos on PowerPC (#799)
commit dd90749505559d38abb339f1a1cd03791a9dc484
Author: Petr Sumbera <sumbera@volny.cz>
Date: Sat Oct 21 13:42:11 2023 +0200
Fix passing floating point arguments on 64bits SPARC (libffi#778) (#802)
commit 44f6fa3e526c920c61c8ac10661f447ccfe30872
Author: Alfred Wingate <parona@protonmail.com>
Date: Fri Oct 20 15:02:37 2023 +0300
Put optional symbols behind ifdefs (#800)
Signed-off-by: Alfred Wingate <parona@protonmail.com>
commit 5c6e53db873767cd2266745cebc62551958f5bee
Author: Michael Osipov <1983-01-06@gmx.net>
Date: Mon Sep 4 13:27:01 2023 +0200
Fix build failures on HP-UX (#792)
This fixes #328
Co-authored-by: Chris Hunt <chrahunt@gmail.com>
commit 1b3e7569fe114fc7d7779e35704b8519fe65fd4d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date: Mon Sep 4 19:26:11 2023 +0800
Replace use of triple with target, and explicitly specify build host to force cross-compilation (#794)
commit 22b50e896a80171648439497041afe3b6dba1c08
Author: Anthony Green <green@moxielogic.com>
Date: Thu Aug 31 16:31:42 2023 -0400
Fix python and pyodide version
commit 4467a3bc350bca106aee2c55cbb19ffffb144d1b
Author: Anthony Green <green@moxielogic.com>
Date: Thu Aug 31 08:48:50 2023 -0400
Upgrade pyodide version to match newer selenium API
commit 1d0a28ab5a2ee2e12b0650d69184d561cd1fd83c
Author: Ivan Tadeu Ferreira Antunes Filho <itadeufa@gmail.com>
Date: Sat Aug 12 09:02:39 2023 -0400
Make label private on apple (#788)
Private labels on apple must start with L prefix, while on ELF they start with .L prefix.
This makes the label start with L on apple instead of .L.
commit 9e8f1bd8de39ee90a73c6927e2df18a418f6da55
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Tue Jun 20 21:17:04 2023 -0700
Emscripten build: Remove -sSTRICT_JS (#781)
This rasies errors on newer versions of the emscripten compiler.
commit ac598b7f5272d536b75f4b3833a4610cf4cd9404
Merge: 2d63cee 8bdd471
Author: Anthony Green <green@moxielogic.com>
Date: Mon Apr 3 08:20:32 2023 -0400
Merge branch 'master' of github.com:/libffi/libffi
commit 2d63cee0e2154bb9027cff71f780cfaa2f543567
Author: Anthony Green <green@moxielogic.com>
Date: Mon Apr 3 08:18:23 2023 -0400
Add tests with homogeneous aggregate types
commit 8bdd4716e5974ee0b28b3c09db1eaa9e8833481e
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sun Apr 2 19:54:22 2023 -0700
More accurate explanation of wasm32 state in readme (#776)
There are three main wasm32 target triples:
* wasm32-unknown-unknown
* wasm32-unknown-emscripten
* wasm32-unknown-wasi
The wasm32 port is only for the wasm32-unknown-emscripten target triple.
(The other triples have no dynamic linking support so libffi would be both
hard to port and of limited utility.)
commit f08493d249d2067c8b3207ba46693dd858f95db3
Author: Anthony Green <green@moxielogic.com>
Date: Fri Feb 17 20:35:44 2023 -0500
Mention ARCv3 work
commit c4df19c99f8d8841942e3edaadbf331d30e298c8
Author: Claudiu Zissulescu <claziss@gmail.com>
Date: Sat Feb 18 03:33:47 2023 +0200
Update ARC's libffi port (#771)
* Add support for ARC and ARC64
Add support for ARC/ARC32/ARC64
* Implementation of GO Closure for ARC/ARC32/ARC64 Architectures
---------
Co-authored-by: Nuno Cardoso <cardoso@synopsys.com>
Co-authored-by: Luis Silva <luiss@synopsys.com>
commit 237520649730cb21daf4ebff1cf9a0a64f8507f8
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 9 12:23:35 2023 -0500
Normalize libffi labels
commit ca26801567e9ce19c83f132c6a116d3d25d3b8a1
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 9 10:31:22 2023 -0500
Use rlgl
commit 7d23c2d28e884ad5978e0974ad2443570940d393
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Thu Feb 9 06:01:37 2023 -0800
Add emscripten gha workflow (#768)
Resolves issue #767
commit 883f5ae665bf96008a7a56bf4d6c64cb05c68272
Author: Anthony Green <green@moxielogic.com>
Date: Sun Feb 5 09:51:37 2023 -0500
Rename label
commit 678dad5abe6c95ffa087b799922c2114b18c8541
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Thu Feb 2 14:48:07 2023 -0800
Use libffi-dg-prune to handle Emscripten INFO messages rather than patching emcc.py (#766)
commit 7d03d3a3150c5c1ff70753edaa880bb5d57ae566
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 16:09:14 2023 -0500
Mention wasm32
commit c267c72fa803316e95462f16bf1e3d6d5d55612c
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 16:04:34 2023 -0500
Modernize
commit 2687cfc5329d08d6bd4d397c1ca8eb0d171e22fd
Author: Hood Chatham <roberthoodchatham@gmail.com>
Date: Thu Feb 2 09:10:00 2023 -0800
Add wasm32 emscripten support (#763)
* added build script
* Apply libffi-emscripten patch
* Some changes to wasm32/ffi.c
* Remove exit(0); from test suites
* Fix LONGDOUBLE argument type
* Use more macros in ffi.c
* Use switch statements instead of if chains
* Implemented struct args
* Finish struct implementation
* Partially working closures
* Got closures working (most of closures test suite passes)
* Revert changes to test suite
* Update .gitignore
* Apply code formatter
* Use stackSave and stackRestore rather than directly adjusting stack pointer
* Add missing break
* Fix visibility of ffi_closure_alloc and ffi_closure_free
* Fix FFI_TYPE_STRUCT and FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used
sig needs to be vi here for FFI_TYPE_STRUCT and FFI_TYPE_LONGDOUBLE, noticed this while running the test suite without WASM_BIGINT support.
* Always use dynCall rather than direct wasmTable lookup (function pointer cast emulation changes dynCall)
* Prevent closures.c from duplicating symbols
* Try to set up CI
* Add test with bigint
* Make test methods static
* Remove BigInt shorthand because it messes up terser
* Add selenium tests
* Update tests a bit to try to make CI work
* WASM_BIGINT is a linker flag not a compile flag
* Finish getting CI working (#1)
* update gitignore
* Avoid adding "use strict;" to generated JS
This should be controlled by -s STRICT_JS in Emscripten.
* Make JavaScript ES5 compliant
* Remove redundant EXPORTED_RUNTIME_METHODS settings
* Fix definition of DEREF_I16
* Avoid marshalling FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used
* Add missing FFI_TYPE_STRUCT signature
* Improve test scripts
* Remove redundant EXPORTED_RUNTIME_METHODS settings
* Add missing EOL
* Add struct unpacking tests
* Update ci config to try to actually use WASM_BIGINT
* Revert "Avoid marshalling FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used"
This reverts commit 61bd5a3e20891623715604581b6e872ab3dfab80.
* Fix single_entry_structs tests
* Fix return from closure call
* Fix 64 bit return from closures
* only allocate as much space on stack for return pointer as needed
* Revert "only allocate as much space on stack for return pointer as needed"
This reverts commit e54a30faea3803e7ac33eed191bde9e573850fc1.
* xfail two tests
* Fix err_bad_abi test
* Remove test logging junk
* Try to set up long double marshalling for closures
* xfail err_bad_abi
* Fix reference errors in previous commit
* Add missing argument pointer assignment
* Fix signature of function pointer in cls_dbls_struct
* Fix longdouble argument
* Try some changes to bigint handling
* Fix BigInt handling
* Fix cls_longdouble test
* Fix long double closure arg with no WASM_BIGINT
* Use EM_JS to factor out js helpers
* Support for varargs closure calls
* Fix varargs calls
* Fix err_bad_abi test
* Fix typo in previous commit
* Add more assertions to closures test suite
* Fix some asserts
* Add assertions to a few more tests
* Fix some tests
* Fix more floating point assertions
* Update more tests
* Var args for ffi_call
* Don't do node tests
* Macro for allocating on stack
* Add some comments, simplify struct handling
* Try again to fix varargs calls, add comments
* Consolidate WASM_BIGINT conditionals into LOAD_U64 and STORE_U64 macros
* A bit of cleanup
* Fix another typo
* Some fixes to the testsuite
* Another testsuite fix
* Fix varags with closures?
* Another attempt at getting closure varargs to work
* sig is initialized later
* Allow libffi.closures tests to be run
* Improve build script
* Remove redundant semicolons
* Fix a few libffi.closures test failures
* Cleanup
* Legacy dynCall API is no longer used
* Fix FFI_TYPE_LONGDOUBLE offset
* xfail 2 tests for WASM
- closure_loc_fn0; not applicable -- codeloc doesn't point to closure.
- huge_struct; function signature too long.
* Revert some redundant dg-output/printf statements
Helps Node.
* Revert "Don't do node tests"
This reverts commit a341ef4b.
* Fix assertions in cls_24byte
* More tiny formating fixes to test suite
* Revert "Revert "Don't do node tests""
This reverts commit 7722e685ea04e2420e042886816d8c4dd31f5dcb.
* Fix 64 bit returns when WASM_BIGINT is absent
* Fix print statement in cls_24byte
* Add CALL_FUNC_PTR macro to allow pyodide to define custom calling behavior to handle fpcast
* Update single_entry_structs tests
* More explanations
* Fix compile error in last commit
* Add more support for pyodide fpcast emulation, update CI to try to test it
* Clone via https
* Fix path to pyodide emsdk_env
* Add asserts to the rest of the test suite
* Fix test compile errors
* Fix some tests
* Fix cls_ulonglong
* Fix alignment of <4 byte args
* fix cls_ulonglong again
* Use snprintf instead of sprintf
* Should assert than strncmp returned 0
* Fix va_struct1 and va_struct3
* Change double and long double tests
These tests are failing because of a strange bug with prinft and doubles, but I am not convinced
it necessarily has anything to do with libffi. This version casts the double to int before printing it and avoids the issue
* Enable node tests
* Revert "Change double and long double tests"
This reverts commit 8f3ff89c6577dc99564181cd9974f2f1ba21f1e9.
* Fix PYODIDE_FPCAST flag
* add conftest.py back in
* Fix emcc error: setting `EXPORTED_FUNCTIONS` expects `<class 'list'>` but got `<class 'str'>`
See discussion on https://github.com/pyodide/pyodide/pull/1596
* Remove test.html
* Remove duplicate test file
* More changes from upstream
* Fix some whitespace
* Add some basic debug logging statements
* Reapply libffi.exp changes
* Don't build docs (#7)
Works around build issue makeinfo: command not found.
* Update long double alignment
Emscripten 2.0.26 reduces the aligmnet of long double to 8. Quoting
from `ChangeLog.md`:
> The alignment of `long double`, which is a 128-bit floating-point
> value implemented in software, is reduced from 16 to 8. The lower
> alignment allows `max_align_t` to properly match the alignment we
> use for malloc, which is 8 (raising malloc's alignment to achieve
> correctness the other way would come with a performance regression).
> (#10072)
* Update long double alignment
Emscripten 2.0.26 reduces the aligmnet of long double to 8. Quoting
from `ChangeLog.md`:
> The alignment of `long double`, which is a 128-bit floating-point
> value implemented in software, is reduced from 16 to 8. The lower
> alignment allows `max_align_t` to properly match the alignment we
> use for malloc, which is 8 (raising malloc's alignment to achieve
> correctness the other way would come with a performance regression).
> (#10072)
* Improve error handling a bit (#8)
* Fix handling of signed arguments to ffi_call (#11)
* Fix struct argument handling in ffi_call (#10)
* Remove fpcast emulation tests
* Align the stack to MAX_ALIGN before making call (#12)
* Increase MAX_ARGS
* Cleanup (#14)
* Fix Closure compiler error with -sASSERTIONS=1 (#15)
* Remove function pointer cast emulation (#13)
This reverts commit 593b402 and cbc54da, as it's no longer needed
after PR pyodide/pyodide#2019.
* Prefer the `__EMSCRIPTEN__` definition over `EMSCRIPTEN` (#18)
"The preprocessor define EMSCRIPTEN is deprecated. Don't pass it to code
in strict mode. Code should use the define __EMSCRIPTEN__ instead."
https://github.com/emscripten-core/emscripten/blob/84a634167a1cd9e8c47d37a559688153a4ceace6/emcc.py#L887-L890
* Install autoconf 2.71
* Try again with installing autoconf 2.71
* Fix compatibility with Emscripten 3.1.28
* CI: remove use of `EM_CONFIG` env
See commit:
https://github.com/emscripten-core/emsdk/commit/3d87d5ea8143b3636f872fb05b896eb4a19a070b
* Fix cls_multi_schar: cast rest_call to signed char
* Remove test xfails (#17)
* Fix long double when used as a varargs argument
* Enable unwindtest and fix it
* Add EM_JS_DEPS
* Also require convertJsFunctionToWasm
* Run tests very very verbose
* Echo the .emscripten file
* Remove --experimental-wasm-bigint insertion
* Build with assertions
* Move verbosity flags back out of LDFLAGS
* Remove debug print statement
* Use up to date pyodide docker image
* Explicitly cast res_call to fix test failure
* Put back name of main function in cls_longdouble_va.c
* Fix alignment
The stack pointer apparently needs to be aligned to 16. There were
some terrible subtle bugs caused by not respecting this. stackAlloc
knows that the stack should be 16 aligned, so we can use stackAlloc(0)
to enforce this. This way if alignment requirements change, as long
as Emscripten updates stackAlloc to continue to enforce them we should
be okay.
* Fix handling of systems with no Js bigint integration
When we run the node tests we use node v14 tests (since node v14 is
vendored with Emscripten). Node v14 has no Js bigint integration
unless the --experimental-wasm-bigint flag is passed. So only the
node tests really notice if we get this right. Turns out, it didn't
work. We can't call a JavaScript function with 64 bit integer arguments
without bigint integration.
In ffi_call, we are trying to call a wasm function that takes 64 bit
integer arguments. dynCall is designed to do this. We need to go back
to tracking the signature when we don't have WASM_BIGINT, and then use
dynCall. This works better now that emscripten can dynamically fill in
extra dynCall wrappers:
https://github.com/emscripten-core/emscripten/pull/17328
On the other hand, for the closures we are not getting a function pointer
as a first argument. We need to make our own wasm legalizer adaptor that
splits 64 bit integer arguments and then calls the JavaScript trampoline,
then the JavaScript trampoline reassembles them, calls the closure, then
splits the result (if it's a 64 bit integer) and the adaptor puts it back
together.
* Improvements to emscripten test shell scripts (#21)
This fixes the C++ unwinding tests and makes other minor improvements
to the Emscripten test shell scripts.
* Rename the test folder and move test files into emscripten test folder
* Use docker image that has autoconf-2.71
* Cleanup
* Pin emscripten 3.1.30
* Fix build.sh path
* Rearrange ci pipeline
* Fix bpo_38748 test
* Cleanup
* Improvements to comments, add static asserts, and update copyright
* Use `*_js` instead of `*_helper` for EM_JS functions (#22)
* Minor code simplification
* Xfail first dejagnu test to work around emscripten cache messages
See https://github.com/emscripten-core/emscripten/issues/18607
* Remove unneeded xfails
* Shorten conftest.py by using pytest-pyodide
* Apply formatters and linters to emscripten directory
* Fix Emscripten xfail hack
* Fix build-tests script
* Patch emscripten to quiet info messages
* Clean up compiler flags in scripts and remove some settings from circleci config
* Rename emscripten quiet script
* Add missing export
* Don't remove go.exp
* Add reference to emscripten logging issue
---------
Co-authored-by: Kleis Auke Wolthuizen <info@kleisauke.nl>
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
Co-authored-by: Christian Heimes <christian@python.org>
commit ce077e5565366171aa1b4438749b0922fce887a4
Author: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Thu Feb 2 14:46:29 2023 +0000
Forward declare open_temp_exec_file (#764)
It's defined in closures.c and used in tramp.c.
Also declare it as an hidden symbol, as it should be.
Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
commit abf211d1603da9d687455169646e0e9667be17c1
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 07:06:02 2023 -0500
Mention HPPA fixes
commit 222abd0c65babe2174b21753217145f5031a8b91
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 07:04:55 2023 -0500
From Dave Anglin:
This patch is derived from the work done in implementing libffi for 64-bit hppa64-hpux target. Currently, the 32-bit hppa targets do a linear search for the return type of an ffi_call. This is slow and inefficient. A jump table can used to jump directly to the code used to process the return value. In most common cases, the return value can be processed in the jump table itself.
The patch also fixes return handling for FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16 and FFI_TYPE_SINT16.
commit e58e22b22386ed0e0a95e97eb8eed016e3f01b02
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 07:02:53 2023 -0500
From Dave Anglin:
A couple of years ago the 32-bit hppa targets were converted from using a trampoline executed on the stack to the function descriptor technique used by ia64. This is more efficient and avoids having to have an executable stack. However, function pointers on 32-bit need the PLABEL bit set in the pointer. It distinguishes between pointers that point directly to the executable code and pointer that point to a function descriptor. We need the later for libffi. But as a result, it is not possible to convert using casts data pointers to function pointers.
The solution at the time was to set the PLABEL bit in hppa closure pointers using FFI_CLOSURE_PTR. However, I realized recently that this was a bad choice. Packages like python-cffi allocate their own closure pointers, so this isn't going to work well there.
A better solution is to leave closure pointers unchanged and only set the PLABEL bit in pointers used to point to executable code.
The attached patch drops the FFI_CLOSURE_PTR and FFI_RESTORE_PTR defines. This allows some cleanup in the hppa closure routines. The FFI_FN define is now used to set the PLABEL bit on hppa. ffi_closure_alloc is modified to set the PLABEL bit in the value set in *code.
I also added a FFI_CL define to convert a function pointer to a closure pointer. It is only used in one test case.
commit baa6bbbc176b3c572eaf05b3fae0311df7e5f7b7
Author: Anthony Green <green@moxielogic.com>
Date: Thu Feb 2 06:59:46 2023 -0500
Add HPPA64 support
commit e70dd1aa240159bd2050cb1eafffb49cdc1d8b22
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Thu Feb 2 11:44:13 2023 +0000
libffi: Fix X86 32b Darwin build and EH frames. (#757)
This addresses a number of issues in the X86 Darwin 32b port for libffi.
1. The pic symbol stubs are weak definitions; the correct section placement
for these depends on the linker version in use. We do not have access
to that information, but we can use the target OS version (assumes that
the user has installed the latest version of xcode available).
When a coalesced section is in use (OS versions earlier than Darwin12 /
OSX 10.8), its name must differ from __TEXT,__text since otherwise that
would correspond to altering the attributes of the .text section (which
produces a diagnostic from the assembler).
Here we use __TEXT, __textcoal_nt for this which is what GCC emits for
these stubs.
For later versions than Darwin 12 (OS X 10.8) we can place the stubs in
the .text section (if we do not we get a diagnostic from clang -cc1as
saying that the use of coalesced sections for this is deprecated).
2. The EH frame is specified manually, since there is no support for .cfi_
directives in 'cctools' assemblers. The implementation needs to provide
offsets for CFA advance, code size and to the CIE as signed values
rather than relocations. However the cctools assembler will produce a
relocation for expressions like ' .long Lxx-Lyy' which then leads to a
link-time error. We correct this by forming the offset values using
' .set' directives and then assigning the results of them.
3. The register numbering used by m32 X86 Darwin EH frames is not the same
as the DWARF debug numbering (the Frame and Stack pointer numbers are
swapped).
4. The FDE address encoding used by the system tools is '0x10' (PCrel + abs)
where the value provided was PCrel + sdata4.
5. GCC does not use compact unwind at present, and it was not implemented
until Darwin10 / OSX 10.6. There were some issues with function location
in 10.6 so that the solution here suppresses emitting the compact unwind
section until Darwin11 / OSX 10.7.