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

Improve compatibility with recent versions of GCC (module version should bump to 1320) #1806

Merged
merged 18 commits into from Aug 2, 2019

Conversation

@sergeuz
Copy link
Member

commented Jun 5, 2019

Note: This PR should go into the Device OS 1.3.x release with the module version of 1320. An intermediate update to 1.2.x is required.

Ideally we would merge this when we feel 1.3.0 is being finalized (maybe the first RC?)


Problem

This PR is a continuation of the work started in #1742:

  • Refactor linker files to eliminate duplication of RAM memory map constants in different files (only for modular builds for now).
  • Move the system-part1 SRAM region to another location on Gen 2 platforms (see #1742).
  • Increase the size of the system-part1 SRAM from 768 to 1024 bytes on Photon. This is enough to store the statically allocated locale data that was added in newlib bundled with ARM GCC >= 5.4.1.
  • Use os_thread_t instead of std::thread in the active object classes. This decouples our code from the libstdc++ internal API which changes between GCC releases.
  • Fix various compiler warnings and errors to make the code buildable with GCC 6-8. Note that correct work with recent versions of GCC is not guaranteed, the default compiler version is still 5.3.1.

Steps to Test

  1. Run wiring/no_fixture with enabled threading.
  2. Flash Device OS 1.2.1-rc.2 to a Gen 2 device.
  3. Bump the module versions to 1320 and flash this branch to the device OTA.
  4. Downgrade to 1.2.1-rc.2 OTA.

  • [internal] Improve compatibility with recent versions of GCC #1806
@avtolstoy
Copy link
Member

left a comment

👏

It would be nice to include RAM / flash space difference between gcc 5.3.1 and latest in this PR just for reference.

@sergeuz

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2019

It would be nice to include RAM / flash space difference between gcc 5.3.1 and latest in this PR just for reference.

The difference is weird at first glance:

Electron, GCC 5.3.1:

   text	   data	    bss	    dec	    hex	filename
  74852	    556	   2584	  77992	  130a8	../../../build/target/system-part1/platform-10-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 125080	    212	    564	 125856	  1eba0	../../../build/target/system-part2/platform-10-m/system-part2.elf
   text	   data	    bss	    dec	    hex	filename
 119708	   2696	   4328	 126732	  1ef0c	../../../build/target/system-part3/platform-10-m/system-part3.elf
   text	   data	    bss	    dec	    hex	filename
  11092	    156	    432	  11680	   2da0	../../../build/target/user-part/platform-10-m/tinker.elf

GCC 8.2.1:

   text	   data	    bss	    dec	    hex	filename
  78580	    896	   2788	  82264	  14158	../../../build/target/system-part1/platform-10-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 122664	    208	    524	 123396	  1e204	../../../build/target/system-part2/platform-10-m/system-part2.elf
   text	   data	    bss	    dec	    hex	filename
 123980	   2700	   5848	 132528	  205b0	../../../build/target/system-part3/platform-10-m/system-part3.elf
   text	   data	    bss	    dec	    hex	filename
  15348	    160	    448	  15956	   3e54	../../../build/target/user-part/platform-10-m/tinker.elf

As you can see, .text sections of the user part and system part 2 and 3 grew significantly, system part 1 .text became smaller, some .bss sections grew significantly as well. Now when we have a technical possibility to build the firmware with GCC 8 we can investigate the difference further.

@technobly technobly added this to the 1.3.0-rc.1 milestone Jun 10, 2019

@sergeuz

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

[ch34561]

@sergeuz sergeuz modified the milestones: 1.3.0-rc.1, 1.3.1-rc.1 Jun 14, 2019

@technobly technobly changed the title Improve compatibility with recent versions of GCC Improve compatibility with recent versions of GCC (module version should bump to 1320) Jun 14, 2019

@sergeuz sergeuz force-pushed the feature/part1_sram branch 3 times, most recently from 7dc5e89 to c598ef4 Jun 25, 2019

@sergeuz sergeuz referenced this pull request Jun 25, 2019
4 of 7 tasks complete

@sergeuz sergeuz force-pushed the feature/part1_sram branch from c598ef4 to 1b9755a Aug 2, 2019

@sergeuz sergeuz merged commit 4c9e675 into develop Aug 2, 2019

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.