Thread: gcc >= 6 ?
View Single Post
Posts: 666 | Thanked: 3,540 times | Joined on Aug 2016 @ Estonia
For those interested in getting gcc 6x working, I have compiled gcc 6.4.0 at OBS. Its available at . Compiler is build with options that should allow, in theory, to mix it with the current compiler on SFOS. Compiler is installed at /opt/gcc6, making it possible to have platform gcc and opt-gcc installed at the same time.

Please note that this compiler is not tested. Its early days...

I have seen issues with linking, such as absence of correct libstdc++ and glibc. For simpler programs, that was resolved either by setting LD_LIBRARY_PATH to include /opt/gcc6/lib or linking with /usr/bin/g++

Note that such packaging is not "proper", as done by system packages. It installs whole c & c++ as a one package together with all libs under /opt/gcc6

Finally, as with @yurib, I had issues with getting ARM version compiled with LTO. So, ARM version is compiled with LTO disabled. The error message was (from OBS build log)
[ 4478s] ranlib libgcc_eh.a
[ 4478s] # @multilib_dir@ is not really necessary, but sometimes it has
[ 4478s] # more uses than just a directory name.
[ 4478s] /bin/sh /home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj/../libgcc/../mkinstalldirs .
[ 4478s] /home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj/./gcc/ 
... unordsf2_s.o fixsfsi_s.o floatsisf_s.o floatunsisf_s.o adddf3_s.o divdf3_s.o eqdf2_s.o gedf2_s.o ledf2_s.o muldf3_s.o negdf2_s.o subdf3_s.o unorddf2_s.o fixdfsi_s.o floatsidf_s.o floatunsidf_s.o extendsfdf2_s.o truncdfsf2_s.o enable-execute-stack_s.o unwind-arm_s.o libunwind_s.o pr-support_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./ && if [ -f ./ ]; then mv -f ./ ./; else true; fi && mv ./ ./ && (echo "/* GNU ld script"; echo "   Use the shared library, but some functions are only in"; echo "   the static library.  */"; echo "GROUP ( -lgcc )" ) > ./
[ 4479s] /opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: /home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj/./gcc/ error loading plugin: PTmPTm
[ 4479s] collect2: error: ld returned 1 exit status
[ 4479s] make[3]: *** [] Error 1
[ 4479s] make[3]: Leaving directory `/home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj/armv7l-unknown-linux-gnueabihf/libgcc'
[ 4479s] make[2]: *** [all-stage1-target-libgcc] Error 2
[ 4479s] make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj'
[ 4479s] make[1]: *** [stage1-bubble] Error 2
[ 4479s] make[1]: Leaving directory `/home/abuild/rpmbuild/BUILD/gcc-6.4.0/obj'
[ 4479s] make: *** [all] Error 2
[ 4479s] error: Bad exit status from /var/tmp/rpm-tmp.jFkB2P (%build)
[ 4479s] 
[ 4479s] 
[ 4479s] RPM build errors:
[ 4479s]     Bad exit status from /var/tmp/rpm-tmp.jFkB2P (%build)
[ 4482s] [ 4465.323263] SysRq : Power Off
[ 4482s] [ 4465.327031] reboot: Power down
So, there is surely room for improvement

The Following 8 Users Say Thank You to rinigus For This Useful Post: