The documentation you linked to states:
Warning: Downgrading packages will almost always leave you in an unsupported partial upgrade state. These instructions are intended for advanced users who understand the consequences of downgrading packages
and that's exactly what happened here; you've now got dependencies (probably not even glibc, but others) that aren't compatible with your currently installed software. So, you had to roll back.
As A.B said:
Nowadays, you just fire a container running older software (older gcc etc) so the host doesn't get this kind of problem. Btw, don't confuse gcc-libs, glibc2 or stdlibc++ with GLib.
Now, on manjaro you can use docker or podman; both do the same thing: run containers, which are essentially Linux systems "in a box", nicely isolated from the rest of your system. podman is slightly more modern, and runs better without root privileges, but supports the same commands and options as docker (where that's possible).
For example, after installing podman (sudo pacman -S podman) you can run
podman run --name myfirstcontainer -it -v /home/maxemilian:/data:Z manjarolinux/base
and it will download and run a manjaro image, give you an interactive shell on it (-it), bind what you have under /home/maxemilian as volume visible in the container as /data (using your own ownerships Z). Your container persists after exit (check podman ps -a), and can be started again using podman start --attach myfirstcontainer.
You can do the downgrade within that container, and not touch anything outside. Through the volume, your container can access the source files you need to compile!
It's very common to run a distcc as "server" compiler inside the container. You need to add --publish 3632 for that to work, and, on your development machine (i.e. your "normal" manjaro), instead of using e.g. gcc as compiler, use distcc.
podman run -it --publish 3632 --name buildserver manjarolinux/base #install gcc, distcc distccd --daemon
Try! Make a file test.c:
#include <stdio.h> int main() { printf("GCC %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); return 0; }
Run
export CC=distcc export DISTCC_HOSTS=localhost $CC -o test test.c ./test
sudo pacman -S podmanand you can do things likepodman run -it -v /home/maxemilian:/data:Z manjarolinux/baseand get cozy little system in a box that you can modify to your heart's delight without damaging your main system!