Usr local lib x86 64 linux gnu

What is the difference between /lib/i386-linux-gnu/libc.so.6, /lib/x86_64-linux-gnu/libc.so.6 and /usr/lib/x86_64-linux-gnu/libc.so?

I installed Matlab in my Linux Mint 14 Nadia (a uname -a shows: Linux Ideapad-Z570 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux) and when calling it from the command line I would get a: «/lib64/libc.so not found». I followed the help on mathworks by making a link in /lib64 as:

ln -s /lib/x86_64-linux-gnu/libc.so.6 . 
locate "libc.so" /lib/i386-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so 

I will be compiling with gcc in this computer and I would like to have full 64bit compilations. What does exactly mean to have all these different libc.so libraries? which one will the gnu compiler be using? do I need to do anything different with gcc to compile for 64 bits? I would also love to optimize as much as I can for my new i7 core.

user1889975, Hi. Are you sure that all 3 libc.so s are different? Do an ls -l on then to find symlinks. Also, there was a change recently in default path to 32/64bit libs on mixed 32/64 bit systems (from /lib64 to /lib/tr-ip-le/ ), check this page for addtional info wiki.debian.org/Multiarch/TheCaseForMultiarch

3 Answers 3

This is is 32-bit version of the library.

This is the 64-bit version of the library.

Both are usually symbolic links to the actual library file, which will usually be named according to the glibc release number, for example libc-2.15.so

This is not a library, but a linker script file, which refers to the above symlinks.

First, regardless of libc version installed, the linker will always search for libc.so , because the compiler driver will always pass to the linker the -lc options. The name libc stays the same and denotes to most recent version of the library.

Читайте также:  Linux lumia 950 xl

The symlinks libc.so.6 are named after the soname of the library, which, more or less corresponds to the ABI version of the library. The executables, linked against libc.so in fact contain runtime dependencies on libc.so.6 .

If we imagine the someday a grossly ABI incompatible libc is released, it’s soname could be named libc.so.7 , for example and this version coukld coexists with the older libc.so.6 version, thus executables linked against one or the other can coexist in the same system,

And finally, the name libc-2.15.so refers to the libc release, when you install a new libc package, the name will change to libc-2.16.so . Provided that it is binary compatible with the previous release, the libc.so.6 link will stay named that way and the existing executables will continue to work.

Источник

Where does Ubuntu look for shared libraries?

When I run a process that links to a shared library at runtime (linked when the process starts, not linked later with dlload() ), where does it look for that shared library ( .so ) file other than LD_LIBRARY_PATH ? Background: I have some C++ code that I wrote that uses a particular third-party library. I have installed the library and compiled my code on two different platforms, both Ubuntu but different versions, and different versions of gcc as well. The library was compiled and installed from source, and is located in /usr/local/lib on both platforms. When I compile my code, I link with the pkg-config —libs parameters for the third-party library and I’ve verified that pkg-config —libs returns the exact same thing on both platforms. My code compiles successfully on both platforms, and LD_LIBRARY_PATH is not defined (or defined as empty: «» ) on both platforms. However, when I run it on one platoform it works fine, and on the other I get this error:

error while loading shared libraries: libthrift-0.9.0.so: cannot open shared object file: No such file or directory 

Funnily enough, the ones that doesn’t work is the newer version of Ubuntu and gcc. :/ So I’m trying to figure out how the working one is able to locate the library, so that I can make the broken one locate the library in the same way. (i.e., without setting LD_LIBRARY_PATH ) Update: Here’s my output from cat /etc/ld.so.conf.d/* . on the working (older) system:

/usr/lib/mesa /usr/lib32/mesa /usr/lib/alsa-lib # libc default configuration /usr/local/lib # Multiarch support /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu 
# libc default configuration /usr/local/lib # Multiarch support /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa 

Источник

Читайте также:  Восстановление удаленных файлов линукс

Difference between /usr/lib and /usr/lib/x86_64-linux-gnu folders

I’m not very familiar with the linux root folders. I have an Ubuntu 18.04 machine. What is the difference between the two folders /usr/lib and usr/lib/x68_64-linux-gnu . I ask this since my boost .so files are of different versions in the two folders.

1 Answer 1

/usr/lib/x86_64-linux-gnu is the multiarch folder for libraries built for 64-bit x86 on Linux using the GNU C library. /usr/lib is the historical folder for libraries built for the system; you’ll still find libraries there because quite a few packages don’t follow the multiarch spec.

The Boost packages in Ubuntu ship their libraries in the multiarch folder, so the libraries in /usr/lib are presumably from a source other than Ubuntu, or from an older version of the package that’s still installed.

Thanks! Is it safe for me to remove the boost related .so files in the usr/lib/x68_64-linux-gnu folder, and copy the boost related .so files from /usr/lib to that folder?

Yes, in the /usr/lib folder, I have boost 1.72 version, while in the /usr/lib/x68_64-linux-gnu folder, I have 1.65 version. I am running into dependency conflicts for certain package installations because of this.

You shouldn’t manually remove packaged files; /usr (apart from /usr/local ) is managed only by the package manager. I suggest you ask a new question to explain the dependency conflicts you’re running into, you’ll get more useful answers that way.

Источник

/sbin/ldconfig.real: Can’t stat /lib/x86_64-linux-gnu

When I run ldconfig on my Ubuntu box, I get the warning: /sbin/ldconfig.real: Can’t stat /lib/x86_64-linux-gnu This is not causing any problems yet AFAIK, but I want to ‘fix’ it, incase it comes back to bite me later on. Does anyone know why I am getting this message — and how do I fix it?

Читайте также:  Apache файловый сервер linux

5 Answers 5

I had the same issue, and I believe this is intended to be a directory location for Multiarch support. See file /etc/ld.so.conf.d/x86_64-linux-gnu.conf .

The way I got the error to go away was to create the directory, as it did not exist in my machine. I ran this as root:

A similar error occurred now on Debian 11 under WSL2. The fix was to create the directory in /usr/local/lib, as mentioned by Miguel Gualdron (sorry, can’t comment, and maybe it’s better to have this as info for Debian too). The full error message is below.

Setting up libc-bin (2.31-13+deb11u2) . Aborted (core dumped) ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory ldconfig: Path `/lib/x86_64-linux-gnu' given more than once ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once /usr/lib/wsl/lib: /usr/local/lib: /lib/x86_64-linux-gnu: Aborted (core dumped) dpkg: error processing package libc-bin (--configure): installed libc-bin package post-installation script subprocess returned error exit status 134 Errors were encountered while processing: libc-bin E: Sub-process /usr/bin/dpkg returned an error code (1) 

Источник

Оцените статью
Adblock
detector