Compiling gcc linked to a newer glibc

IDK if anyone here has done this, or anything like. I have a newer vanilla gcc that is working fine with my fedora system glibc. I have compiled a newer vanilla glibc and want to compile a new gcc linked to the newer glibc code. LOL, bit of a tall order.

1 Like

I don’t know which fedora version you are running, but glibc and gcc should be matched. The versions in the fedora repo are fully synced for the release you have installed.
Fedora 34 uses glibc 2.33 and fedora 35 uses glibc 2.34
This from my fedora 35 system.

$ dnf list installed glibc gcc
Installed Packages
gcc.x86_64                                                   11.2.1-7.fc35                                                  @updates
glibc.x86_64                                                 2.34-21.fc35                                                   @updates

And this from my fedora 34 system. Both systems are fully updated.

$ dnf list installed glibc gcc
Installed Packages
gcc.x86_64                                                   11.2.1-1.fc34                                                  @updates
glibc.i686                                                   2.33-20.fc34                                                   @updates
glibc.x86_64                                                 2.33-20.fc34                                                   @updates

If you compiled that gcc on the system you want it to match it should already be linked that way due to compiling.

I am actually running F35 and the most up to date fedora system gcc and glibc development libraries that I use are installed, and perfectly running at least to my knowledge and my experience so far. What I am trying to do, is build and install, and I have, the most up to date GNU libraries, the same libraries that fedora’s developers use as their source. This is a compiler experiment that I am doing using a secondary test suite compiler of my own. The system itself uses fedora’s most up to date suite. But my gcc is linked to fedora’s and I want to rebuild my gcc using my own glibc. I hope that makes sense; this might be kind of OT here. Are there developer group’s here?

1 Like

:thinking: I’m no expert on any programming languages, but it should be a way to pointing the lib directories from your code. Base on this, I tried to search on internet and found this, not sure it will work for you.

I think if we add other glibc globally to system, it will messing up the system since I believe lot of things depend on it.

Btw maybe you could try to reach out the dev from or Info | - Fedora mailing-lists .

I’m not aware of a Fedora specific way to do this. The GCC FAQ has this entry:

There’s also this post by a community member, but it hasn’t been updated in a while so I cannot be sure that the information there is still relevant:

I guess, you just point to a different prefix, one in /opt or something, and make sure your environment variables are tweaked depending on which gcc you want to use.

1 Like