latest version glibc not configured properly on my Linux distro image - glibc

Recently, I have installed glibc-2.35 version on my Linux distribution, before I have glibc-2.27 version. After Installing I am not able to use latest version glibc as a default for compiling source code.
As a sample trail, I have successfully compiled sample program with the latest version glibc by using following command.
gcc sample.c -o out -Wl,--rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/ld-linux-riscv64-lp64d.so.1
Here, I am facing a big difficulty is how to set latest glibc as a default glibc so that I can compile source packages normally like .configure and make -j8 and make install.
Please help me to solve this issue. I am not aware of pathcelf stuff how to use exactly.

Related

Install older version of gcc cross compiler for arm on Ubuntu

I need to use gcc-arm-linux-gnueabi version 6.5, along with a version of libc that came out around the same period (I believe is libc-2.26). My host system is Ubuntu 18.04.
If I go with just a simple
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
I'll get v7 for the gcc cross compiler and v2.30 for binutills, which does not work for me, since I'll end up with errors similar to the one described here.
If I try to download the deb packages, I get unmet dependencies.
I have also tried to force apt-get to install specific versions, using something like described here but I get error messages that the version I'm looking for cannot be found.
Is there a way to force ubuntu to install specific (older) version of gcc, libc, etc.?
I know that gcc v 6 is obsolete, but I cannot do otherwise.
You could give a try to the Linaro release of gcc 6.5, available here, which comes with glibc version 2.23.

Run or use GCC without install

Can I use GCC for e.g GCC4.0.3 without installation
In my macOS I have installed Clang xcode , and GCC from Homebrew
In my Linux they are installed as well
But I want to use GCC (Specially older version) besides most updated version
Like NVM that manage Node version and it lets you install many nodejs with different version on your system
I want to use GCC4 specially for science and compiling Old FORTRAN to make my Source codes run and see the results
In new OS both macOS and Linux when you install gcc it will install most updated and that is not useful for old fortran or old codes.
So In my solution i think its better to use gcc without install or even install gcc to custom directory folder and copy the codes in that directory and compile them but not to install as wide system and make incompatibility with default GCC and CLANG on system
Thanks in advance

Compile BlueZ without updating glib

I try to compile Bluez 5.33, but after a try to configure the package, the error message configure: error: GLib >= 2.28 is required appears.
But the problem is, i am not allowed to update or install anything on this machine. How can i compile BlueZ 5.33 without updating GLib?
It depends on a newer version of GLib for a reason, it won't compile with an older version. You either build against a newer version of GLib or you stay with an older version of BlueZ.
ps: By the way, if you can't install anything on the machine, why could you use a newer version of BlueZ?

Installing gcc 4.8 on Debian

I want to start playing around with some of the newer C++11 features and it appears that the best support for this is with gcc 4.8, and Squeeze ships with 4.4.5.
However, I don't want to cause any "damage" to my current setup. What's the best way to get both versions of gcc running side-by-side? I'm concerned mostly at the large number of dependencies and that taking them all in to my current system may render it unstable.
Has anyone managed to do this, and what are the steps involved?
Failing that, I'll probably just create a VM and run an "unstable" Debian under that but it's a less-than-ideal solution.
If you install GCC from source just make sure you don't install it to /usr and it won't mess anything up. If you install it as your own user, not root, then there is zero chance of messing up the system.
See http://gcc.gnu.org/wiki/InstallingGCC for the almost-idiot-proof minimal configuration.
I have various versions built as my user and installed in ~/gcc/4.X for various X.
The only thing to be aware of using that set up is that the shared libraries for the new version aren't in the dynamic linker's default search path, so you need to use LD_LIBRARY_PATH or some other solution to ensure executables find the libs from 4.8, see the libstdc++ FAQ and the page it links to in the manual
I use a wrapper script call g++11 which simply calls the new version of GCC with -std=gnu++11 and passes a flag to the linker telling it to set the path to the 4.8 libs in the executable:
$HOME/gcc/4.8/bin/g++ -Wl,-rpath,$HOME/gcc/4.8/lib64 -std=gnu++11 -Wall -Wextra -g "$#"
I had the same problem, and didn't want to fully upgrade to testing.
Jessie (testing) now contains g++-4.8 which is compliant with C++11.
I used apt-pinning in the following way:
A source to jessie was added to /etc/apt/sources.list:
deb http://ftp.uk.debian.org/debian/ jessie main non-free contrib
/etc/apt/preferences was edited as such:
Package: *
Pin: release n=wheezy
Pin-Priority: 900
Package: gcc*
Pin: release n=jessie
Pin-Priority: 910
Then,
$ sudo aptitude update
$ sudo aptitude install gcc/jessie
At which point I selected the second presented option to resolve dependencies fully.
Debian has the package under the name gcc-4.8 (or for the c++ compiler, g++-4.8). Installing those packages will not mess up your OS, as long as you do not rename it to g++. The package is listed as experimental though.
Information on the package is here.
Update: g++-4.8 is now in testing, but an updated package is in unstable
Quick ones:
Just upgrade to testing, it is rock-solid and offers you several concurrent gcc versions. Similar for Ubuntu, on 12.10 I have gcc/g++ 4.4, 4.5, 4.6 and 4.7 in parallel.
Try the Debian backports archive, it may have a port of gcc 4.8.
Use virtualization: I prefer libvirt / kvm which is incredibly lightweight on Linux as it is kernel based. My amd64 server has two other 32 bit installations for that very reason.
Not really a SO question...
Have you tried chroot to install a newer Debian flavor?
you can play around without fear to break you working system.
install a Debian flavor that support you gcc version desired.
install a gcc version manually without affecting you working system.
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Chroot

Getting the latest version of GCC and boost on newest version of Ubuntu

First of all I know that the title is general, but i presume that is the correct way of asking questions.
Specifics are: I'm trying to get boost 1.46 and gcc 4.6 using ppa(ubuntu toolchain for gcc and boost latest for libboost). I can do it on 10.10, but it seems impossible on 11.04. So is there an official way of using the latest version of gcc and libbbost. I know that default versions for ubuntu arent the newest ones, but i need some 1.44+ boost stuff and gcc 4.6 for some nice :) c++11 features. So what is the best way to do it? PPA?
This works on every distribution on almost any operating system:
Go to gcc.gnu.org, download the sources, unpack, have a look at the README, do a
./configure
make -j4
make install (as root)
which will install gcc in the /usr/local prefix (your current compiler will be untouched).
If you want to use the compiler, you need to make your toolchain aware of it, you can use some environment variables (CC, PATH) or configure your project manually.
Repeat for boost.

Resources