@@ -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
# #######################################################################################
@@ -612,12 +624,15 @@ function ci_unix_coverage_setup {
612
624
pip3 install setuptools
613
625
pip3 install pyelftools
614
626
pip3 install ar
627
+ ci_gcc_plugin_setup
615
628
gcc --version
616
629
python3 --version
617
630
}
618
631
619
632
function ci_unix_coverage_build {
620
- ci_unix_build_helper VARIANT=coverage
633
+ # (Ensure mpy-cross is built with the plugin too)
634
+ make ${MAKEOPTS} -C mpy-cross MICROPY_USE_COMPILER_PLUGIN=gcc
635
+ ci_unix_build_helper VARIANT=coverage MICROPY_USE_COMPILER_PLUGIN=gcc
621
636
ci_unix_build_ffi_lib_helper gcc
622
637
}
623
638
@@ -658,6 +673,7 @@ function ci_unix_32bit_setup {
658
673
sudo dpkg --add-architecture i386
659
674
sudo apt-get update
660
675
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
676
+ ci_gcc_plugin_setup
661
677
sudo pip3 install setuptools
662
678
sudo pip3 install pyelftools
663
679
sudo pip3 install ar
@@ -667,7 +683,7 @@ function ci_unix_32bit_setup {
667
683
}
668
684
669
685
function ci_unix_coverage_32bit_build {
670
- ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1
686
+ ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 MICROPY_USE_COMPILER_PLUGIN=gcc
671
687
ci_unix_build_ffi_lib_helper gcc -m32
672
688
}
673
689
@@ -681,7 +697,7 @@ function ci_unix_coverage_32bit_run_native_mpy_tests {
681
697
682
698
function ci_unix_nanbox_build {
683
699
# Use Python 2 to check that it can run the build scripts
684
- ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1"
700
+ ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1" MICROPY_USE_COMPILER_PLUGIN=gcc
685
701
ci_unix_build_ffi_lib_helper gcc -m32
686
702
}
687
703
@@ -690,15 +706,19 @@ function ci_unix_nanbox_run_tests {
690
706
}
691
707
692
708
function ci_unix_longlong_build {
693
- ci_unix_build_helper VARIANT=longlong
709
+ ci_unix_build_helper VARIANT=longlong MICROPY_USE_COMPILER_PLUGIN=gcc
694
710
}
695
711
696
712
function ci_unix_longlong_run_tests {
697
713
ci_unix_run_tests_full_helper longlong
698
714
}
699
715
716
+ function ci_unix_float_setup {
717
+ ci_gcc_plugin_setup
718
+ }
719
+
700
720
function ci_unix_float_build {
701
- ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
721
+ ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" MICROPY_USE_COMPILER_PLUGIN=gcc
702
722
ci_unix_build_ffi_lib_helper gcc
703
723
}
704
724
@@ -784,15 +804,16 @@ function ci_unix_macos_run_tests {
784
804
785
805
function ci_unix_qemu_mips_setup {
786
806
sudo apt-get update
787
- sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
807
+ sudo apt-get install gcc-10- mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
788
808
sudo apt-get install qemu-user
809
+ ci_gcc_plugin_setup mips-linux-gnu
789
810
qemu-mips --version
790
811
sudo mkdir /etc/qemu-binfmt
791
812
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
792
813
}
793
814
794
815
function ci_unix_qemu_mips_build {
795
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} "
816
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
796
817
ci_unix_build_ffi_lib_helper mips-linux-gnu-gcc
797
818
}
798
819
@@ -805,13 +826,14 @@ function ci_unix_qemu_arm_setup {
805
826
sudo apt-get update
806
827
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
807
828
sudo apt-get install qemu-user
829
+ ci_gcc_plugin_setup arm-linux-gnueabi
808
830
qemu-arm --version
809
831
sudo mkdir /etc/qemu-binfmt
810
832
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
811
833
}
812
834
813
835
function ci_unix_qemu_arm_build {
814
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} "
836
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
815
837
ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc
816
838
}
817
839
@@ -826,13 +848,14 @@ function ci_unix_qemu_riscv64_setup {
826
848
sudo apt-get update
827
849
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
828
850
sudo apt-get install qemu-user
851
+ ci_gcc_plugin_setup riscv64-linux-gnu
829
852
qemu-riscv64 --version
830
853
sudo mkdir /etc/qemu-binfmt
831
854
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
832
855
}
833
856
834
857
function ci_unix_qemu_riscv64_build {
835
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} "
858
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
836
859
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
837
860
}
838
861
@@ -852,7 +875,7 @@ function ci_windows_setup {
852
875
function ci_windows_build {
853
876
make ${MAKEOPTS} -C mpy-cross
854
877
make ${MAKEOPTS} -C ports/windows submodules
855
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
878
+ make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=${1- i686} -w64-mingw32- MICROPY_USE_COMPILER_PLUGIN=gcc
856
879
}
857
880
858
881
# #######################################################################################
0 commit comments