@@ -22,6 +22,16 @@ function ci_gcc_riscv_setup {
22
22
riscv64-unknown-elf-gcc --version
23
23
}
24
24
25
+ function ci_gcc_plugin_setup {
26
+ if [ $# -eq 0 ]; then
27
+ GCC_VER=$( echo __GNUC__ | gcc -P -E -)
28
+ sudo apt-get install gcc-${GCC_VER} -plugin-dev
29
+ else
30
+ GCC_VER=$( echo __GNUC__ | ${1} -gcc -P -E -)
31
+ sudo apt-get install gcc-${GCC_VER} -plugin-dev-${1}
32
+ fi
33
+ }
34
+
25
35
function ci_picotool_setup {
26
36
# Manually installing picotool ensures we use a release version, and speeds up the build.
27
37
git clone https://github.com/raspberrypi/pico-sdk.git
@@ -126,6 +136,7 @@ function ci_mpy_format_setup {
126
136
sudo apt-get update
127
137
sudo apt-get install python2.7
128
138
sudo pip3 install pyelftools
139
+ ci_gcc_plugin_setup
129
140
python2.7 --version
130
141
python3 --version
131
142
}
@@ -615,12 +626,15 @@ function ci_unix_coverage_setup {
615
626
pip3 install setuptools
616
627
pip3 install pyelftools
617
628
pip3 install ar
629
+ ci_gcc_plugin_setup
618
630
gcc --version
619
631
python3 --version
620
632
}
621
633
622
634
function ci_unix_coverage_build {
623
- ci_unix_build_helper VARIANT=coverage
635
+ # (Ensure mpy-cross is built with the plugin too)
636
+ make ${MAKEOPTS} -C mpy-cross MICROPY_USE_COMPILER_PLUGIN=gcc
637
+ ci_unix_build_helper VARIANT=coverage MICROPY_USE_COMPILER_PLUGIN=gcc
624
638
ci_unix_build_ffi_lib_helper gcc
625
639
}
626
640
@@ -661,6 +675,7 @@ function ci_unix_32bit_setup {
661
675
sudo dpkg --add-architecture i386
662
676
sudo apt-get update
663
677
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
678
+ ci_gcc_plugin_setup
664
679
sudo pip3 install setuptools
665
680
sudo pip3 install pyelftools
666
681
sudo pip3 install ar
@@ -670,7 +685,7 @@ function ci_unix_32bit_setup {
670
685
}
671
686
672
687
function ci_unix_coverage_32bit_build {
673
- ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1
688
+ ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 MICROPY_USE_COMPILER_PLUGIN=gcc
674
689
ci_unix_build_ffi_lib_helper gcc -m32
675
690
}
676
691
@@ -684,16 +699,20 @@ function ci_unix_coverage_32bit_run_native_mpy_tests {
684
699
685
700
function ci_unix_nanbox_build {
686
701
# Use Python 2 to check that it can run the build scripts
687
- ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1"
702
+ ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1" MICROPY_USE_COMPILER_PLUGIN=gcc
688
703
ci_unix_build_ffi_lib_helper gcc -m32
689
704
}
690
705
691
706
function ci_unix_nanbox_run_tests {
692
707
ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
693
708
}
694
709
710
+ function ci_unix_float_setup {
711
+ ci_gcc_plugin_setup
712
+ }
713
+
695
714
function ci_unix_float_build {
696
- ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
715
+ ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" MICROPY_USE_COMPILER_PLUGIN=gcc
697
716
ci_unix_build_ffi_lib_helper gcc
698
717
}
699
718
@@ -765,8 +784,8 @@ function ci_unix_macos_build {
765
784
# make ${MAKEOPTS} -C ports/unix deplibs
766
785
make ${MAKEOPTS} -C ports/unix
767
786
# check for additional compiler errors/warnings
768
- make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules
769
- make ${MAKEOPTS} -C ports/unix VARIANT=coverage
787
+ make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules DISABLE_PLUGIN=1
788
+ make ${MAKEOPTS} -C ports/unix VARIANT=coverage DISABLE_PLUGIN=1
770
789
}
771
790
772
791
function ci_unix_macos_run_tests {
@@ -778,15 +797,16 @@ function ci_unix_macos_run_tests {
778
797
779
798
function ci_unix_qemu_mips_setup {
780
799
sudo apt-get update
781
- sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
800
+ sudo apt-get install gcc-10- mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
782
801
sudo apt-get install qemu-user
802
+ ci_gcc_plugin_setup mips-linux-gnu
783
803
qemu-mips --version
784
804
sudo mkdir /etc/qemu-binfmt
785
805
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
786
806
}
787
807
788
808
function ci_unix_qemu_mips_build {
789
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} "
809
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
790
810
ci_unix_build_ffi_lib_helper mips-linux-gnu-gcc
791
811
}
792
812
@@ -799,13 +819,14 @@ function ci_unix_qemu_arm_setup {
799
819
sudo apt-get update
800
820
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
801
821
sudo apt-get install qemu-user
822
+ ci_gcc_plugin_setup arm-linux-gnueabi
802
823
qemu-arm --version
803
824
sudo mkdir /etc/qemu-binfmt
804
825
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
805
826
}
806
827
807
828
function ci_unix_qemu_arm_build {
808
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} "
829
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
809
830
ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc
810
831
}
811
832
@@ -820,13 +841,14 @@ function ci_unix_qemu_riscv64_setup {
820
841
sudo apt-get update
821
842
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
822
843
sudo apt-get install qemu-user
844
+ ci_gcc_plugin_setup riscv64-linux-gnu
823
845
qemu-riscv64 --version
824
846
sudo mkdir /etc/qemu-binfmt
825
847
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
826
848
}
827
849
828
850
function ci_unix_qemu_riscv64_build {
829
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} "
851
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
830
852
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
831
853
}
832
854
@@ -845,7 +867,7 @@ function ci_windows_setup {
845
867
function ci_windows_build {
846
868
make ${MAKEOPTS} -C mpy-cross
847
869
make ${MAKEOPTS} -C ports/windows submodules
848
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
870
+ make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=${1- i686} -w64-mingw32- MICROPY_USE_COMPILER_PLUGIN=gcc
849
871
}
850
872
851
873
# #######################################################################################
0 commit comments