Active Topics

 


Reply
Thread Tools
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#11
For those interested in an example on how to use gcc 6 for their projects could look into https://github.com/rinigus/mapbox-demo-sfos. Its a working solution that allowed me to port C++14 library and build a simple application around it.

Some notes:

* In YAML (https://github.com/rinigus/mapbox-de...pbox-sfos.yaml), add opt-gcc6 as PkgBR

* Project file (https://github.com/rinigus/mapbox-de...apbox-sfos.pro) has compilers and linkers defined to /opt/gcc6/bin/g++ .

* For C++14, add c++14 in CONFIG of the project file.

* In project file, you could either opt for static or shared linking with stdc++. Static linking (as in the current version of pro file, see LIBS var) makes it easier to distribute, may have some side effects. Sometimes, as when developing QML plugin, static is the only way to go.

* Desktop file (https://github.com/rinigus/mapbox-de...x-sfos.desktop) has an application switched to "generic" to avoid silica boosters getting confused with the wrong stdc++ library version (dynamic link to stdc++) or inability to send signals (static link to stdc++).

* If you went for shared stdc++ build, add

Code:
%define __provides_exclude_from ^%{_datadir}/.*$
%define __requires_exclude ^libstdc.*$
in SPEC file (https://github.com/rinigus/mapbox-de...pbox-sfos.spec, in macros section) and

Code:
# ship all shared libraries not allowed in Harbour with the app
mkdir -p %{buildroot}%{_datadir}/%{name}/lib

cp /opt/gcc6/lib/libstdc++.so.6.0.22 %{buildroot}%{_datadir}/%{name}/lib/libstdc++.so.6
cp /opt/gcc6/lib/libgcc_s.so.1 %{buildroot}%{_datadir}/%{name}/lib/libgcc_s.so.1
cp /opt/gcc6/lib/libgcc_s.so %{buildroot}%{_datadir}/%{name}/lib/libgcc_s.so
in install post section.

* See https://github.com/rinigus/mapbox-de...sfos-rpmlintrc if you get into trouble with OBS.

For me, it all worked and I could compile and distribute program with gcc 6.4.0 as well as QML plugin compiled using similar approach. I believe that this is a viable solution and should allow to port the software that requires recent gcc version.
 

The Following 16 Users Say Thank You to rinigus For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#12
If you want to use it from within the OBS, see how to add the repo to your project: https://build.merproject.org/project...e:rinigus:maps
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 3 Users Say Thank You to marmistrz For This Useful Post:
Posts: 60 | Thanked: 459 times | Joined on Jan 2017 @ Innopolis, Russia
#13
 

The Following 7 Users Say Thank You to neochapay For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#14
Originally Posted by neochapay View Post
http://repo.merproject.org/obs/home:...mv7hl/armv7hl/ ready ^_^
Great job! This looks to be a proper packaging of gcc (in contrast of my approach where I stuffed all to /opt)

@neochapay, have you tried to compile anything demanding with it?

How does libstdc++ versioning go? In particular, I expect to have the same problems as with opt-gcc6 packaging - either

* libstdc++ has to be updated on device
* provided with an app
* linked statically

Note that SFOS boosters may not like your app-provided dynamically linked libstdc++

Looking forward to use it. Thank you again!
 

The Following 6 Users Say Thank You to rinigus For This Useful Post:
Posts: 60 | Thanked: 459 times | Joined on Jan 2017 @ Innopolis, Russia
#15
Originally Posted by rinigus View Post
Great job! This looks to be a proper packaging of gcc (in contrast of my approach where I stuffed all to /opt)

@neochapay, have you tried to compile anything demanding with it?
Now i got self complited gcc 6 next steep - try to compile glibc
 

The Following 5 Users Say Thank You to neochapay For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#16
Originally Posted by neochapay View Post
Now i got self complited gcc 6 next steep - try to compile glibc
Are you using the legacy or the new ABI? Do you want it to be a drop-in replacement or do you want to rebuild the whole Mer?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 2 Users Say Thank You to marmistrz For This Useful Post:
Posts: 60 | Thanked: 459 times | Joined on Jan 2017 @ Innopolis, Russia
#17
Originally Posted by marmistrz View Post
Are you using the legacy or the new ABI? Do you want it to be a drop-in replacement or do you want to rebuild the whole Mer?
yes and yes
 

The Following 2 Users Say Thank You to neochapay For This Useful Post:
Posts: 592 | Thanked: 1,167 times | Joined on Jul 2012
#18
Originally Posted by neochapay View Post
yes and yes
Pretty obvious question, did you succeed?
__________________
BWizz - best N9 bookmark editing tool! Check it out ->BWizz for Harmattan

LINKer - transform your N9's home view in a Desktop, give it the freedom it deserves! -> LINKer for Harmattan

QuickBar - Can't find the app you used yesterday in your overcrowded Home Screen? Want access to the QuickLaunch bar even in the home screen? QuickBar for Harmattan

If you like our work, and would like to support via PayPal : users.giulietta@gmail.com
 

The Following User Says Thank You to tortoisedoc For This Useful Post:
Reply

Tags
gcc 6, sailfish os


 
Forum Jump


All times are GMT. The time now is 07:39.