Skip to content

tests / pkg: fixes for toolchain changes in docker container [backport 2021.01]#16140

Merged
fjmolinas merged 4 commits intoRIOT-OS:2021.01-branchfrom
aabadie:backport/2021.01/pr/make/gcc_10_riscv_failures
Mar 4, 2021
Merged

tests / pkg: fixes for toolchain changes in docker container [backport 2021.01]#16140
fjmolinas merged 4 commits intoRIOT-OS:2021.01-branchfrom
aabadie:backport/2021.01/pr/make/gcc_10_riscv_failures

Conversation

@aabadie
Copy link
Contributor

@aabadie aabadie commented Mar 3, 2021

Backport of #15966, #15964, and #16042

Contribution description

This PR silences 2 warning raised when building with gcc 10 on riscv:

  • upstream code of pkg/cn-cbor raises the return-local-address error. The latest version of the upstream code doesn't provide a fix for this
  • tests/ssp allocates on purpose a buffer too small but this is catched by the compiler as array-bound warning. Similar to the stringop-overflow warning, the array-bound warning is silenced if it's available in the compiler.

Testing procedure

  • A green Murdock
  • Both applications build with gcc 10 for riscv and works on hifive1b:
tests/pkg_cn-cbor
$ BUILD_IN_DOCKER=1 make BOARD=hifive1b -C tests/pkg_cn-cbor --no-print-directory flash test
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT-review:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=hifive1b'  -w '/data/riotbuild/riotbase/tests/pkg_cn-cbor/' 'riot/riotbuild:latest' make 'BOARD=hifive1b'    
Building application "tests_pkg_cn-cbor" for "hifive1b" with MCU "fe310".

"make" -C /data/riotbuild/riotbase/pkg/cn-cbor
"make" -C /data/riotbuild/riotbase/build/pkg/cn-cbor/src -f /data/riotbuild/riotbase/Makefile.base MODULE=cn-cbor
"make" -C /data/riotbuild/riotbase/boards/hifive1b
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/fe310
"make" -C /data/riotbuild/riotbase/cpu/fe310/periph
"make" -C /data/riotbuild/riotbase/cpu/fe310/vendor
"make" -C /data/riotbuild/riotbase/cpu/riscv_common
"make" -C /data/riotbuild/riotbase/cpu/riscv_common/periph
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/embunit
"make" -C /data/riotbuild/riotbase/sys/fmt
"make" -C /data/riotbuild/riotbase/sys/isrpipe
"make" -C /data/riotbuild/riotbase/sys/malloc_thread_safe
"make" -C /data/riotbuild/riotbase/sys/memarray
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
"make" -C /data/riotbuild/riotbase/sys/test_utils/interactive_sync
"make" -C /data/riotbuild/riotbase/sys/tsrb
   text	   data	    bss	    dec	    hex	filename
  22401	    192	   2677	  25270	   62b6	/data/riotbuild/riotbase/tests/pkg_cn-cbor/bin/hifive1b/tests_pkg_cn-cbor.elf
/work/riot/RIOT-review/dist/tools/jlink/jlink.sh flash /work/riot/RIOT-review/tests/pkg_cn-cbor/bin/hifive1b/tests_pkg_cn-cbor.bin
### Flashing Target ###
### Flashing at base address 0x20010000 with offset 0 ###
SEGGER J-Link Commander V6.94b (Compiled Jan 26 2021 18:05:49)
DLL version V6.94b, compiled Jan 26 2021 18:05:34

J-Link Commander will now exit on Error

J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-SiFive compiled Jan 18 2021 09:05:42
Hardware version: V1.00
S/N: 979001370
VTref=3.300V
Target connection not established yet but required for command.
Device "FE310" selected.


Connecting to target via JTAG
ConfigTargetSettings() start
ConfigTargetSettings() end
TotalIRLen = 5, IRPrint = 0x01
JTAG chain detection found 1 devices:
 #0 Id: 0x20000913, IRLen: 05, Unknown device
Debug architecture:
  RISC-V debug: 0.13
  AddrBits: 7
  DataBits: 32
  IdleClks: 5
Memory access:
  Via system bus: No
  Via ProgBuf: Yes (16 ProgBuf entries)
DataBuf: 1 entries
  autoexec[0] implemented: Yes
Detected: RV32 core
CSR access via abs. commands: No
Temp. halted CPU for NumHWBP detection
HW instruction/data BPs: 8
Support set/clr BPs while running: No
HW data BPs trigger before execution of inst
RISC-V identified.
Halting CPU for downloading file.
Downloading file [/work/riot/RIOT-review/tests/pkg_cn-cbor/bin/hifive1b/tests_pkg_cn-cbor.bin]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x20000000: 1 range affected (65536 bytes)
J-Link: Flash download: Total: 0.622s (Prepare: 0.048s, Compare: 0.038s, Erase: 0.170s, Program & Verify: 0.345s, Restore: 0.019s)
J-Link: Flash download: Program & Verify speed: 185 KB/s
O.K.

Reset delay: 0 ms
Reset type Normal: Resets core & peripherals using <ndmreset> bit in <dmcontrol> debug register.
RISC-V: Performing reset via <ndmreset>



Script processing completed.

r
/work/riot/RIOT-review/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Twisted not available, please install it if you want to use pyterm's JSON capabilities
Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Bench Clock Reset Complete

ATE0-->OK
AT+BLEINIT=0-->OK
AT+CWMODE=0-->OK

Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2021.04-devel-487-g23ea7-pr/make/gcc_10_riscv_failures)
..
OK (2 tests)
tests/ssp
$ BUILD_IN_DOCKER=1 make BOARD=hifive1b -C tests/ssp/ --no-print-directory flash test
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT-review:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=hifive1b'  -w '/data/riotbuild/riotbase/tests/ssp/' 'riot/riotbuild:latest' make 'BOARD=hifive1b'    
Building application "tests_ssp" for "hifive1b" with MCU "fe310".

"make" -C /data/riotbuild/riotbase/boards/hifive1b
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/fe310
"make" -C /data/riotbuild/riotbase/cpu/fe310/periph
"make" -C /data/riotbuild/riotbase/cpu/fe310/vendor
"make" -C /data/riotbuild/riotbase/cpu/riscv_common
"make" -C /data/riotbuild/riotbase/cpu/riscv_common/periph
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/isrpipe
"make" -C /data/riotbuild/riotbase/sys/malloc_thread_safe
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/ssp
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
"make" -C /data/riotbuild/riotbase/sys/test_utils/interactive_sync
"make" -C /data/riotbuild/riotbase/sys/tsrb
   text	   data	    bss	    dec	    hex	filename
   9222	    140	   2312	  11674	   2d9a	/data/riotbuild/riotbase/tests/ssp/bin/hifive1b/tests_ssp.elf
/work/riot/RIOT-review/dist/tools/jlink/jlink.sh flash /work/riot/RIOT-review/tests/ssp/bin/hifive1b/tests_ssp.bin
### Flashing Target ###
### Flashing at base address 0x20010000 with offset 0 ###
SEGGER J-Link Commander V6.94b (Compiled Jan 26 2021 18:05:49)
DLL version V6.94b, compiled Jan 26 2021 18:05:34

J-Link Commander will now exit on Error

J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-SiFive compiled Jan 18 2021 09:05:42
Hardware version: V1.00
S/N: 979001370
VTref=3.300V
Target connection not established yet but required for command.
Device "FE310" selected.


Connecting to target via JTAG
ConfigTargetSettings() start
ConfigTargetSettings() end
TotalIRLen = 5, IRPrint = 0x01
JTAG chain detection found 1 devices:
 #0 Id: 0x20000913, IRLen: 05, Unknown device
Debug architecture:
  RISC-V debug: 0.13
  AddrBits: 7
  DataBits: 32
  IdleClks: 5
Memory access:
  Via system bus: No
  Via ProgBuf: Yes (16 ProgBuf entries)
DataBuf: 1 entries
  autoexec[0] implemented: Yes
Detected: RV32 core
CSR access via abs. commands: No
Temp. halted CPU for NumHWBP detection
HW instruction/data BPs: 8
Support set/clr BPs while running: No
HW data BPs trigger before execution of inst
RISC-V identified.
Halting CPU for downloading file.
Downloading file [/work/riot/RIOT-review/tests/ssp/bin/hifive1b/tests_ssp.bin]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x20000000: 1 range affected (65536 bytes)
J-Link: Flash download: Total: 0.447s (Prepare: 0.048s, Compare: 0.038s, Erase: 0.171s, Program & Verify: 0.170s, Restore: 0.019s)
J-Link: Flash download: Program & Verify speed: 376 KB/s
O.K.

Reset delay: 0 ms
Reset type Normal: Resets core & peripherals using <ndmreset> bit in <dmcontrol> debug register.
RISC-V: Performing reset via <ndmreset>



Script processing completed.

r
/work/riot/RIOT-review/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Twisted not available, please install it if you want to use pyterm's JSON capabilities
Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Bench Clock Reset Complete

ATE0-->ATE0
OK
AT+BLEINIT=0-->OK
AT+CWMODE=0-->OK

Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2021.04-devel-487-g23ea7-pr/make/gcc_10_riscv_failures)
calling stack corruption function
*** RIOT kernel panic:
ssp: stack smashing detected

Issues/PRs references

Must be fixed before RIOT-OS/riotdocker#131 is merged and deployed on Murdock workers.

@aabadie aabadie added Area: build system Area: Build system Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master labels Mar 3, 2021
@aabadie
Copy link
Contributor Author

aabadie commented Mar 3, 2021

I cherry-picked the commits from #16141 and #16134 here, otherwise the build will fail anyway.

@miri64 miri64 changed the title make: silence a couple of warnings raised with gcc 10 on riscv [backport 2021.01] tests / pkg: fixes for toolchain changes in docker containter [backport 2021.01] Mar 3, 2021
@miri64 miri64 changed the title tests / pkg: fixes for toolchain changes in docker containter [backport 2021.01] tests / pkg: fixes for toolchain changes in docker container [backport 2021.01] Mar 3, 2021
@miri64
Copy link
Member

miri64 commented Mar 3, 2021

Can you please adopt OP to reflect that this is a combination of backports

@miri64
Copy link
Member

miri64 commented Mar 3, 2021

And would have been nice to keep the authorship of the original commit.

@miri64
Copy link
Member

miri64 commented Mar 3, 2021

#16042 is still missing btw.

@aabadie
Copy link
Contributor Author

aabadie commented Mar 3, 2021

would have been nice to keep the authorship of the original commit.

it was me, so no problem :)

@miri64
Copy link
Member

miri64 commented Mar 3, 2021

would have been nice to keep the authorship of the original commit.

it was me, so no problem :)

Got confused, since the wakaama commit was missing ;-).

@miri64 miri64 added Area: pkg Area: External package ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer labels Mar 3, 2021
miri64
miri64 previously approved these changes Mar 3, 2021
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Confirmed that this aggregates the backported PRs.

@miri64
Copy link
Member

miri64 commented Mar 3, 2021

Oh no... we might need to backport #16132 as well 🙈

@miri64
Copy link
Member

miri64 commented Mar 3, 2021

See #16142

aabadie and others added 4 commits March 4, 2021 09:13
This warning is triggered with gcc 10 on riscv and make the build to fail

(cherry picked from commit a51df1f)
This warning is triggered on gcc 10 with riscv and makes the build to fail

(cherry picked from commit f515036)
Drop included of unused header file that caused conflict with the new toolchain
@aabadie aabadie force-pushed the backport/2021.01/pr/make/gcc_10_riscv_failures branch from 58d753d to 676d1c3 Compare March 4, 2021 08:13
@aabadie
Copy link
Contributor Author

aabadie commented Mar 4, 2021

rebased on top of latest release branch (that now includes #16142)

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-ACK

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@fjmolinas fjmolinas merged commit ae52efd into RIOT-OS:2021.01-branch Mar 4, 2021
@aabadie aabadie deleted the backport/2021.01/pr/make/gcc_10_riscv_failures branch March 4, 2021 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: pkg Area: External package ports Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants