-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
1862 lines (1531 loc) · 88.7 KB
/
Makefile
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
# wasm32/cross: build=host=x86_64-pc-linux-gnu target=wasm32-unknown-none
# wasm32/native: build=x86_64-pc-linux-gnu host=target=wasm32-unknown-none
# wasm32/wasm: wasm versions of wasm32/native
# wasm32/pure: build=host=target=wasm32-unknown-none
native-triplet = x86_64-pc-linux-gnu
# $(MKDIR) command
MKDIR ?= mkdir -p
LN ?= ln -sf
# $(PWD) is the top-level directory. No recursion here (except for subrepos).
PWD ?= $(shell pwd)
OPT_NATIVE ?= "-Os"
OPT_WASM ?= "-O2"
WASMDIR ?= $(PWD)
JS ?= $$JS
ARTIFACTS ?= all
.SECONDEXPANSION:
# This has to be the first rule: build everything, currently scattered over too many directories.
all!: wasm/libc.wasm wasm/ld.wasm wasm/libm.wasm wasm/libstdc++.wasm wasm/libdl.wasm wasm/libanl.wasm wasm/libncurses.wasm wasm/bash.wasm
start-over!:
rm -rf artifacts daily extracted github/assets github/release github/install install js ship src stamp test wasm wasm32-unknown-none wasm32
clean!: start-over!
clean: clean!
%/:
$(MKDIR) $@
# the build-or-install generic rule
define do-build =
stamp/wasm32/$(1)/$(2)/install: stamp/wasm32/$(1)/$(2)/build
touch $$@
endef
define do-download =
stamp/wasm32/$(1)/$(2)/install: stamp/wasm32/$(1)/$(2)/download
touch $$@
endef
define build-or-install =
stamp/wasm32/$(1)/$(2)/install: stamp/wasm32/$(1)/$(2)/
$(if $(filter all $(2),$(ARTIFACTS)),$(call do-build,$(1),$(2)),$(call do-download,$(1),$(2)))
endef
# environment for bash shells
env:
@echo "export WASMDIR=$(PWD)"
@echo "export LANG=C"
@echo "export JS=\"$(JS)\""
wasm32:
$(MKDIR) $@
wasm32/native: | wasm32/
$(MKDIR) $@
$(MKDIR) $(patsubst %,$@/%,bin include lib libexec share stamp wasm32-unknown-none)
$(MKDIR) $@/lib
stamp/wasm32/native: | wasm32/native
$(MKDIR) $@
wasm32/native/build: | wasm32/cross
$(MKDIR) $@
wasm32/cross: | wasm32 wasm32/native
$(MKDIR) $@
$(MKDIR) $(patsubst %,$@/%,bin include lib libexec share stamp wasm32-unknown-none)
$(LN) ../../native/include $@/wasm32-unknown-none/include
$(LN) ../../native/lib $@/wasm32-unknown-none/lib
wasm32/cross/bin: | wasm32/cross
$(MKDIR) $@
wasm32/cross/src: | wasm32/cross
$(MKDIR) $@
stamp/wasm32/cross: | wasm32/cross
$(MKDIR) $@
# Binutils/GDB
# binutils-gdb requires source tree modification, so we copy the source.
wasm32/cross/src/binutils-gdb: | wasm32/cross/src
$(MKDIR) $@T
cp -as $(PWD)/subrepos/binutils-gdb/* $@T/
mv $@T $@
stamp/wasm32/cross/binutils-gdb/configure: | wasm32/cross/src/binutils-gdb wasm32/cross/build/binutils-gdb stamp/wasm32/cross/binutils-gdb/
(cd wasm32/cross/src/binutils-gdb/gas; aclocal)
(cd wasm32/cross/src/binutils-gdb/gas; automake || true)
(cd wasm32/cross/src/binutils-gdb/gas; autoreconf2.69 || autoreconf || true)
(cd wasm32/cross/build/binutils-gdb; ../../src/binutils-gdb/configure --target=wasm32-unknown-none --enable-debug --disable-werror --prefix=$(PWD)/wasm32/cross CFLAGS=$(OPT_NATIVE))
touch $@
stamp/wasm32/cross/binutils-gdb/build: stamp/wasm32/cross/binutils-gdb/configure | stamp/wasm32/cross/binutils-gdb/
$(MAKE) -C wasm32/cross/build/binutils-gdb
$(MAKE) -C wasm32/cross/build/binutils-gdb install
touch $@
$(eval $(call build-or-install,cross,binutils-gdb))
# GCC (preliminary compilation, C only)
wasm32/cross/src/gcc-preliminary: | wasm32/cross/src
test -L $@ || $(LN) ../../../subrepos/gcc $@
stamp/wasm32/cross/gcc-preliminary/configure: | stamp/wasm32/cross/binutils-gdb/install wasm32/cross/build/gcc-preliminary wasm32/cross/src/gcc stamp/wasm32/cross/gcc-preliminary/ install/gcc-dependencies
(cd wasm32/cross/build/gcc-preliminary; CFLAGS=$(OPT_NATIVE) CXXFLAGS=$(OPT_NATIVE) ../../src/gcc/configure --enable-optimize=$(OPT_NATIVE) --target=wasm32-unknown-none --disable-libatomic --disable-libgomp --disable-libquadmath --enable-explicit-exception-frame-registration --enable-languages=c --disable-libssp --prefix=$(PWD)/wasm32/cross)
touch $@
stamp/wasm32/cross/gcc-preliminary/build: stamp/wasm32/cross/gcc-preliminary/configure | stamp/wasm32/cross
PATH=$(PWD)/wasm32/cross/bin:$$PATH CFLAGS=$(OPT_NATIVE) CXXFLAGS=$(OPT_NATIVE) $(MAKE) -C wasm32/cross/build/gcc-preliminary
PATH=$(PWD)/wasm32/cross/bin:$$PATH CFLAGS=$(OPT_NATIVE) CXXFLAGS=$(OPT_NATIVE) $(MAKE) -C wasm32/cross/build/gcc-preliminary install
cp wasm32/cross/lib/gcc/wasm32-unknown-none/12.0.0/libgcc.a wasm32/cross/lib/gcc/wasm32-unknown-none/12.0.0/libgcc_eh.a
cp wasm32/cross/lib/gcc/wasm32-unknown-none/12.0.0/libgcc.a wasm32/cross/lib/gcc/wasm32-unknown-none/12.0.0/libgcc_s.a
touch $@
$(eval $(call build-or-install,cross,gcc-preliminary))
# Glibc
wasm32/native/src: | wasm32/native
$(MKDIR) $@
# These repos do not require source tree modification.
$(patsubst %,wasm32/native/src/%,gcc glibc ncurses bash wabt binaryen python gmp mpc zlib): wasm32/native/src/%: | wasm32/native/src
test -L $@ || $(LN) ../../../subrepos/$* $@
$(patsubst %,wasm32/cross/src/%,gcc wabt binaryen): wasm32/cross/src/%: | wasm32/cross/src
test -L $@ || $(LN) ../../../subrepos/$* $@
$(patsubst %,wasm32/cross/build/%,binutils-gdb gcc-preliminary gcc wabt binaryen): wasm32/cross/build/%: | wasm32/cross/src
$(MKDIR) $@
$(patsubst %,wasm32/native/build/%,binutils-gdb gcc glibc ncurses bash wabt binaryen python gmp mpc zlib): wasm32/native/build/%: | wasm32/native/build
$(MKDIR) $@
stamp/wasm32/native/glibc/configure: | stamp/wasm32/cross/gcc-preliminary/install wasm32/native/build/glibc wasm32/native/src/glibc stamp/wasm32/native/glibc/
(cd wasm32/native/build/glibc; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/glibc/configure CFLAGS="-fPIC -O2 -Wno-error=missing-attributes" --enable-optimize=$(OPT_NATIVE) --host=wasm32-unknown-none --target=wasm32-unknown-none --enable-hacker-mode --prefix=$(PWD)/wasm32/native --disable-werror)
touch $@
stamp/wasm32/native/glibc/build: stamp/wasm32/native/glibc/configure | stamp/wasm32/native/glibc/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/glibc
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/glibc install
touch $@
$(eval $(call build-or-install,native,glibc))
ifneq (${GITHUB},1)
wasm32/native/lib/libc.so: stamp/wasm32/native/glibc/
wasm32/native/lib/libm.so: stamp/wasm32/native/glibc/
wasm32/native/lib/ld.so.1: stamp/wasm32/native/glibc/
wasm32/native/lib/libcrypt.so: stamp/wasm32/native/glibc/
wasm32/native/lib/libutil.so: stamp/wasm32/native/glibc/
wasm32/native/lib/libdl.so: stamp/wasm32/native/glibc/
wasm32/native/lib/libanl.so: stamp/wasm32/native/glibc/
endif
# GCC (final build, C/C++/LTO, no libgccjit)
stamp/wasm32/cross/gcc/configure: | stamp/wasm32/native/glibc/build stamp/wasm32/cross/gcc-preliminary/install wasm32/cross/build/gcc wasm32/cross/src/gcc stamp/wasm32/cross/gcc/ install/gcc-dependencies
(cd wasm32/cross/build/gcc; ../../src/gcc/configure CFLAGS="-O2" CXXFLAGS="-O2" --target=wasm32-unknown-none --disable-libgomp --disable-libquadmath --enable-explicit-exception-frame-registration --disable-libssp --prefix=$(PWD)/wasm32/cross --enable-optimize="-O2" --enable-shared --enable-symvers=gnu)
touch $@
stamp/wasm32/cross/gcc/build: stamp/wasm32/cross/gcc/configure | stamp/wasm32/cross/gcc/ wasm32/cross/src/gcc
$(MKDIR) wasm32/cross/build/gcc/gcc
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/cross/build/gcc
cp wasm32/cross/build/gcc/gcc/libgcc.a wasm32/cross/build/gcc/gcc/libgcc_eh.a
cp wasm32/cross/build/gcc/gcc/libgcc.a wasm32/cross/build/gcc/gcc/libgcc_s.a
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/cross/build/gcc install
touch $@
$(eval $(call build-or-install,cross,gcc))
wasm32/cross/lib/libstdc++.so: stamp/wasm32/cross/glibc/install
# ncurses
stamp/wasm32/native/ncurses/configure: | stamp/wasm32/cross/gcc/install wasm32/native/src/ncurses wasm32/native/build/ncurses stamp/wasm32/native/ncurses/
(cd wasm32/native/build/ncurses; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/ncurses/configure MAKE_TERMINFO=1 --enable-optimize=$(OPT_WASM) --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native --disable-stripping --with-shared --without-cxx-binding)
touch $@
stamp/wasm32/native/ncurses/build: stamp/wasm32/native/ncurses/configure | stamp/wasm32/native/ncurses/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/ncurses
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/ncurses install
touch $@
$(eval $(call build-or-install,native,ncurses))
wasm32/native/lib/libncurses.so: stamp/wasm32/native/ncurses/install
# bash
stamp/wasm32/native/bash/configure: | stamp/wasm32/native/ncurses/install wasm32/native/src/bash wasm32/native/build/bash stamp/wasm32/native/bash/
(cd wasm32/native/build/bash; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/bash/configure --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native --without-bash-malloc)
touch $@
stamp/wasm32/native/bash/build: stamp/wasm32/native/bash/configure | stamp/wasm32/native/bash/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/bash
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/bash install
touch $@
$(eval $(call build-or-install,native,bash))
wasm32/native/bin/bash: stamp/wasm32/native/bash/install
# zsh
# Zsh is spe-shell.
wasm32/native/build/zsh: | wasm32/native/build
$(MKDIR) $@T
cp -as $(PWD)/subrepos/zsh/* $@T/
mv $@T $@
stamp/wasm32/native/zsh/configure: | stamp/wasm32/native/ncurses/build wasm32/native/build/zsh stamp/wasm32/native/zsh/
(cd wasm32/native/build/zsh; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH autoreconf -vif; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ./configure --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/zsh/build: stamp/wasm32/native/zsh/configure | stamp/wasm32/native/zsh/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/zsh
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/zsh install
touch $@
$(eval $(call build-or-install,native,zsh))
wasm32/native/bin/zsh: stamp/wasm32/native/zsh/install
# coreutils
# Coreutils requires its own destructive bootstrap script
wasm32/native/build/coreutils: | wasm32/native/build
$(MKDIR) $@T
cp -as $(PWD)/subrepos/coreutils/* $@T/
mv $@T $@
stamp/wasm32/native/coreutils/configure: | stamp/wasm32/native/ncurses/build wasm32/native/build/coreutils stamp/wasm32/native/coreutils/ wasm32/cross/lib/js/wasm32.js
(cd wasm32/native/build/coreutils; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ./bootstrap --skip-po --no-git --gnulib-srcdir=$(PWD)/wasm32/native/build/coreutils/gnulib; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ./configure --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/coreutils/build: stamp/wasm32/native/coreutils/configure | stamp/wasm32/native/coreutils/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) --trace -C wasm32/native/build/coreutils
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) --trace -C wasm32/native/build/coreutils install
touch $@
$(eval $(call build-or-install,native,coreutils))
wasm32/native/bin/true wasm32/native/bin/false wasm32/native/bin/echo: stamp/wasm32/native/coreutils/install
# Python
stamp/wasm32/native/python/configure: | stamp/wasm32/cross/gcc/install wasm32/native/src/python wasm32/native/build/python stamp/wasm32/native/python/
(cd wasm32/native/build/python; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/python/configure --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native --disable-ipv6 --with-ensurepip=no)
touch $@
stamp/wasm32/native/python/build: stamp/wasm32/native/python/configure | stamp/wasm32/native/python/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/python
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/python install
touch $@
$(eval $(call build-or-install,native,python))
ifneq (${GITHUB},1)
wasm32/native/bin/python3: stamp/wasm32/native/python/build
endif
# Perl
wasm32/native/src/perl: | subrepos/perl wasm32/native/src
$(LN) ../../../subrepos/perl $@
wasm32/native/build/perl: | wasm32/native/src/perl wasm/libcrypt.wasm wasm/libutil.wasm wasm32/native/build
$(MKDIR) $@T
cp -as $(PWD)/subrepos/perl/* $(addprefix $(PWD)/subrepos/perl/.,dir-locals.el editorconfig lgtm.yml metaconf-exclusions.txt travis.yml) $@T/
mv $@T $@
stamp/wasm32/native/perl/configure: | wasm32/native/build/perl stamp/wasm32/cross/gcc/build wasm/libc.wasm wasm/libcrypt.wasm wasm/ld.wasm wasm/libutil.wasm wasm/libanl.wasm wasm/libdl.wasm wasm/libm.wasm wasm32/cross/bin/dotdir stamp/wasm32/native/perl/
test -f wasm32/native/build/perl/config.sh && mv wasm32/native/build/perl/config.sh wasm32/native/build/perl/config.sh.old || true
touch wasm32/native/build/perl/config.sh
find wasm32/native/build/perl -type d | while read REPLY; do (cd $$REPLY; $(PWD)/wasm32/cross/bin/dotdir > .dir); done
(cd wasm32/native/build/perl; PATH=$(PWD)/wasm32/cross/bin:$$PATH sh ./Configure -der -Uversiononly -Uusemymalloc -Dar=wasm32-unknown-none-ar -Dcc=wasm32-unknown-none-gcc -Doptimize="-O3 -fno-strict-aliasing" -Dincpth='' -Dcccdlflags='-fPIC -Wl,--shared -shared' -Dlddlflags='-Wl,--shared -shared' -Dccdlflags='-Wl,-E' -Dloclibpth=' ' -Dglibpth=' ' -Dplibpth=' ' -Dusedl -Dlibs='-ldl -lm -lcrypt -lutil' -Dd_u32align=define -Dusedevel -Darchname='wasm32' -Dprefix='$(PWD)/wasm32/native')
touch $@
stamp/wasm32/native/miniperl/build: stamp/wasm32/native/perl/configure | install/binfmt_misc/elf32-wasm32 stamp/wasm32/native/miniperl/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/perl miniperl
cp wasm32/native/build/perl/miniperl wasm32/native/bin/miniperl
touch $@
$(eval $(call build-or-install,native,miniperl))
wasm32/native/bin/miniperl: stamp/wasm32/native/miniperl/install
stamp/wasm32/native/perl/build: stamp/wasm32/native/miniperl/build stamp/wasm32/native/perl/configure | install/binfmt_misc/elf32-wasm32 wasm32/cross/lib/js/wasm32.js wasm32/cross/bin/dotdir stamp/wasm32/native/perl/
find wasm32/native/build/perl -type d | while read REPLY; do (cd $$REPLY; $(PWD)/wasm32/cross/bin/dotdir > .dir); done
PERL_CORE=1 PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/perl < /dev/null
PERL_CORE=1 PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/perl install < /dev/null
touch $@
$(eval $(call build-or-install,native,perl))
wasm32/native/bin/perl: stamp/wasm32/native/perl/install
# zlib
stamp/wasm32/native/zlib/configure: | wasm32/native/build/zlib wasm32/native/src/zlib stamp/wasm32/cross/gcc/build stamp/wasm32/native/zlib/
(cd wasm32/native/build/zlib; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/zlib/configure --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/zlib/build: stamp/wasm32/native/zlib/configure | stamp/wasm32/native/zlib/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/zlib
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/zlib install
touch $@
$(eval $(call build-or-install,native,zlib))
wasm32/native/lib/libz.so: stamp/wasm32/native/zlib/install
# GMP
stamp/wasm32/native/gmp/configure: | wasm32/native/build/gmp wasm32/native/src/gmp stamp/wasm32/cross/gcc/build stamp/wasm32/native/gmp/
(cd wasm32/native/build/gmp; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/gmp/configure --host=wasm32-unknown-none --build=$(native-triplet) --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/gmp/build: stamp/wasm32/native/gmp/configure | stamp/wasm32/native stamp/wasm32/native/gmp/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/gmp
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/gmp install
touch $@
$(eval $(call build-or-install,native,gmp))
# MPC
stamp/wasm32/native/mpc/configure: | wasm32/native/src/mpc wasm32/native/build/mpc stamp/wasm32/cross/gcc/build stamp/wasm32/native/mpc/ stamp/wasm32/native/mpfr/install stamp/wasm32/native/gmp/install
(cd wasm32/native/build/mpc; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/mpc/configure --host=wasm32-unknown-none --build=$(native-triplet) --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/mpc/build: stamp/wasm32/native/mpc/configure | stamp/wasm32/native/mpc/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/mpc
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/mpc install
touch $@
$(eval $(call build-or-install,native,mpc))
# MPFR
wasm32/native/src/mpfr: | wasm32/native/src
$(MKDIR) $@T
cp -as $(PWD)/subrepos/mpfr/* $@T/
mv $@T $@
wasm32/native/build/mpfr: | wasm32/native/build
$(MKDIR) $@
stamp/wasm32/native/mpfr/configure: | wasm32/native/src/mpfr wasm32/native/build/mpfr stamp/wasm32/cross/gcc/build stamp/wasm32/native/mpfr/
(cd wasm32/native/src/mpfr; libtoolize && sh autogen.sh)
(cd wasm32/native/build/mpfr; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/mpfr/configure --host=wasm32-unknown-none --build=$(native-triplet) --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/mpfr/build: stamp/wasm32/native/mpfr/configure | stamp/wasm32/native/mpfr/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/mpfr
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/mpfr install
touch $@
$(eval $(call build-or-install,native,mpfr))
# Binutils (native)
wasm32/native/src/binutils-gdb: | wasm32/cross/src
$(MKDIR) $@T
cp -as $(PWD)/subrepos/binutils-gdb/* $@T/
mv $@T $@
stamp/wasm32/native/binutils-gdb/configure: | wasm32/native/src/binutils-gdb wasm32/native/build/binutils-gdb stamp/wasm32/native/binutils-gdb/
(cd wasm32/native/src/binutils-gdb/gas; aclocal; automake; autoreconf)
(cd wasm32/native/build/binutils-gdb; PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/binutils-gdb/configure --build=$(native-triplet) --target=wasm32-unknown-none --host=wasm32-unknown-none --enable-debug --prefix=$(PWD)/wasm32/native CFLAGS=$(OPT_WASM) --disable-werror)
touch $@
stamp/wasm32/native/binutils-gdb/build: stamp/wasm32/native/binutils-gdb/configure | stamp/wasm32/native/binutils-gdb/
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/binutils-gdb
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/binutils-gdb install
touch $@
$(eval $(call build-or-install,native,binutils-gdb))
# GCC (native)
stamp/wasm32/native/gcc/configure: | stamp/wasm32/native/glibc/build stamp/wasm32/cross/gcc/build wasm32/native/build/gcc wasm32/native/src/gcc stamp/wasm32/native/gcc/ stamp/wasm32/native/gmp/install stamp/wasm32/native/mpc/install stamp/wasm32/native/mpfr/install
(cd wasm32/native/build/gcc; PATH=$(PWD)/wasm32/cross/bin:$$PATH ../../src/gcc/configure CFLAGS="-Os" CXXFLAGS="-Os" --enable-languages=c,c++,fortran,lto,jit --enable-host-shared --host=wasm32-unknown-none --build=$(native-triplet) --target=wasm32-unknown-none --disable-libffi --disable-libgomp --disable-libquadmath --enable-explicit-exception-frame-registration --disable-libssp --prefix=$(PWD)/wasm32/native)
touch $@
stamp/wasm32/native/gcc/build: stamp/wasm32/native/gcc/configure | stamp/wasm32/native/gcc/ wasm32/native/src/gcc
$(MKDIR) wasm32/native/build/gcc/gcc
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/gcc
cp wasm32/native/build/gcc/gcc/libgcc.a wasm32/native/build/gcc/gcc/libgcc_eh.a
cp wasm32/native/build/gcc/gcc/libgcc.a wasm32/native/build/gcc/gcc/libgcc_s.a
PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/gcc install
touch $@
$(eval $(call build-or-install,native,gcc))
wasm32/native/lib/libgccjit.so: stamp/wasm32/native/gcc/install
# Emacs
wasm32/cross/build/emacs/: | wasm32/cross/build
$(MKDIR) $@T
cp -as $(PWD)/subrepos/emacs/* $@T/
mv $@T $@
stamp/wasm32/cross/emacs/configure: | wasm32/cross/emacs/ stamp/wasm32/cross/emacs/
(cd wasm32/native/build/emacs; sh autogen.sh; ./configure --build=$(native-triplet) --host=$(native-triplet) --prefix=$(PWD)/wasm32/cross --without-x --without-gnutls --without-modules --without-threads --without-x --without-libgmp --without-json --without-xft --without-all)
touch $@
stamp/wasm32/cross/emacs/build: stamp/wasm32/cross/emacs/configure
$(MAKE) -C wasm32/cross/build/emacs
(cd wasm32/cross/build/emacs; tar cvf elc.tar $$(find lisp/leim/quail -name '*.el') lisp/leim/ja-dic/ja-dic.el lisp/cedet/semantic/bovine/make-by.el lisp/cedet/semantic/wisent/python-wy.el $$(find -name '*.elc'))
touch $@
# Emacs is _built_ in the source directory, so copy that.
stamp/wasm32/native/emacs/copy: | stamp/wasm32/native/emacs/
$(MKDIR) wasm32/native/build/emacsT
cp -as $(PWD)/subrepos/emacs/* wasm32/native/build/emacsT/
mv wasm32/native/build/emacsT wasm32/native/build/emacs
test -e wasm32/cross/build/emacs/elc.tar && (cd wasm32/native/build/emacs; tar xv) < wasm32/cross/build/emacs/elc.tar || true
stamp/wasm32/native/emacs/configure: stamp/wasm32/native/emacs/copy | wasm32/cross/bin/dotdir stamp/wasm32/native/emacs/
(cd wasm32/native/build/emacs; sh autogen.sh; CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH ./configure --with-dumping=none --build=$(native-triplet) --host=wasm32-unknown-none --prefix=$(PWD)/wasm32/native --without-x --without-gnutls --without-modules --without-threads --without-x --without-libgmp --without-json --without-xft --without-all)
find wasm32/native/build/emacs -type d | while read REPLY; do (cd $$REPLY; $(PWD)/wasm32/cross/bin/dotdir > .dir); done
touch $@
stamp/wasm32/native/emacs/build: stamp/wasm32/native/emacs/configure | stamp/wasm32/native/ncurses/build stamp/wasm32/native/emacs/
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/emacs
CC=wasm32-unknown-none-gcc PATH=$(PWD)/wasm32/cross/bin:$$PATH $(MAKE) -C wasm32/native/build/emacs install
touch $@
wasm32/native/bin/emacs: stamp/wasm32/native/emacs/build
wasm32/native/bin/temacs: stamp/wasm32/native/emacs/build
# Needs runtime
stamp/wasm32/native/emacs/build: wasm/ld.wasm wasm/libc.wasm wasm/libncurses.wasm
# Temporary rule
%.eln.wasm: %.eln
wasm32/cross/bin/elf-to-wasm --library --dynamic $< > $@
# wabt
stamp/wasm32/cross/wabt/configure: | wasm32/cross/build/wabt wasm32/cross/src/wabt stamp/wasm32/cross/wabt/
(cd wasm32/cross/build/wabt; cmake ../../src/wabt -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$(PWD)/wasm32/cross -DCMAKE_BUILD_TYPE=Debug)
touch $@
stamp/wasm32/cross/wabt/build: stamp/wasm32/cross/wabt/configure | stamp/wasm32/cross
$(MAKE) -C wasm32/cross/build/wabt
$(MAKE) -C wasm32/cross/build/wabt install
touch $@
# Binaryen
stamp/wasm32/cross/binaryen/configure: | wasm32/cross/build/binaryen wasm32/cross/src/binaryen stamp/wasm32/cross/binaryen/
(cd wasm32/cross/build/binaryen; cmake ../../src/binaryen -DCMAKE_INSTALL_PREFIX=$(PWD)/wasm32/cross -DCMAKE_BUILD_TYPE=Debug)
touch $@
stamp/wasm32/cross/binaryen/build: stamp/wasm32/cross/binaryen/configure | stamp/wasm32/cross
$(MAKE) -C wasm32/cross/build/binaryen
$(MAKE) -C wasm32/cross/build/binaryen install
touch $@
########################################
wasm32/cross/test/binutils-gdb: | wasm32/cross/test/
$(MKDIR) $@
wasm32/native/test/bash: | wasm32/native/test/
$(MKDIR) $@
wasm32/native/test/glibc: | wasm32/native/test/
$(MKDIR) $@
# Copying wasm32-headers.o is unfortunate, but required by our linker script.
wasm32/cross/test/binutils-gdb/summary: stamp/wasm32/cross/binutils-gdb/build | stamp/wasm32/cross/gcc-preliminary/build wasm32/cross/test/binutils-gdb
cp wasm32/cross/lib/gcc/wasm32-unknown-none/11.0.1/wasm32-headers.o wasm32/cross/build/binutils-gdb/ld/
(cd wasm32/cross/build/binutils-gdb; $(MAKE) check)
cat $(patsubst %,wasm32/cross/build/binutils-gdb/%,binutils/binutils.sum gas/testsuite/gas.sum libctf/libctf.sum ld/ld.sum sim/testsuite/testrun.sum) > $@
wasm32/cross/test/gcc-preliminary/summary: stamp/wasm32/cross/gcc-preliminary/build | | wasm32/cross/test/gcc-preliminary
(cd wasm32/cross/build/gcc-preliminary; $(MAKE) check)
wasm32/native/test/glibc/summary: stamp/wasm32/native/glibc/build | wasm32/native/test/glibc
(cd wasm32/native/build/glibc; $(MAKE) check)
wasm32/native/test/bash/summary: stamp/wasm32/native/bash | wasm32/native/test/bash
(cd wasm32/native/build/bash; $(MAKE) check)
wasm32/cross/test/gcc/site.exp: | wasm32/cross/test/gcc/tmp/
$(MKDIR) $(dir $@)
> $@
echo 'set rootme "$(PWD)/wasm32/cross/test/gcc"' >> $@
echo 'set srcdir "$(PWD)/wasm32/cross/src/gcc/gcc"' >> $@
echo 'set host_triplet $(native-triplet)' >> $@
echo 'set build_triplet $(native-triplet)' >> $@
echo 'set target_triplet wasm32-unknown-none' >> $@
echo 'set target_alias wasm32-unknown-none' >> $@
echo 'set libiconv ""' >> $@
echo 'set CFLAGS ""' >> $@
echo 'set CXXFLAGS ""' >> $@
echo 'set HOSTCC "gcc"' >> $@
echo 'set HOSTCXX "g++"' >> $@
echo 'set HOSTCFLAGS "-g "' >> $@
echo 'set HOSTCXXFLAGS "-g "' >> $@
echo 'set TEST_ALWAYS_FLAGS ""' >> $@
echo 'set TEST_GCC_EXEC_PREFIX "$(PWD)/wasm32/cross/lib/gcc/"' >> $@
echo 'set TESTING_IN_BUILD_TREE 0' >> $@
echo 'set HAVE_LIBSTDCXX_V3 1' >> $@
echo 'set ENABLE_PLUGIN 1' >> $@
echo 'set PLUGINCC "g++"' >> $@
echo 'set PLUGINCFLAGS "-g "' >> $@
echo 'set GMPINC ""' >> $@
echo 'set tmpdir $(PWD)/wasm32/cross/test/gcc/tmp' >> $@
echo 'set srcdir "$${srcdir}/testsuite"' >> $@
wasm32/cross/test/gcc/make/%.{dejagnu}.mk: | wasm32/cross/test/gcc/site.exp
$(MKDIR) $(dir $@)
> $@
for file in $$(cd wasm32/cross/src/gcc/gcc/testsuite/$(dir $*); find -type f | egrep '\.([cSi])$$' | sed -e 's/^\.\///g'); do \
echo "wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/okay:" >> $@; \
echo "\t(mkdir -p wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/; cp wasm32/cross/src/gcc/gcc/testsuite/$(dir $*)$$file wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/; cd wasm32/cross/test/gcc/results; testtotest=../../../../../subrepos/gcc/gcc/testsuite/$(dir $*)$$file PATH=$(PWD)/wasm32/cross/bin:$$PATH runtest --outdir $(dir $*)$$file.{dejagnu}/ --tool gcc $* > /dev/null 2> /dev/null) || true" >> $@; \
echo "\t! egrep -q '^# of unexpected|RuntimeError' wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/gcc.log && touch wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/okay || (echo wasm32/cross/test/gcc/results/testsuite/$(dir $*)$$file; false)" >> $@; \
echo >> $@; \
all="$$all wasm32/cross/test/gcc/results/$(dir $*)$$file.{dejagnu}/okay"; \
done; \
echo "wasm32/gcc-testsuite/$*.all: $$all" >> $@
wasm32/cross/test/gcc/results/gcc.c-torture/compile/%: wasm32/cross/test/gcc/make/gcc.c-torture/compile/compile.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
wasm32/cross/test/gcc/results/gcc.c-torture/execute/%: wasm32/cross/test/gcc/make/gcc.c-torture/execute/execute.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
wasm32/cross/test/gcc/results/gcc.c-torture/execute/ieee/%: wasm32/cross/test/gcc/make/gcc.c-torture/execute/ieee/ieee.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
wasm32/cross/test/gcc/results/gcc.dg/%: wasm32/cross/test/gcc/make/gcc.dg/dg.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
wasm32/cross/test/gcc/results/gcc.dg/debug/dwarf2/%: wasm32/cross/test/gcc/make/gcc.dg/debug/dwarf2/dwarf2.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
wasm32/cross/test/gcc/results/gcc.dg/tls/%: wasm32/cross/test/gcc/make/gcc.dg/tls/tls.exp.{dejagnu}.mk
make -f $< $@ || (cat $(dir $@)/gcc.log > /dev/stderr; false)
GCC_PROBLEM_TESTS = \
gcc.c-torture/compile/20080625-1.c \
gcc.c-torture/execute/920428-2.c \
gcc.c-torture/execute/920501-7.c \
gcc.c-torture/execute/comp-goto-2.c \
gcc.c-torture/execute/ieee/copysign2.c \
gcc.c-torture/execute/ieee/copysign2.c \
gcc.c-torture/execute/nestfunc-5.c \
gcc.c-torture/execute/nestfunc-6.c \
gcc.dg/Warray-bounds-56.c \
gcc.dg/Warray-bounds-68.c \
gcc.dg/Wstringop-overflow-11.c \
gcc.dg/Wstringop-overflow-25.c \
gcc.dg/Wstringop-overflow-28.c \
gcc.dg/Wstringop-overflow-37.c \
gcc.dg/Wstringop-overflow-43.c \
gcc.dg/array-quals-1.c \
gcc.dg/atomic-lockfree.c \
gcc.dg/attr-alwaysinline.c \
gcc.dg/attr-externally-visible-1.c \
gcc.dg/attr-nonstring-2.c \
gcc.dg/attr-nonstring-3.c \
gcc.dg/attr-nonstring-4.c \
gcc.dg/builtins-1.c \
gcc.dg/builtins-12.c \
gcc.dg/builtins-16.c \
gcc.dg/builtins-61.c \
gcc.dg/builtins-68.c \
gcc.dg/builtins-85.c \
gcc.dg/c99-predef-1.c \
gcc.dg/c99-stdint-5.c \
gcc.dg/c99-stdint-6.c \
gcc.dg/cdce1.c \
gcc.dg/cdce2.c \
gcc.dg/cdce3.c \
gcc.dg/cleanup-6.c \
gcc.dg/debug/dwarf2/align-1.c \
gcc.dg/debug/dwarf2/align-2.c \
gcc.dg/debug/dwarf2/align-3.c \
gcc.dg/debug/dwarf2/align-4.c \
gcc.dg/debug/dwarf2/align-5.c \
gcc.dg/debug/dwarf2/align-6.c \
gcc.dg/debug/dwarf2/align-as-1.c \
gcc.dg/debug/dwarf2/aranges-fnsec-1.c \
gcc.dg/debug/dwarf2/array-0.c \
gcc.dg/debug/dwarf2/array-1.c \
gcc.dg/debug/dwarf2/array-2.c \
gcc.dg/debug/dwarf2/array-3.c \
gcc.dg/debug/dwarf2/asm-line1.c \
gcc.dg/debug/dwarf2/atomic.c \
gcc.dg/debug/dwarf2/c99-typedef1.c \
gcc.dg/debug/dwarf2/const-2.c \
gcc.dg/debug/dwarf2/const-2b.c \
gcc.dg/debug/dwarf2/discriminator.c \
gcc.dg/debug/dwarf2/dwarf-char1.c \
gcc.dg/debug/dwarf2/dwarf-char2.c \
gcc.dg/debug/dwarf2/dwarf-char3.c \
gcc.dg/debug/dwarf2/dwarf-dfp.c \
gcc.dg/debug/dwarf2/dwarf-die1.c \
gcc.dg/debug/dwarf2/dwarf-die2.c \
gcc.dg/debug/dwarf2/dwarf-die3.c \
gcc.dg/debug/dwarf2/dwarf-die5.c \
gcc.dg/debug/dwarf2/dwarf-die5.c \
gcc.dg/debug/dwarf2/dwarf-die6.c \
gcc.dg/debug/dwarf2/dwarf-die6.c \
gcc.dg/debug/dwarf2/dwarf-die7.c \
gcc.dg/debug/dwarf2/dwarf-die7.c \
gcc.dg/debug/dwarf2/dwarf-file1.c \
gcc.dg/debug/dwarf2/dwarf-file1.c \
gcc.dg/debug/dwarf2/dwarf-float.c \
gcc.dg/debug/dwarf2/dwarf-float.c \
gcc.dg/debug/dwarf2/dwarf-merge.c \
gcc.dg/debug/dwarf2/dwarf-merge.c \
gcc.dg/debug/dwarf2/dwarf-uninit.c \
gcc.dg/debug/dwarf2/dwarf-uninit.c \
gcc.dg/debug/dwarf2/dwarf2-3.c \
gcc.dg/debug/dwarf2/dwarf2-3.c \
gcc.dg/debug/dwarf2/dwarf2-macro.c \
gcc.dg/debug/dwarf2/dwarf2-macro.c \
gcc.dg/debug/dwarf2/dwarf2-macro2.c \
gcc.dg/debug/dwarf2/dwarf2-macro2.c \
gcc.dg/debug/dwarf2/enum-loc1.c \
gcc.dg/debug/dwarf2/enum-loc1.c \
gcc.dg/debug/dwarf2/fesd-any.c \
gcc.dg/debug/dwarf2/fesd-any.c \
gcc.dg/debug/dwarf2/fesd-baseonly.c \
gcc.dg/debug/dwarf2/fesd-baseonly.c \
gcc.dg/debug/dwarf2/fesd-none.c \
gcc.dg/debug/dwarf2/fesd-none.c \
gcc.dg/debug/dwarf2/fesd-reduced.c \
gcc.dg/debug/dwarf2/fesd-reduced.c \
gcc.dg/debug/dwarf2/fesd-sys.c \
gcc.dg/debug/dwarf2/fesd-sys.c \
gcc.dg/debug/dwarf2/global-used-types.c \
gcc.dg/debug/dwarf2/global-used-types.c \
gcc.dg/debug/dwarf2/inline1.c \
gcc.dg/debug/dwarf2/inline1.c \
gcc.dg/debug/dwarf2/inline2.c \
gcc.dg/debug/dwarf2/inline2.c \
gcc.dg/debug/dwarf2/inline3.c \
gcc.dg/debug/dwarf2/inline3.c \
gcc.dg/debug/dwarf2/inline4.c \
gcc.dg/debug/dwarf2/inline4.c \
gcc.dg/debug/dwarf2/inline5.c \
gcc.dg/debug/dwarf2/inline5.c \
gcc.dg/debug/dwarf2/inline6.c \
gcc.dg/debug/dwarf2/inline6.c \
gcc.dg/debug/dwarf2/ipa-cp1.c \
gcc.dg/debug/dwarf2/ipa-cp1.c \
gcc.dg/debug/dwarf2/lang-c11-d4-strict.c \
gcc.dg/debug/dwarf2/lang-c11-d4-strict.c \
gcc.dg/debug/dwarf2/lang-c11.c \
gcc.dg/debug/dwarf2/lang-c11.c \
gcc.dg/debug/dwarf2/lang-c89.c \
gcc.dg/debug/dwarf2/lang-c89.c \
gcc.dg/debug/dwarf2/lang-c99.c \
gcc.dg/debug/dwarf2/lang-c99.c \
gcc.dg/debug/dwarf2/nested_fun.c \
gcc.dg/debug/dwarf2/nested_fun.c \
gcc.dg/debug/dwarf2/noreturn-function-attribute.c \
gcc.dg/debug/dwarf2/noreturn-function-attribute.c \
gcc.dg/debug/dwarf2/noreturn-function-keyword.c \
gcc.dg/debug/dwarf2/noreturn-function-keyword.c \
gcc.dg/debug/dwarf2/omp-fesdr.c \
gcc.dg/debug/dwarf2/omp-fesdr.c \
gcc.dg/debug/dwarf2/pr29609-1.c \
gcc.dg/debug/dwarf2/pr29609-1.c \
gcc.dg/debug/dwarf2/pr29609-2.c \
gcc.dg/debug/dwarf2/pr29609-2.c \
gcc.dg/debug/dwarf2/pr31230.c \
gcc.dg/debug/dwarf2/pr31230.c \
gcc.dg/debug/dwarf2/pr36690-1.c \
gcc.dg/debug/dwarf2/pr36690-1.c \
gcc.dg/debug/dwarf2/pr36690-2.c \
gcc.dg/debug/dwarf2/pr36690-2.c \
gcc.dg/debug/dwarf2/pr36690-3.c \
gcc.dg/debug/dwarf2/pr36690-3.c \
gcc.dg/debug/dwarf2/pr37616.c \
gcc.dg/debug/dwarf2/pr37616.c \
gcc.dg/debug/dwarf2/pr41445-1.c \
gcc.dg/debug/dwarf2/pr41445-1.c \
gcc.dg/debug/dwarf2/pr41445-2.c \
gcc.dg/debug/dwarf2/pr41445-2.c \
gcc.dg/debug/dwarf2/pr41445-3.c \
gcc.dg/debug/dwarf2/pr41445-3.c \
gcc.dg/debug/dwarf2/pr41445-4.c \
gcc.dg/debug/dwarf2/pr41445-4.c \
gcc.dg/debug/dwarf2/pr41445-5.c \
gcc.dg/debug/dwarf2/pr41445-5.c \
gcc.dg/debug/dwarf2/pr41445-6.c \
gcc.dg/debug/dwarf2/pr41445-6.c \
gcc.dg/debug/dwarf2/pr41445-7.c \
gcc.dg/debug/dwarf2/pr41445-7.c \
gcc.dg/debug/dwarf2/pr41445-8.c \
gcc.dg/debug/dwarf2/pr41445-8.c \
gcc.dg/debug/dwarf2/pr41543.c \
gcc.dg/debug/dwarf2/pr41543.c \
gcc.dg/debug/dwarf2/pr41695.c \
gcc.dg/debug/dwarf2/pr41695.c \
gcc.dg/debug/dwarf2/pr43237.c \
gcc.dg/debug/dwarf2/pr43237.c \
gcc.dg/debug/dwarf2/pr47939-1.c \
gcc.dg/debug/dwarf2/pr47939-1.c \
gcc.dg/debug/dwarf2/pr47939-2.c \
gcc.dg/debug/dwarf2/pr47939-2.c \
gcc.dg/debug/dwarf2/pr47939-3.c \
gcc.dg/debug/dwarf2/pr47939-3.c \
gcc.dg/debug/dwarf2/pr47939-4.c \
gcc.dg/debug/dwarf2/pr47939-4.c \
gcc.dg/debug/dwarf2/pr49871.c \
gcc.dg/debug/dwarf2/pr49871.c \
gcc.dg/debug/dwarf2/pr51410.c \
gcc.dg/debug/dwarf2/pr51410.c \
gcc.dg/debug/dwarf2/pr53948.c \
gcc.dg/debug/dwarf2/pr53948.c \
gcc.dg/debug/dwarf2/pr66482.c \
gcc.dg/debug/dwarf2/pr66482.c \
gcc.dg/debug/dwarf2/pr71855.c \
gcc.dg/debug/dwarf2/pr71855.c \
gcc.dg/debug/dwarf2/pr80263.c \
gcc.dg/debug/dwarf2/pr80263.c \
gcc.dg/debug/dwarf2/pr82718-1.c \
gcc.dg/debug/dwarf2/pr82718-1.c \
gcc.dg/debug/dwarf2/pr82718-2.c \
gcc.dg/debug/dwarf2/pr82718-2.c \
gcc.dg/debug/dwarf2/pr82837.c \
gcc.dg/debug/dwarf2/pr82837.c \
gcc.dg/debug/dwarf2/pr86964.c \
gcc.dg/debug/dwarf2/pr86964.c \
gcc.dg/debug/dwarf2/pr88635.c \
gcc.dg/debug/dwarf2/pr88635.c \
gcc.dg/debug/dwarf2/pr88644.c \
gcc.dg/debug/dwarf2/pr88644.c \
gcc.dg/debug/dwarf2/pr93751-1.c \
gcc.dg/debug/dwarf2/pr93751-1.c \
gcc.dg/debug/dwarf2/pr93751-2.c \
gcc.dg/debug/dwarf2/pr93751-2.c \
gcc.dg/debug/dwarf2/pr96383-1.c \
gcc.dg/debug/dwarf2/pr96383-1.c \
gcc.dg/debug/dwarf2/pr96383-2.c \
gcc.dg/debug/dwarf2/pr96383-2.c \
gcc.dg/debug/dwarf2/pr97060.c \
gcc.dg/debug/dwarf2/pr97060.c \
gcc.dg/debug/dwarf2/prod-options.c \
gcc.dg/debug/dwarf2/prod-options.c \
gcc.dg/debug/dwarf2/short-circuit.c \
gcc.dg/debug/dwarf2/short-circuit.c \
gcc.dg/debug/dwarf2/sso-1.c \
gcc.dg/debug/dwarf2/sso-1.c \
gcc.dg/debug/dwarf2/sso-2.c \
gcc.dg/debug/dwarf2/sso-2.c \
gcc.dg/debug/dwarf2/sso-3.c \
gcc.dg/debug/dwarf2/sso-3.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-1.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-1.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-2.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-2.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-3.c \
gcc.dg/debug/dwarf2/stacked-qualified-types-3.c \
gcc.dg/debug/dwarf2/static1.c \
gcc.dg/debug/dwarf2/static1.c \
gcc.dg/debug/dwarf2/struct-loc1.c \
gcc.dg/debug/dwarf2/struct-loc1.c \
gcc.dg/debug/dwarf2/var1.c \
gcc.dg/debug/dwarf2/var1.c \
gcc.dg/debug/dwarf2/var2.c \
gcc.dg/debug/dwarf2/var2.c \
gcc.dg/fold-and-1.c \
gcc.dg/fold-and-2.c \
gcc.dg/fold-ior-1.c \
gcc.dg/fold-minus-2.c \
gcc.dg/fold-minus-3.c \
gcc.dg/fold-minus-4.c \
gcc.dg/fold-minus-5.c \
gcc.dg/fold-plus-1.c \
gcc.dg/fold-plus-2.c \
gcc.dg/fold-xor-3.c \
gcc.dg/fold-xor-4.c \
gcc.dg/fold-xor-5.c \
gcc.dg/funcorder.c \
gcc.dg/gimplefe-18.c \
gcc.dg/gimplefe-18.c \
gcc.dg/gimplefe-21.c \
gcc.dg/gimplefe-21.c \
gcc.dg/gimplefe-30.c \
gcc.dg/ifcvt-4.c \
gcc.dg/ifcvt-4.c \
gcc.dg/inline-1.c \
gcc.dg/inline-3.c \
gcc.dg/loop-9.c \
gcc.dg/loop-9.c \
gcc.dg/noreorder3.c \
gcc.dg/old-style-asm-1.c \
gcc.dg/opts-2.c \
gcc.dg/opts-2.c \
gcc.dg/param-type-mismatch.c \
gcc.dg/param-type-mismatch.c \
gcc.dg/pr16107.c \
gcc.dg/pr25376.c \
gcc.dg/pr25376.c \
gcc.dg/pr25795-1.c \
gcc.dg/pr27528.c \
gcc.dg/pr27528.c \
gcc.dg/pr28685-1.c \
gcc.dg/pr30643.c \
gcc.dg/pr30957-1.c \
gcc.dg/pr30957-1.c \
gcc.dg/pr33645-2.c \
gcc.dg/pr39443.c \
gcc.dg/pr52171.c \
gcc.dg/pr57134.c \
gcc.dg/pr57134.c \
gcc.dg/pr60087.c \
gcc.dg/pr60087.c \
gcc.dg/pr63387-2.c \
gcc.dg/pr63387.c \
gcc.dg/pr64295.c \
gcc.dg/pr64295.c \
gcc.dg/pr66299-2.c \
gcc.dg/pr70017.c \
gcc.dg/pr70017.c \
gcc.dg/pr78902.c \
gcc.dg/pr78902.c \
gcc.dg/pr81281-1.c \
gcc.dg/pr81281-2.c \
gcc.dg/pr82404.c \
gcc.dg/pr82404.c \
gcc.dg/pr87811-3.c \
gcc.dg/pr87811-3.c \
gcc.dg/pr93210.c \
gcc.dg/pr93210.c \
gcc.dg/pr93399.c \
gcc.dg/pr94600-3.c \
gcc.dg/pr94600-5.c \
gcc.dg/pr94600-7.c \
gcc.dg/pr98721-2.c \
gcc.dg/pr98721-2.c \
gcc.dg/pragma-re-1.c \
gcc.dg/pragma-re-4.c \
gcc.dg/profile-info-section.c \
gcc.dg/profile-info-section.c \
gcc.dg/pthread-init-1.c \
gcc.dg/pthread-init-2.c \
gcc.dg/recip_sqrt_mult_2.c \
gcc.dg/sibcall-10.c \
gcc.dg/sibcall-10.c \
gcc.dg/sibcall-9.c \
gcc.dg/sibcall-9.c \
gcc.dg/stack-usage-1.c \
gcc.dg/stack-usage-1.c \
gcc.dg/strlenopt-40.c \
gcc.dg/strlenopt-44.c \
gcc.dg/strlenopt-70.c \
gcc.dg/type-convert-var.c \
gcc.dg/typeof-1.c \
gcc.dg/uninit-1-O0.c \
gcc.dg/uninit-11-O0.c \
gcc.dg/uninit-11-O0.c \
gcc.dg/uninit-13-O0.c \
gcc.dg/uninit-13-O0.c \
gcc.dg/uninit-15-O0.c \
gcc.dg/uninit-15-O0.c \
gcc.dg/uninit-17-O0.c \
gcc.dg/uninit-17-O0.c \
gcc.dg/uninit-3-O0.c \
gcc.dg/uninit-6-O0.c \
gcc.dg/uninit-6-O0.c \
gcc.dg/unroll-8.c \
gcc.dg/unwind-1.c \
gcc.dg/unwind-1.c \
gcc.dg/var-expand1.c \
gcc.dg/var-expand1.c \
gcc.dg/varpool-1.c
# This rule isn't perfect, it tars up data it might not have written.
wasm32/cross/test/gcc/problem.tar:
$(MAKE) -k $(GCC_PROBLEM_TESTS:%=wasm32/cross/test/gcc/results/%.{dejagnu}/okay) || true
tar cf $@ wasm32/cross/test/gcc/results
# No sibcalls yet
GCC_BAD_TESTS = \
gcc.dg/lto/20091216-1_0.c \
gcc.dg/pr78902.c \
gcc.dg/sibcall-9.c \
gcc.dg/sibcall-10.c \
gcc.dg/unwind-1.c \
gcc.c-torture/execute/920428-2.c \
gcc.c-torture/execute/920501-7.c \
gcc.c-torture/execute/comp-goto-2.c \
gcc.c-torture/execute/nestfunc-5.c \
gcc.c-torture/execute/nestfunc-6.c \
GCC_BAD_TESTSUITES = \
gcc.c-torture/execute/builtins/builtins.exp \
gcc.dg/compat/compat.exp \
gcc.dg/dfp/dfp.exp \
gcc.dg/fixed-point/fixed-point.exp \
gcc.dg/ipa/ipa.exp \
gcc.dg/special/mips-abi.exp \
gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp \
gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp \
gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp \
gcc.dg/vmx/vmx.exp \
gcc.dg/vxworks/vxworks.exp \
GCC_TESTSUITES = \
gcc.c-torture/compile/compile.exp \
gcc.c-torture/execute/execute.exp \
gcc.c-torture/execute/ieee/ieee.exp \
gcc.c-torture/unsorted/unsorted.exp \
gcc.dg/asan/asan.exp \
gcc.dg/atomic/atomic.exp \
gcc.dg/autopar/autopar.exp \
gcc.dg/charset/charset.exp \
gcc.dg/cpp/cpp.exp \
gcc.dg/debug/debug.exp \
gcc.dg/debug/dwarf2/dwarf2.exp \
gcc.dg/dg.exp \
gcc.dg/format/format.exp \
gcc.dg/goacc-gomp/goacc-gomp.exp \
gcc.dg/goacc/goacc.exp \
gcc.dg/gomp/gomp.exp \
gcc.dg/graphite/graphite.exp \
gcc.dg/guality/guality.exp \
gcc.dg/hwasan/hwasan.exp \
gcc.dg/lto/lto.exp \
gcc.dg/noncompile/noncompile.exp \
gcc.dg/params/params.exp \
gcc.dg/pch/pch.exp \
gcc.dg/plugin/plugin.exp \
gcc.dg/rtl/rtl.exp \
gcc.dg/sancov/sancov.exp \
gcc.dg/simulate-thread/simulate-thread.exp \
gcc.dg/special/special.exp \
gcc.dg/sso/sso.exp \
gcc.dg/tls/tls.exp \
gcc.dg/tm/tm.exp \
gcc.dg/torture/dg-torture.exp \
gcc.dg/torture/stackalign/stackalign.exp \
gcc.dg/torture/tls/tls.exp \
gcc.dg/tree-prof/tree-prof.exp \
gcc.dg/tree-ssa/tree-ssa.exp \
gcc.dg/tsan/tsan.exp \
gcc.dg/ubsan/ubsan.exp \
gcc.dg/vect/complex/complex.exp \
gcc.dg/vect/vect.exp \
gcc.dg/weak/weak.exp
TOOLS_c = bitpush wasmextract wasmrewrite wasmsect
TOOLS_cc =
TOOLS_script = cflags dotdir dyninfo elf32-wasm32 elf-to-wasm jsc locked run-elf-wasm32 testsuite-make-fragment wasm
$(patsubst %,wasm32/cross/bin/%,$(TOOLS_c)): wasm32/cross/bin/%: tools/src/%.c | wasm32/cross/bin
gcc -Wall -g3 $< -o $@
$(patsubst %,wasm32/cross/bin/%,$(TOOLS_cc)): wasm32/cross/bin/%: tools/src/%.cc | wasm32/cross/bin
g++ -Wall -g3 $< -o $@
$(patsubst %,wasm32/cross/bin/%,$(TOOLS_script)): wasm32/cross/bin/%: tools/bin/% | wasm32/cross/bin
cp -a $< $@ && chmod u+x $@
wasm32/wasm/bin/%: wasm32/native/bin/%
$(MKDIR) $(dir wasm32/wasm/bin/$*)
wasm32/cross/bin/elf-to-wasm --executable --dynamic --output $@ $<
wasm32/wasm/%.so: wasm32/native/%.so | wasm32/cross/bin/elf-to-wasm wasm32/cross/bin/wasmrewrite wasm32/cross/bin/wasmsect wasm32/cross/bin/dyninfo wasm32/cross/lib/wasm32-lds/wasm32.lds wasm32/cross/lib/wasm32-lds/wasm32-wasmify.lds wasm32/cross/bin/wasm wasm32/cross/bin/elf32-wasm32
$(MKDIR) $(dir wasm32/wasm/$*)
wasm32/cross/bin/elf-to-wasm --library --dynamic --output $@ $<
wasm32/wasm/%.so.1: wasm32/native/%.so.1 | wasm32/cross/bin/elf-to-wasm wasm32/cross/bin/wasmrewrite wasm32/cross/bin/wasmsect wasm32/cross/bin/dyninfo wasm32/cross/lib/wasm32-lds/wasm32.lds wasm32/cross/lib/wasm32-lds/wasm32-wasmify.lds wasm32/cross/bin/wasm wasm32/cross/bin/elf32-wasm32
$(MKDIR) $(dir wasm32/wasm/$*)
wasm32/cross/bin/elf-to-wasm --library --dynamic --output $@ $<
wasm32/wasm/%.so.2: wasm32/native/%.so.2 | wasm32/cross/bin/elf-to-wasm wasm32/cross/bin/wasmrewrite wasm32/cross/bin/wasmsect wasm32/cross/bin/dyninfo wasm32/cross/lib/wasm32-lds/wasm32.lds wasm32/cross/lib/wasm32-lds/wasm32-wasmify.lds wasm32/cross/bin/wasm wasm32/cross/bin/elf32-wasm32