@@ -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
}
@@ -266,11 +277,11 @@ function ci_mimxrt_setup {
266
277
function ci_mimxrt_build {
267
278
make ${MAKEOPTS} -C mpy-cross
268
279
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK submodules
269
- make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK
280
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK MICROPY_USE_COMPILER_PLUGIN=gcc
270
281
make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 submodules
271
- make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40
282
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 MICROPY_USE_COMPILER_PLUGIN=gcc
272
283
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK submodules
273
- make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK CFLAGS_EXTRA=-DMICROPY_HW_USB_MSC=1
284
+ make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1060_EVK CFLAGS_EXTRA=-DMICROPY_HW_USB_MSC=1 MICROPY_USE_COMPILER_PLUGIN=gcc
274
285
}
275
286
276
287
# #######################################################################################
@@ -284,10 +295,10 @@ function ci_nrf_build {
284
295
ports/nrf/drivers/bluetooth/download_ble_stack.sh s140_nrf52_6_1_1
285
296
make ${MAKEOPTS} -C mpy-cross
286
297
make ${MAKEOPTS} -C ports/nrf submodules
287
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10040
288
- make ${MAKEOPTS} -C ports/nrf BOARD=MICROBIT
289
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10056 SD=s140
290
- make ${MAKEOPTS} -C ports/nrf BOARD=PCA10090
298
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10040 MICROPY_USE_COMPILER_PLUGIN=gcc
299
+ make ${MAKEOPTS} -C ports/nrf BOARD=MICROBIT MICROPY_USE_COMPILER_PLUGIN=gcc
300
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10056 SD=s140 MICROPY_USE_COMPILER_PLUGIN=gcc
301
+ make ${MAKEOPTS} -C ports/nrf BOARD=PCA10090 MICROPY_USE_COMPILER_PLUGIN=gcc
291
302
}
292
303
293
304
# #######################################################################################
@@ -296,11 +307,12 @@ function ci_nrf_build {
296
307
function ci_powerpc_setup {
297
308
sudo apt-get update
298
309
sudo apt-get install gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
310
+ ci_gcc_plugin_setup powerpc64le-linux-gnu
299
311
}
300
312
301
313
function ci_powerpc_build {
302
- make ${MAKEOPTS} -C ports/powerpc UART=potato
303
- make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial
314
+ make ${MAKEOPTS} -C ports/powerpc UART=potato MICROPY_USE_COMPILER_PLUGIN=gcc
315
+ make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial MICROPY_USE_COMPILER_PLUGIN=gcc
304
316
}
305
317
306
318
# #######################################################################################
@@ -331,17 +343,17 @@ function ci_qemu_build_arm_prepare {
331
343
332
344
function ci_qemu_build_arm_bigendian {
333
345
ci_qemu_build_arm_prepare
334
- make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1
346
+ make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1 MICROPY_USE_COMPILER_PLUGIN=gcc
335
347
}
336
348
337
349
function ci_qemu_build_arm_sabrelite {
338
350
ci_qemu_build_arm_prepare
339
- make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test_full
351
+ make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test_full MICROPY_USE_COMPILER_PLUGIN=gcc
340
352
}
341
353
342
354
function ci_qemu_build_arm_thumb {
343
355
ci_qemu_build_arm_prepare
344
- make ${MAKEOPTS} -C ports/qemu test_full
356
+ make ${MAKEOPTS} -C ports/qemu test_full MICROPY_USE_COMPILER_PLUGIN=gcc
345
357
346
358
# Test building and running native .mpy with armv7m architecture.
347
359
ci_native_mpy_modules_build armv7m
@@ -351,7 +363,7 @@ function ci_qemu_build_arm_thumb {
351
363
function ci_qemu_build_rv32 {
352
364
make ${MAKEOPTS} -C mpy-cross
353
365
make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 submodules
354
- make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 test_full
366
+ make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 test_full MICROPY_USE_COMPILER_PLUGIN=gcc
355
367
356
368
# Test building and running native .mpy with rv32imc architecture.
357
369
ci_native_mpy_modules_build rv32imc
@@ -369,13 +381,13 @@ function ci_renesas_ra_setup {
369
381
function ci_renesas_ra_board_build {
370
382
make ${MAKEOPTS} -C mpy-cross
371
383
make ${MAKEOPTS} -C ports/renesas-ra submodules
372
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=RA4M1_CLICKER
373
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M2
374
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M1
375
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4M1
376
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4W1
384
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=RA4M1_CLICKER MICROPY_USE_COMPILER_PLUGIN=gcc
385
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M2 MICROPY_USE_COMPILER_PLUGIN=gcc
386
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA6M1 MICROPY_USE_COMPILER_PLUGIN=gcc
387
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4M1 MICROPY_USE_COMPILER_PLUGIN=gcc
388
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=EK_RA4W1 MICROPY_USE_COMPILER_PLUGIN=gcc
377
389
make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33 submodules
378
- make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33
390
+ make ${MAKEOPTS} -C ports/renesas-ra BOARD=ARDUINO_PORTENTA_C33 MICROPY_USE_COMPILER_PLUGIN=gcc
379
391
}
380
392
381
393
# #######################################################################################
@@ -413,8 +425,8 @@ function ci_samd_setup {
413
425
function ci_samd_build {
414
426
make ${MAKEOPTS} -C mpy-cross
415
427
make ${MAKEOPTS} -C ports/samd submodules
416
- make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M0_EXPRESS
417
- make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M4_EXPRESS
428
+ make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M0_EXPRESS MICROPY_USE_COMPILER_PLUGIN=gcc
429
+ make ${MAKEOPTS} -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M4_EXPRESS MICROPY_USE_COMPILER_PLUGIN=gcc
418
430
}
419
431
420
432
# #######################################################################################
@@ -433,12 +445,12 @@ function ci_stm32_pyb_build {
433
445
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 submodules
434
446
git submodule update --init lib/btstack
435
447
git submodule update --init lib/mynewt-nimble
436
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 USER_C_MODULES=../../examples/usercmodule
437
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
438
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF6 COPT=-O2 NANBOX=1 MICROPY_BLUETOOTH_NIMBLE=0 MICROPY_BLUETOOTH_BTSTACK=1
439
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA=' -DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1'
440
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6
441
- 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'
448
+ make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 USER_C_MODULES=../../examples/usercmodule MICROPY_USE_COMPILER_PLUGIN=gcc
449
+ make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 MICROPY_USE_COMPILER_PLUGIN=gcc
450
+ 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
451
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA=' -DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1' MICROPY_USE_COMPILER_PLUGIN=gcc
452
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6 MICROPY_USE_COMPILER_PLUGIN=gcc
453
+ 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
442
454
443
455
# Test building native .mpy with armv7emsp architecture.
444
456
git submodule update --init lib/berkeley-db-1.xx
@@ -451,15 +463,15 @@ function ci_stm32_nucleo_build {
451
463
git submodule update --init lib/mynewt-nimble
452
464
453
465
# Test building various MCU families, some with additional options.
454
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC
455
- make ${MAKEOPTS} -C ports/stm32 BOARD=STM32H573I_DK
456
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI COPT=-O2 CFLAGS_EXTRA=' -DMICROPY_PY_THREAD=1'
457
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L073RZ
458
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L476RG DEBUG=1
466
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC MICROPY_USE_COMPILER_PLUGIN=gcc
467
+ make ${MAKEOPTS} -C ports/stm32 BOARD=STM32H573I_DK MICROPY_USE_COMPILER_PLUGIN=gcc
468
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI COPT=-O2 CFLAGS_EXTRA=' -DMICROPY_PY_THREAD=1' MICROPY_USE_COMPILER_PLUGIN=gcc
469
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L073RZ MICROPY_USE_COMPILER_PLUGIN=gcc
470
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L476RG DEBUG=1 MICROPY_USE_COMPILER_PLUGIN=gcc
459
471
460
472
# Test building a board with mboot packing enabled (encryption, signing, compression).
461
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1
462
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1
473
+ make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1 MICROPY_USE_COMPILER_PLUGIN=gcc
474
+ make ${MAKEOPTS} -C ports/stm32/mboot BOARD=NUCLEO_WB55 USE_MBOOT=1 MBOOT_ENABLE_PACKING=1 MICROPY_USE_COMPILER_PLUGIN=gcc
463
475
# Test mboot_pack_dfu.py created a valid file, and that its unpack-dfu command works.
464
476
BOARD_WB55=ports/stm32/boards/NUCLEO_WB55
465
477
BUILD_WB55=ports/stm32/build-NUCLEO_WB55
@@ -474,7 +486,7 @@ function ci_stm32_nucleo_build {
474
486
function ci_stm32_misc_build {
475
487
make ${MAKEOPTS} -C mpy-cross
476
488
make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA submodules
477
- make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA
489
+ make ${MAKEOPTS} -C ports/stm32 BOARD=ARDUINO_GIGA MICROPY_USE_COMPILER_PLUGIN=gcc
478
490
}
479
491
480
492
# #######################################################################################
@@ -615,12 +627,15 @@ function ci_unix_coverage_setup {
615
627
pip3 install setuptools
616
628
pip3 install pyelftools
617
629
pip3 install ar
630
+ ci_gcc_plugin_setup
618
631
gcc --version
619
632
python3 --version
620
633
}
621
634
622
635
function ci_unix_coverage_build {
623
- ci_unix_build_helper VARIANT=coverage
636
+ # (Ensure mpy-cross is built with the plugin too)
637
+ make ${MAKEOPTS} -C mpy-cross MICROPY_USE_COMPILER_PLUGIN=gcc
638
+ ci_unix_build_helper VARIANT=coverage MICROPY_USE_COMPILER_PLUGIN=gcc
624
639
ci_unix_build_ffi_lib_helper gcc
625
640
}
626
641
@@ -661,6 +676,7 @@ function ci_unix_32bit_setup {
661
676
sudo dpkg --add-architecture i386
662
677
sudo apt-get update
663
678
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
679
+ ci_gcc_plugin_setup
664
680
sudo pip3 install setuptools
665
681
sudo pip3 install pyelftools
666
682
sudo pip3 install ar
@@ -670,7 +686,7 @@ function ci_unix_32bit_setup {
670
686
}
671
687
672
688
function ci_unix_coverage_32bit_build {
673
- ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1
689
+ ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 MICROPY_USE_COMPILER_PLUGIN=gcc
674
690
ci_unix_build_ffi_lib_helper gcc -m32
675
691
}
676
692
@@ -684,16 +700,20 @@ function ci_unix_coverage_32bit_run_native_mpy_tests {
684
700
685
701
function ci_unix_nanbox_build {
686
702
# 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"
703
+ ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA=" -DMICROPY_PY_MATH_CONSTANTS=1" MICROPY_USE_COMPILER_PLUGIN=gcc
688
704
ci_unix_build_ffi_lib_helper gcc -m32
689
705
}
690
706
691
707
function ci_unix_nanbox_run_tests {
692
708
ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
693
709
}
694
710
711
+ function ci_unix_float_setup {
712
+ ci_gcc_plugin_setup
713
+ }
714
+
695
715
function ci_unix_float_build {
696
- ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
716
+ ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA=" -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" MICROPY_USE_COMPILER_PLUGIN=gcc
697
717
ci_unix_build_ffi_lib_helper gcc
698
718
}
699
719
@@ -778,15 +798,16 @@ function ci_unix_macos_run_tests {
778
798
779
799
function ci_unix_qemu_mips_setup {
780
800
sudo apt-get update
781
- sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
801
+ sudo apt-get install gcc-10- mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
782
802
sudo apt-get install qemu-user
803
+ ci_gcc_plugin_setup mips-linux-gnu
783
804
qemu-mips --version
784
805
sudo mkdir /etc/qemu-binfmt
785
806
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
786
807
}
787
808
788
809
function ci_unix_qemu_mips_build {
789
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} "
810
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_MIPS[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
790
811
ci_unix_build_ffi_lib_helper mips-linux-gnu-gcc
791
812
}
792
813
@@ -799,13 +820,14 @@ function ci_unix_qemu_arm_setup {
799
820
sudo apt-get update
800
821
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
801
822
sudo apt-get install qemu-user
823
+ ci_gcc_plugin_setup arm-linux-gnueabi
802
824
qemu-arm --version
803
825
sudo mkdir /etc/qemu-binfmt
804
826
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
805
827
}
806
828
807
829
function ci_unix_qemu_arm_build {
808
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} "
830
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_ARM[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
809
831
ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc
810
832
}
811
833
@@ -820,13 +842,14 @@ function ci_unix_qemu_riscv64_setup {
820
842
sudo apt-get update
821
843
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
822
844
sudo apt-get install qemu-user
845
+ ci_gcc_plugin_setup riscv64-linux-gnu
823
846
qemu-riscv64 --version
824
847
sudo mkdir /etc/qemu-binfmt
825
848
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
826
849
}
827
850
828
851
function ci_unix_qemu_riscv64_build {
829
- ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} "
852
+ ci_unix_build_helper " ${CI_UNIX_OPTS_QEMU_RISCV64[@]} " MICROPY_USE_COMPILER_PLUGIN=gcc
830
853
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
831
854
}
832
855
@@ -845,7 +868,7 @@ function ci_windows_setup {
845
868
function ci_windows_build {
846
869
make ${MAKEOPTS} -C mpy-cross
847
870
make ${MAKEOPTS} -C ports/windows submodules
848
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
871
+ make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=${1- i686} -w64-mingw32- MICROPY_USE_COMPILER_PLUGIN=gcc
849
872
}
850
873
851
874
# #######################################################################################
0 commit comments