Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extern declarations for gcc10 compat #3231

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented Jul 30, 2020

While this PR originally switched to gcc10, it wasn't working out right now. However, we can safely add these extern declarations to help next time we take a bite at it.

-        wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
-        sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
+        wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q2-preview-x86_64-linux.tar.bz2
+        sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q2-preview-x86_64-linux.tar.bz2

@jepler
Copy link
Member Author

jepler commented Jul 30, 2020

as with the 8->9 switch, some boards seem to grow while others shrink. For example, trinket_m0 de_DE wasn't fitting at the ref of main where I based this PR, but started to fit. However, bast_pro_mini_m0 overflowed.

There are also some build errors that are NOT just over-full flash, perhaps they weren't encountered while working on #3194 . arduino_nano_33_ble fails with linker messages about multiply defined symbols:

/usr/bin/../lib/gcc/arm-none-eabi/10.1.1/../../../../arm-none-eabi/bin/ld: build-arduino_nano_33_ble/supervisor/port.o (symbol from plugin): in function `rtc_instance':
(.text+0x0): multiple definition of `vm_used_ble'; build-arduino_nano_33_ble/main.o (symbol from plugin):(.text+0x0): first defined here

I didn't look at all the failures yet.

@dhalbert
Copy link
Collaborator

dhalbert commented Jul 30, 2020

Looks like the nrf and i.MX builds need to add a bunch of externs. Also de_DE still does not fit for bast_pro_mini, at least. [crossed with your post]

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 1, 2020

FYI -- I tried using gcc 10 to buil the grandcentral_m4_express -- it builds OK, but when I put the build on the board, it does not boot properly -- Staus neopixel starts off green then goes to yellow (possibly safe mode?) I can connect to the REPL briefly, but it eventually drops the connection -- no CIRCUITPY drive is mounted
some output from dmesg

[483299.662154] sd 7:0:0:0: [sdc] No Caching mode page found
[483299.662169] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[483299.720570] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[483300.792221] usb 3-1.4: reset full-speed USB device number 17 using xhci_hcd
[483301.014089] cdc_acm 3-1.4:1.0: ttyACM0: USB ACM device
[483301.015814] sd 7:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[483301.015826] sd 7:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 0f ff 80 00 00 08 00
[483301.015833] blk_update_request: I/O error, dev sdc, sector 1048448 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0

rebuilding with gcc 9.2.1 works normally

also note that I was able to build the CPX board with GCC10 and it appears to execute normally

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 1, 2020

FYI -- confirmed the same failure as above on a feather_m4_express.
Appears to be an issue with SAMD51

also confirmed that the feather m0 express builds and appears to operate normally -- as did the CPX.

@jerryneedell
Copy link
Collaborator

@tannewt tried using gcc10 for pyportal build -- also fails -- yellow status LED
Would you please confirm (or deny) that you have built and tested it on the pyportal?

here is the dmesg dump

[1166260.627612] usb-storage 1-1.4.3:1.2: USB Mass Storage device detected
[1166260.634788] scsi host0: usb-storage 1-1.4.3:1.2
[1166260.646898] input: Adafruit Industries LLC PyPortal Keyboard as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.3/1-1.4.3:1.3/0003:239A:8036.004D/input/input224
[1166260.734291] input: Adafruit Industries LLC PyPortal Mouse as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.3/1-1.4.3:1.3/0003:239A:8036.004D/input/input225
[1166260.753069] input: Adafruit Industries LLC PyPortal Consumer Control as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.3/1-1.4.3:1.3/0003:239A:8036.004D/input/input226
[1166260.773854] input: Adafruit Industries LLC PyPortal as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.3/1-1.4.3:1.3/0003:239A:8036.004D/input/input227
[1166260.792074] hid-generic 0003:239A:8036.004D: input,hidraw2: USB HID v1.11 Keyboard [Adafruit Industries LLC PyPortal] on usb-0000:01:00.0-1.4.3/input3
[1166261.645471] scsi host0: scsi scan: INQUIRY result too short (5), using 36
[1166261.652540] scsi 0:0:0:0: Direct-Access     Adafruit PyPortal         1.0  PQ: 0 ANSI: 2
[1166261.662715] sd 0:0:0:0: Attached scsi generic sg0 type 0
[1166261.669554] sd 0:0:0:0: [sda] 1048680 512-byte logical blocks: (537 MB/512 MiB)
[1166261.678815] sd 0:0:0:0: [sda] Write Protect is off
[1166261.683882] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[1166261.689708] sd 0:0:0:0: [sda] No Caching mode page found
[1166261.695299] sd 0:0:0:0: [sda] Assuming drive cache: write through
[1166261.708966] sd 0:0:0:0: [sda] Attached SCSI removable disk
[1166262.764645] usb 1-1.4.3: reset full-speed USB device number 38 using xhci_hcd
[1166262.907889] cdc_acm 1-1.4.3:1.0: ttyACM0: USB ACM device
[1166262.924932] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
[1166262.933449] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 0f ff 80 00 00 08 00
[1166262.941397] print_req_error: I/O error, dev sda, sector 1048448

@jerryneedell
Copy link
Collaborator

FYI -- with this pr -- I can build the nrf52840 -- feather_bluefruit_sense --- seems to work OK -- at least I get to REPL and CIRCUITPY drive

Still no luck with ATMEL SAMD51

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 4, 2020

and I can also now build and run the teensy41 with gcc10 using this PR.....
edited to add
also successfully built and booted feather_stm32f405_express

Note -- PyPortal does confirm on the display that it is entering Safe Mode -- I cannot connect to the REPL to explore further. The Display briefly shows a normal boot message then reboots to safe mode.

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 4, 2020

hmm -- I downloaded the "artifact" build from CI adafruit-circuitpython-grandcentral_m4_express-en_US-20200803-9da03a2.uf2 and it executes normally on my GCM4

uggh -- well it boots OK when connected to my Mac, but not when connected to my Raspberry Pi ... the plot thickens.

Ha!! so does my local build -- so this issue is about USB on Linux vs Mac
Something about the SAMD51 builds is not playing nicely with USB on Linux but it is OK on Mac

@jerryneedell
Copy link
Collaborator

@tannewt IIRC we've seen something like this before -- where builds would work on Mac, but not on Linux - specifically the USB -- I think it happeded with the early esp32s2 builds.

Do you recall what the issue was -- could there be something in the SAMD51 builds that is dependent on the gcc10 changes that is causing this.

Have you been working on your Mac with the GCC10 builds? Have you ever tried one on a linux box?

@tannewt
Copy link
Member

tannewt commented Aug 4, 2020

Do you recall what the issue was -- could there be something in the SAMD51 builds that is dependent on the gcc10 changes that is causing this.

No, I don't remember.

Have you been working on your Mac with the GCC10 builds? Have you ever tried one on a linux box?

Nope, I'm working on Arch Linux now. (It only has GCC10 so that's why I switched.)

@jerryneedell
Copy link
Collaborator

Do you recall what the issue was -- could there be something in the SAMD51 builds that is dependent on the gcc10 changes that is causing this.

No, I don't remember.

Have you been working on your Mac with the GCC10 builds? Have you ever tried one on a linux box?

Nope, I'm working on Arch Linux now. (It only has GCC10 so that's why I switched.)

I'm relieved that the builds do work on the mac, at least. They go to Safe mode on both Ubuntu 20.04 and Raspberry Pi Buster ... similar dmesg trails when they fail.

@dhalbert
Copy link
Collaborator

dhalbert commented Aug 4, 2020

@tannewt What is the exact version of the gcc 10 compiler you have on arch? The ARM preview is:

$ gcc-arm-none-eabi-10-2020-q2-preview/bin/arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q2-preview) 10.1.1 20200529 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@tannewt
Copy link
Member

tannewt commented Aug 5, 2020

Here is what I have now:

arm-none-eabi-gcc --version
arm-none-eabi-gcc (Arch Repository) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 5, 2020

Interesting development -- I included PR #3232 which has a fix for a startup issue.
With GCC 9 it all works normally
With GCC10 - now on the Raspberry Pi, I can get to the REPL but CIRCUITPY does not mount
same on the Mac ... this is different than without #3232 since it works normally on the Mac, but goes to Safe Mode on the Pi (and Linux)

I wish I know what it was telling me, but it is trying.....

I will try to delve into this more tomorrow and see if I can create a clearer picture. It's pretty muddled right now.

@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 6, 2020

A few more observations go GCC10 behavior for SAMD51 - PyPortal

With GCC9 everything works fine
With GCC10 --
on the raspberry Pi/Linux -- it boots then goes to Safe Mode,No REPL, No CIRCUITPY drive
on the Mac , I can access the REPL but no CIRCUITPY DRIVE -- does not got to safe mode

I tried just connecting Power -- no computer -- The Pyportal display looks normal.
"Code done running. Waiting for reload" the Hello World from code.py was displayed.

edited to add -- also I was relied to see taht I get the same results independent of where I build the file -- on the Pi or in the Mac -- ON the Pi I built gcc10 from source, on the Mac, I am using the distributed tarball from arm-developers. At least they are consistent

@tannewt
Copy link
Member

tannewt commented Aug 10, 2020

I think the safe mode will take a gdb backtrace to debug. Maybe I can circle back to this once wifi is going on the S2. We'll also need to see why these three builds are bigger.

@jepler jepler marked this pull request as draft August 21, 2020 00:14
@jepler
Copy link
Member Author

jepler commented Aug 21, 2020

I converted this to a draft pull request. Would be happy for someone else to take a look at it, but it's not on my short list right now. We can also close this up if it's not useful to leave it open.

@tannewt
Copy link
Member

tannewt commented Aug 21, 2020

Would you mind removing the actual build and un-drafting this? It'd be nice to get the gcc10 fixes in this PR merged in.

@jepler jepler changed the title build.yml: switch to gcc10 preview compiler Add extern declarations for gcc10 compat Aug 21, 2020
gcc has tightened the restrictions on forward declarations that lack
"extern".  Fix them up.
@jepler jepler marked this pull request as ready for review August 21, 2020 19:39
@jepler jepler requested a review from tannewt August 23, 2020 02:11
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit 5b8ded2 into adafruit:main Aug 25, 2020
@tannewt
Copy link
Member

tannewt commented Oct 20, 2020

FYI I just debugged a SAMD51 issue with GCC 10.2 and USB worked just fine. Full version:

arm-none-eabi-gcc (Arch Repository) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@jerryneedell
Copy link
Collaborator

hmm -- I don't see the gcc 10.2.0 toolchain on the arm developer site. https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
It still has 10.1.0 so I have no way to test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants