GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy

discuss compiling applications for Puppy
Post Reply
Message
Author
jlst

GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy

#1 Post by jlst »

You must first load/install devx_precise_5.7.1.sfs

Download: gcc-4.7.3_4.8.1_4.9.2-ppa-precise.sfs

----------------------------------------------------------------------------------------

While I was looking for a way to compile applications that require a newer GCC version than the one in Precise Puppy, I found this page:

https://launchpad.net/~ubuntu-toolchain ... er=precise

I downloaded the deb files and chose the ones related to GCC, then I made a single package.

I have only tested GCC 4.7.3... seems to work as I compiled Audacious 3.6.

I also wrote a simple script to switch between the GCC versions available, it is called 'gnugcc'.

This is how it works:

Image

Jan99
Posts: 10
Joined: Tue 01 Jan 2013, 16:30

GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy

#2 Post by Jan99 »

Thanks ,

Was able to compile libbpg (static) .
See http://murga-linux.com/puppy/viewtopic.php?t=97170

Only thing your scrip does 4.6 and 4.7
4.8 and 4.9 go to 4.7 (can easily be changed in script)
I did not do that as V4.7 worked for me.

User avatar
Hesse James
Posts: 106
Joined: Mon 08 Feb 2010, 18:41

#3 Post by Hesse James »

Hi
My experience with this and Puppy Tahr:

As Jan99 said, you have to modify the script /sbin/gnugcc to switch the gcc versions.
You should replace in the file the exelist="gcc47" in line 107, 111 and 115 by the correct value "gcc48" or "gcc49" or "gcc410". ->Seems it was a copy and paste mistake.

Another thing: Tahr misses the lib "libmpc.so.2".

With this it should work also for you.

Best regards.
Christian
Attachments
libmpc2_0.9-4_i386.deb.tar.gz
(39.54 KiB) Downloaded 841 times

jlst

#4 Post by jlst »

Yes, thanks Hesse, I did fix that mistake the next week after I uploaded the file.
It's just that I'm very lazy to publish updates.

So besides that, here is a new update

/usr/bin/cc
/usr/bin/c++
were not being updated at all.

That could lead to compile errors, it happened to me.

Most apps look for gcc & g++ & cpp, but some just look for cc & c++

I paste here the code, in case anyone is interested

Code: Select all

#!/bin/sh
#jlst 2015

#if ! which gcc 1>/dev/null 2>&1 ; then
#	echo "* ERROR: gcc is not present" ; exit 1;
#fi

echo '----------------------------------------'
[ -f /usr/bin/cc ] && file /usr/bin/cc
[ -f /usr/bin/c++ ] && file /usr/bin/c++
[ -f /usr/bin/cpp ] && file /usr/bin/cpp
[ -f /usr/bin/gcc ] && file /usr/bin/gcc
[ -f /usr/bin/g++ ] && file /usr/bin/g++
echo '----------------------------------------'

gcc46='/usr/bin/cpp-4.6
/usr/bin/g++-4.6
/usr/bin/gcc-4.6
/usr/bin/gcc-ar-4.6
/usr/bin/gccgo-4.6
/usr/bin/gcc-nm-4.6
/usr/bin/gcc-ranlib-4.6
/usr/bin/gcov-4.6
/usr/bin/gfortran-4.6
/usr/bin/gdc-4.7'

gcc47='/usr/bin/cpp-4.7
/usr/bin/g++-4.7
/usr/bin/gcc-4.7
/usr/bin/gcc-ar-4.7
/usr/bin/gccgo-4.7
/usr/bin/gcc-nm-4.7
/usr/bin/gcc-ranlib-4.7
/usr/bin/gcov-4.7
/usr/bin/gfortran-4.7
/usr/bin/gdc-4.7'

gcc48='/usr/bin/cpp-4.8
/usr/bin/g++-4.8
/usr/bin/gcc-4.8
/usr/bin/gcc-ar-4.8
/usr/bin/gccgo-4.8
/usr/bin/gcc-nm-4.8
/usr/bin/gcc-ranlib-4.8
/usr/bin/gcov-4.8
/usr/bin/gdc-4.8'

gcc49='/usr/bin/cpp-4.9
/usr/bin/g++-4.9
/usr/bin/gcc-4.9
/usr/bin/gcc-ar-4.9
/usr/bin/gccgo-4.9
/usr/bin/gcc-nm-4.9
/usr/bin/gcc-ranlib-4.9
/usr/bin/gcov-4.9
/usr/bin/gdc-4.9'

gcc410=''

read -r testx <<< "$gcc46"
if [ -x $testx ] ; then
	gcc46ok=1 ; GCC=1
fi

read -r testx <<< "$gcc47"
if [ -x "$testx" ] ; then
	gcc47ok=1 ; GCC=1
fi

read -r testx <<< "$gcc48"
if [ -x "$testx" ] ; then
	gcc48ok=1 ; GCC=1
fi

read -r testx <<< "$gcc49"
if [ -x "$testx" ] ; then
	gcc49ok=1 ; GCC=1
fi

read -r testx <<< "$gcc410"
if [ -x "$testx" ] ; then
	gcc410ok=1 ; GCC=1
fi

#could not find any
if [ ! "$GCC" ] ; then
	echo "* Could not find any GCC version..."
	[ -f /usr/lib/gcc/i686-linux-gnu/4.6/cc1 ] && $0 4.6
	[ -f /usr/lib/gcc/i686-linux-gnu/4.7/cc1 ] && $0 4.7
	[ -f /usr/lib/gcc/i686-linux-gnu/4.8/cc1 ] && $0 4.8
	[ -f /usr/lib/gcc/i686-linux-gnu/4.9/cc1 ] && $0 4.9
fi

###########################

version="$1"

if [ ! "$version" ] ; then
	echo "* Choose one of the following available GCC versions: "
	[ "$gcc46ok" ] && echo "	4.6"
	[ "$gcc47ok" ] && echo "	4.7"
	[ "$gcc48ok" ] && echo "	4.8"
	[ "$gcc49ok" ] && echo "	4.9"
	[ "$gcc410ok" ] && echo "	4.10"
	echo
	echo -n "Type a version number: "
	read version
fi

case $version in
	"4.6")
		[ ! "$gcc46ok" ] && echo "* ERROR" && exit
		exelist="$gcc46"
		;;
	"4.7")
		[ ! "$gcc47ok" ] && echo "* ERROR" && exit
		exelist="$gcc47"
		;;
	"4.8")
		[ ! "$gcc48ok" ] && echo "* ERROR" && exit
		exelist="$gcc48"
		;;
	"4.9")
		[ ! "$gcc49ok" ] && echo "* ERROR" && exit
		exelist="$gcc49"
		;;
	*) 
		echo "* ERROR" && exit
		;;
esac

if [ "$exelist" ] ; then
	rm -f /usr/bin/cc
	rm -f /usr/bin/c++
	ln -sfv gcc-${version} /usr/bin/cc
	ln -sfv g++-${version} /usr/bin/c++
	echo "$exelist" | while read exe ; do 
		if [ -f $exe ] ; then
			name=${exe##*/}
			dir=${exe%/*}
			shortexe=${name%-*}
			rm -f ${dir}/${shortexe}
			ln -sfv ${name} ${dir}/${shortexe}
		fi
	done
fi

### END ###

jlst

#5 Post by jlst »

I forgot to mention that (IN PRECISE PUPPY) if you compile with GCC 4.8 or 4.9, you will need the
updated GCC runtime libs, the ones from GCC 4.9.

Once you unload the SFS file, you won't be able to run apps compiled with GCC 4.8 or 4.9

These are the updated GCC runtime libs I've taken from GCC 4.9

----------------------------------------------------------------------
gcc-4.9.2-ppa-precise-runtime-i686.pet
----------------------------------------------------------------------

stemsee

#6 Post by stemsee »

Thanks for this.

I made it all into one pet for tahr @ 97.9mb
in term run 'whichgcc'

https://drive.google.com/uc?id=0B4GhZVm ... VdKaDNfa1E

Layman806
Posts: 1
Joined: Thu 06 Oct 2016, 11:27

Thanks

#7 Post by Layman806 »

stemsee wrote:Thanks for this.

I made it all into one pet for tahr @ 97.9mb
in term run 'whichgcc'

https://drive.google.com/uc?id=0B4GhZVm ... VdKaDNfa1E
Thank you very much!! :o :D

Post Reply