We have moved to a new Sailfish OS Forum. Please start new discussions there.

SDK with newer GCC that supports c++17 standard?

Tracked by Jolla (In progress)

asked 2018-11-20 17:43:20 +0300

Karry gravatar image


As a C++ developer, I would like to use latest standard (c++17) for developing. It provides really useful improvements! But Mer SDK used as official Sailfish SDK provides GCC just in prehistoric version 4.8.3, that supports c++11 and few features from c++14. Is there any plan for providing official support for newer compiler? Or it is better to ask - is there any plan to switch system libraries (libstdc++, Qt...) to newer GCC ABI (>6)?

If I understand it correctly, GNU libstdc++ support dual ABI for compatibility with legacy applications, so everything should work after transition. Core system will be just a bit bigger...

edit retag flag offensive close delete



Why this question still without answer

bormac ( 2019-03-03 14:54:36 +0300 )edit

I would also be interested in a newer gcc. Backporting libs is a huge pain. I'm using ringus gcc6 for now, but an official package would be nice (https://talk.maemo.org/showthread.php?t=99699&page=2).

KuroNeko ( 2019-03-31 01:33:58 +0300 )edit

2 Answers

Sort by » oldest newest most voted

answered 2019-05-01 18:06:57 +0300

Sage gravatar image

Not fully answering your question, but with the 3.0.3 release we took a small step forward on the gcc, by updating it to version 4.9.4, which added couple of more c++14 features (still not feature complete though). This helped us to check a bit the process of updating gcc, which touches more or less the whole OS when the update is done and gave us a bit more insights how to take the next step forward.


edit flag offensive delete publish link more



Definitely good progress! I am waiting for new SDK to start using c++14 :-) Did you considering howto handle ABI switch in the future? I am not even sure where it may cause troubles and if it is possible to build all c++ libraries (Qt for example) with dual ABI...

Karry ( 2019-05-01 19:13:12 +0300 )edit

I guess you mean https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

That should not cause too much harm. Exact details are still pending until we are closer with the next gcc upgrade.

See also: https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c11-abi/

Sage ( 2019-05-06 16:55:15 +0300 )edit

Hi Sage! I was able to build GCC 8.3 for Sailfish OS (https://build.merproject.org/package/show/home:equeim:gcc and https://build.merproject.org/project/show/home:equeim:cross-gcc), it is configured to use old ABI by default. Currently I'm testing building my apps with it, and deploying RPM with its own libstdc++ and setting rpath for executable. Everything seems to work fine, but I'm in doubt, are there any pitfalls that I'm not aware about?

equeim ( 2019-05-09 01:28:57 +0300 )edit

Hi equeim, that is just the one of the very first steps what you did. Would need to build the whole core OS with your new toolchain including the crosstoolchains and supporting packages. So basically taking e.e. whole core os build all packages there, add your gcc into the mix that installs on top of the current gcc and then fix the fallout. Most likely you need to touch somewhere between 20-200 packages to get that gcc fully building the OS as that is so huge step forward.

With the gcc update to 4.9.4 we did the same, here are few (by no means all) pull request showing what kind of changes we did previously:






Br, Sage

Sage ( 2019-05-29 15:19:30 +0300 )edit

I'm not saying that rebuilding a system with newer compiler is not neccassary, it's obviously a must and you're doing a ton of work to make it possible. I'm just interested in building apps using newer compiler while remaining compatibility with OS versions that was built with older compiler. Also, do I understand it correctly that when you will update to newer (post 5.0) GCC version you will keep building system with GCC 4 language/libstdc++ ABI to remain compatible with third party apps? Or will you break compatibiluty someday?

equeim ( 2019-05-30 00:04:21 +0300 )edit

answered 2020-05-29 15:28:01 +0300

coderus gravatar image

gcc 8.3 in sfos 3.3

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2018-11-20 17:43:20 +0300

Seen: 1,211 times

Last updated: May 29 '20