@@ -24,6 +24,16 @@ function ci_gcc_riscv_setup {
24
24
riscv64-unknown-elf-gcc --version
25
25
}
26
26
27
+ function ci_gcc_plugin_setup {
28
+ if [ $# -eq 0 ]; then
29
+ GCC_VER=$( echo __GNUC__ | gcc -P -E -)
30
+ sudo apt-get install gcc-${GCC_VER} -plugin-dev
31
+ else
32
+ GCC_VER=$( echo __GNUC__ | ${1} -gcc -P -E -)
33
+ sudo apt-get install gcc-${GCC_VER} -plugin-dev-${1}
34
+ fi
35
+ }
36
+
27
37
function ci_picotool_setup {
28
38
# Manually installing picotool ensures we use a release version, and speeds up the build.
29
39
git clone https://github.com/raspberrypi/pico-sdk.git
@@ -129,6 +139,7 @@ function ci_mpy_format_setup {
129
139
sudo apt-get update
130
140
sudo apt-get install python2.7
131
141
sudo pip3 install pyelftools
142
+ ci_gcc_plugin_setup
132
143
python2.7 --version
133
144
python3 --version
134
145
}
@@ -269,11 +280,11 @@ function ci_mimxrt_setup {
269
280
function ci_mimxrt_build {
270
281
make ${MAKEOPTS} -C mpy-cross
271
282
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK submodules
272
- make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK
283
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK MICROPY_USE_COMPILER_PLUGIN=gcc
273
284
make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 submodules
274
- make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40
285
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 MICROPY_USE_COMPILER_PLUGIN=gcc
275
286
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK submodules
276
- make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK CFLAGS_EXTRA=-DMICROPY_HW_USB_MSC=1
287
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK CFLAGS_EXTRA=-DMICROPY_HW_USB_MSC=1 MICROPY_USE_COMPILER_PLUGIN=gcc
277
288
}
278
289
279
290
# #######################################################################################
@@ -287,10 +298,10 @@ function ci_nrf_build {
287
298
ports/nrf/drivers/bluetooth/download_ble_stack.sh s140_nrf52_6_1_1
288
299
make ${MAKEOPTS} -C mpy-cross
289
300
make ${MAKEOPTS} -C ports/nrf submodules
290
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10040
291
- make ${MAKEOPTS} -C ports/nrf BOARD=MICROBIT
292
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10056 SD=s140
293
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10090
301
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10040 MICROPY_USE_COMPILER_PLUGIN=gcc
302
+ make ${MAKEOPTS} -C ports/nrf BOARD=MICROBIT MICROPY_USE_COMPILER_PLUGIN=gcc
303
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10056 SD=s140 MICROPY_USE_COMPILER_PLUGIN=gcc
304
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10090 MICROPY_USE_COMPILER_PLUGIN=gcc
294
305
}
295
306
296
307
# #######################################################################################
@@ -299,11 +310,12 @@ function ci_nrf_build {
299
310
function ci_powerpc_setup {
300
311
sudo apt-get update
301
312
sudo apt-get install gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
313
+ ci_gcc_plugin_setup powerpc64le-linux-gnu
302
314
}
303
315
304
316
function ci_powerpc_build {
305
- make ${MAKEOPTS} -C ports/powerpc UART=potato
306
- make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial
317
+ make ${MAKEOPTS} -C ports/powerpc UART=potato MICROPY_USE_COMPILER_PLUGIN=gcc
318
+ make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial MICROPY_USE_COMPILER_PLUGIN=gcc
307
319
}
308
320
309
321
# #######################################################################################
@@ -334,17 +346,17 @@ function ci_qemu_build_arm_prepare {
334
346
335
347
function ci_qemu_build_arm_bigendian {
336
348
ci_qemu_build_arm_prepare
337
- make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1
349
+ make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1 MICROPY_USE_COMPILER_PLUGIN=gcc
338
350
}
339
351
340
352
function ci_qemu_build_arm_sabrelite {
341
353
ci_qemu_build_arm_prepare
342
- make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test_full
354
+ make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test_full MICROPY_USE_COMPILER_PLUGIN=gcc
343
355
}
344
356
345
357
function ci_qemu_build_arm_thumb {
346
358
ci_qemu_build_arm_prepare
347
- make ${MAKEOPTS} -C ports/qemu test_full
359
+ make ${MAKEOPTS} -C ports/qemu test_full MICROPY_USE_COMPILER_PLUGIN=gcc
348
360
349
361
# Test building and running native .mpy with armv7m architecture.
350
362
ci_native_mpy_modules_build armv7m
@@ -354,7 +366,7 @@ function ci_qemu_build_arm_thumb {
354
366
function ci_qemu_build_rv32 {
355
367
make ${MAKEOPTS} -C mpy-cross
356
368
make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 submodules
357
- make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 test_full
369
+ make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 test_full MICROPY_USE_COMPILER_PLUGIN=gcc
358
370
359
371
# Test building and running native .mpy with rv32imc architecture.
360
372
ci_native_mpy_modules_build rv32imc
@@ -372,13 +384,13 @@ function ci_renesas_ra_setup {
372
384
function ci_renesas_ra_board_build {
373
385
make ${MAKEOPTS} -C mpy-cross
374
386
make ${MAKEOPTS} -C ports/renesas-ra submodules
375
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=RA4M1_CLICKER
376
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M2
377
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M1
378
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4M1
379
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4W1
387
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=RA4M1_CLICKER MICROPY_USE_COMPILER_PLUGIN=gcc
388
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M2 MICROPY_USE_COMPILER_PLUGIN=gcc
389
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M1 MICROPY_USE_COMPILER_PLUGIN=gcc
390
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4M1 MICROPY_USE_COMPILER_PLUGIN=gcc
391
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4W1 MICROPY_USE_COMPILER_PLUGIN=gcc
380
392
make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33 submodules
381
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33
393
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33 MICROPY_USE_COMPILER_PLUGIN=gcc
382
394
}
383
395
384
396
# #######################################################################################
@@ -416,8 +428,8 @@ function ci_samd_setup {
416
428
function ci_samd_build {
417
429
make ${MAKEOPTS} -C mpy-cross
418
430
make ${MAKEOPTS} -C ports/samd submodules
419
- make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M0_EXPRESS
420
- make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M4_EXPRESS
431
+ make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M0_EXPRESS MICROPY_USE_COMPILER_PLUGIN=gcc
432
+ make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M4_EXPRESS MICROPY_USE_COMPILER_PLUGIN=gcc
421
433
}
422
434
423
435
# #######################################################################################
@@ -436,12 +448,12 @@ function ci_stm32_pyb_build {
436
448
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 submodules
437
449
git submodule update --init lib/btstack
438
450
git submodule update --init lib/mynewt-nimble
439
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 USER_C_MODULES=../../examples/usercmodule
440
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
441
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF6 COPT=-O2 NANBOX=1 MICROPY_BLUETOOTH_NIMBLE=0 MICROPY_BLUETOOTH_BTSTACK=1
442
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA=' -DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1'
443
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6
444
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=STM32F769DISC CFLAGS_EXTRA=' -DMBOOT_ADDRESS_SPACE_64BIT=1 -DMBOOT_SDCARD_ADDR=0x100000000ULL -DMBOOT_SDCARD_BYTE_SIZE=0x400000000ULL -DMBOOT_FSLOAD=1 -DMBOOT_VFS_FAT=1'
451
+ make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 USER_C_MODULES=../../examples/usercmodule MICROPY_USE_COMPILER_PLUGIN=gcc
452
+ make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 MICROPY_USE_COMPILER_PLUGIN=gcc
453
+ make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF6 COPT=-O2 NANBOX=1 MICROPY_BLUETOOTH_NIMBLE=0 MICROPY_BLUETOOTH_BTSTACK=1 MICROPY_USE_COMPILER_PLUGIN=gcc
454
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA=' -DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1' MICROPY_USE_COMPILER_PLUGIN=gcc
455
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6 MICROPY_USE_COMPILER_PLUGIN=gcc
456
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=STM32F769DISC CFLAGS_EXTRA=' -DMBOOT_ADDRESS_SPACE_64BIT=1 -DMBOOT_SDCARD_ADDR=0x100000000ULL -DMBOOT_SDCARD_BYTE_SIZE=0x400000000ULL -DMBOOT_FSLOAD=1 -DMBOOT_VFS_FAT=1' MICROPY_USE_COMPILER_PLUGIN=gcc
445
457
446
458
# Test building native .mpy with armv7emsp architecture.
447
459
git submodule update --init lib/berkeley-db-1.xx
@@ -454,15 +466,15 @@ function ci_stm32_nucleo_build {
454
466
git submodule update --init lib/mynewt-nimble
455
467
456
468
# Test building various MCU families, some with additional options.
457
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC
458
- make ${MAKEOPTS} -C ports/stm32 BOARD=STM32H573I_DK
459
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI COPT=-O2 CFLAGS_EXTRA=' -DMICROPY_PY_THREAD=1'
460
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L073RZ
461
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L476RG DEBUG=1
469
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC MICROPY_USE_COMPILER_PLUGIN=gcc
470
+ make ${MAKEOPTS} -C ports/stm32 BOARD=STM32H573I_DK MICROPY_USE_COMPILER_PLUGIN=gcc
471
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI COPT=-O2 CFLAGS_EXTRA=' -DMICROPY_PY_THREAD=1' MICROPY_USE_COMPILER_PLUGIN=gcc
472
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L073RZ MICROPY_USE_COMPILER_PLUGIN=gcc
473
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L476RG DEBUG=1 MICROPY_USE_COMPILER_PLUGIN=gcc
462
474
463
475
# Test building a board with mboot packing enabled (encryption, signing, compression).
464
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1
465
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1
476
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1 MICROPY_USE_COMPILER_PLUGIN=gcc
477
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1 MICROPY_USE_COMPILER_PLUGIN=gcc
466
478
# Test mboot_pack_dfu.py created a valid file, and that its unpack-dfu command works.
467
479
BOARD_WB55=ports/stm32/boards/NUCLEO_WB55
468
480
BUILD_WB55=ports/stm32/build-NUCLEO_WB55
@@ -477,7 +489,7 @@ function ci_stm32_nucleo_build {
477
489
function ci_stm32_misc_build {
478
490
make ${MAKEOPTS} -C mpy-cross
479
491
make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA submodules
480
- make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA
492
+ make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA MICROPY_USE_COMPILER_PLUGIN=gcc
481
493
}
482
494
483
495
# #######################################################################################
@@ -618,12 +630,15 @@ function ci_unix_coverage_setup {
618
630
pip3 install setuptools
619
631
pip3 install pyelftools
620
632
pip3 install ar
633
+ ci_gcc_plugin_setup
621
634
gcc --version
622
635
python3 --version
623
636
}
624
637
625
638
function ci_unix_coverage_build {
626
- ci_unix_build_helper VARIANT=coverage
639
+ # (Ensure mpy-cross is built with the plugin too)
640
+ make ${MAKEOPTS} -C mpy-cross MICROPY_USE_COMPILER_PLUGIN=gcc
641
+ ci_unix_build_helper VARIANT=coverage MICROPY_USE_COMPILER_PLUGIN=gcc
627
642
ci_unix_build_ffi_lib_helper gcc
628
643
}
629
644
@@ -664,6 +679,7 @@ function ci_unix_32bit_setup {
664
679
sudo dpkg --add-architecture i386
665
680
sudo apt-get update
666
681
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
682
+ ci_gcc_plugin_setup
667
683
sudo pip3 install setuptools
668
684
sudo pip3 install pyelftools
669
685
sudo pip3 install ar
@@ -673,7 +689,7 @@ function ci_unix_32bit_setup {
673
689
}
674
690
675
691
function ci_unix_coverage_32bit_build {
676
- ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1
692
+ ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 MICROPY_USE_COMPILER_PLUGIN=gcc
677
693
ci_unix_build_ffi_lib_helper gcc -m32
678
694
}
679
695
@@ -687,7 +703,7 @@ function ci_unix_coverage_32bit_run_native_mpy_tests {
687
703
688
704
function ci_unix_nanbox_build {
689
705
# Use Python 2 to check that it can run the build scripts
690
- ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1"
706
+ ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1" MICROPY_USE_COMPILER_PLUGIN=gcc
691
707
ci_unix_build_ffi_lib_helper gcc -m32
692
708
}
693
709
@@ -696,15 +712,19 @@ function ci_unix_nanbox_run_tests {
696
712
}
697
713
698
714
function ci_unix_longlong_build {
699
- ci_unix_build_helper VARIANT=longlong
715
+ ci_unix_build_helper VARIANT=longlong MICROPY_USE_COMPILER_PLUGIN=gcc
700
716
}
701
717
702
718
function ci_unix_longlong_run_tests {
703
719
ci_unix_run_tests_full_helper longlong
704
720
}
705
721
722
+ function ci_unix_float_setup {
723
+ ci_gcc_plugin_setup
724
+ }
725
+
706
726
function ci_unix_float_build {
707
- ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
727
+ ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" MICROPY_USE_COMPILER_PLUGIN=gcc
708
728
ci_unix_build_ffi_lib_helper gcc
709
729
}
710
730
@@ -790,15 +810,16 @@ function ci_unix_macos_run_tests {
790
810
791
811
function ci_unix_qemu_mips_setup {
792
812
sudo apt-get update
793
- sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
813
+ sudo apt-get install gcc-10- mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
794
814
sudo apt-get install qemu-user
815
+ ci_gcc_plugin_setup mips-linux-gnu
795
816
qemu-mips --version
796
817
sudo mkdir /etc/qemu-binfmt
797
818
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
798
819
}
799
820
800
821
function ci_unix_qemu_mips_build {
801
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} "
822
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
802
823
ci_unix_build_ffi_lib_helper mips-linux-gnu-gcc
803
824
}
804
825
@@ -811,13 +832,14 @@ function ci_unix_qemu_arm_setup {
811
832
sudo apt-get update
812
833
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
813
834
sudo apt-get install qemu-user
835
+ ci_gcc_plugin_setup arm-linux-gnueabi
814
836
qemu-arm --version
815
837
sudo mkdir /etc/qemu-binfmt
816
838
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
817
839
}
818
840
819
841
function ci_unix_qemu_arm_build {
820
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} "
842
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
821
843
ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc
822
844
}
823
845
@@ -832,13 +854,14 @@ function ci_unix_qemu_riscv64_setup {
832
854
sudo apt-get update
833
855
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
834
856
sudo apt-get install qemu-user
857
+ ci_gcc_plugin_setup riscv64-linux-gnu
835
858
qemu-riscv64 --version
836
859
sudo mkdir /etc/qemu-binfmt
837
860
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
838
861
}
839
862
840
863
function ci_unix_qemu_riscv64_build {
841
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} "
864
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
842
865
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
843
866
}
844
867
@@ -858,7 +881,7 @@ function ci_windows_setup {
858
881
function ci_windows_build {
859
882
make ${MAKEOPTS} -C mpy-cross
860
883
make ${MAKEOPTS} -C ports/windows submodules
861
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
884
+ make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=${1- i686} -w64-mingw32- MICROPY_USE_COMPILER_PLUGIN=gcc
862
885
}
863
886
864
887
# #######################################################################################
0 commit comments