I know version 9 is terribly outdated, but I have some code that I need to get running in an ancient version that will not compile with the version of gcc made available through the repository.
I tried to follow these instructions from post 40098, answer 7 (sorry I am not allowed to create links) https://forum.manjaro.org/t/gcc9-package-build-error-failed-unknown-public-key-and-other-errors-in-build/40098/7
which I had to modify a bit to not fail immediately, resulting in these steps:
sudo pacman -Syyu
sudo pacman -S base-devel binutils libmpc doxygen python git
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3AB00996FC26A641
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A328C3A2C3C45C06
git clone https://aur.archlinux.org/gcc9.git
# change the PKGBUILD (at will) in the folder
All seems to go well and the computer is busy compiling for like 2 hours until finally quitting with this message:
Thank you for the suggestions! I will look into them in a minute.
In the meantime I had retried to build gcc9 simply via the Add/Remove Software GUI.
Having retrieved a bunch of gpg keys that as well seemed to work, but after 1.5 hours of building the procedure exited with this message:
checking whether the target supports weakref... yes
checking whether the target can unlink an open file... yes
checking whether the target has CRLF as line terminator... no
configure: updating cache ./config.cache
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libgfortran.spec
config.status: creating config.h
config.status: executing default-1 commands
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing gstdint.h commands
make: Leaving directory '/var/tmp/pamac-build-bastian/gcc9/src/gcc-build'
make: *** [Makefile:997: all] Error 2
==> ERROR: A failure occurred in build().
mh, so I tried to install the AUR gcc9 package that you linked through the pamac gui.
That failed as well.
I guess you are referring to this comment?
The package fails to build with lto enabled. This option is enabled by default on devtools, and may be enabled by the user in makepkg.conf. You should explicitly disable lto by adding ‘!lto’ to the ‘options’ array like is done by repository gcc, […]
So I’ll try to set that lto-option in PKGBUILD and then build outside pamac using makepkg, right?
FYI, we no longer use buildpkg and it’s not maintained anymore. We use chrootbuild from manjaro-chrootbuild now. A lot of the same command options are the same as buildpkg like in the example in the linked post.
and that creates an entire gnu/linux root tree in /var/lib/chrootbuild …
Well, I’m excited if it works.
I don’t like that chrootbuild needs sudo.
It does so even if I choose another build directory with the -r option.
I guess it needs sudo to install prerequisites, if any.
Can I be sure that it does not mess with my system other than installing prerequired software?
I want to provide gcc9 for an isolated task (in addition to the default gcc) and not modify my main system.
A chroot is an operation that changes the apparent root directory for the current running process and their children. A program that is run in such a modified environment cannot access files and commands outside that environmental directory tree. This modified environment is called a chroot jail .