- Что такое / usr / lib / i386-linux-gnu / for?
- 6 ответов
- Mint: correct way to install /lib/i386-linux-gnu/libgmp.so.3
- 1 Answer 1
- Update
- «No such file or directory» error when executing a binary
- 8 Answers 8
- Not the answer you’re looking for? Browse other questions tagged linux or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- How to compile glibc 32bit on an x86_64 machine
- 3 Answers 3
- //lib/i386-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
- 1 Answer 1
Что такое / usr / lib / i386-linux-gnu / for?
Перейдите к учетным записями пользователей.
Изображение из ответа Элиа Кагана «Как управлять пользователями и группами?»
Затем нажмите «Дополнительные настройки».
Изображение из ответа Элиа Кагана «Как управлять пользователями и группами?»
Затем отметьте все поля, которые вы хотите ,
Надеюсь, что это поможет !!
6 ответов
Это изменение было сделано, чтобы включить установку версий той же библиотеки, скомпилированной для разных архитектур (например, в системе AMD64, одна версия может войти в /usr/lib/x86_64-linux-gnu, а другая — в i386-linux-gnu).
[d1 ] Как стандартный компоновщик, так и динамический компоновщик знают об этих каталогах, поэтому изменение должно быть невидимым для большинства приложений. Если приложение ищет файлы фактической библиотеки вручную, это потребует изменения.
Подробности об изменениях в Ubuntu можно найти здесь:
https: //wiki.ubuntu. ком / MultiarchSpec
Это изменение было сделано, чтобы включить установку версий той же библиотеки, скомпилированной для разных архитектур (например, в системе AMD64, одна версия может войти в /usr/lib/x86_64-linux-gnu, а другая — в i386-linux-gnu).
Как стандартный компоновщик, так и динамический компоновщик знают об этих каталогах, поэтому изменение должно быть невидимым для большинства приложений. Если приложение ищет файлы фактической библиотеки вручную, это потребует изменения.
Подробности об изменениях в Ubuntu можно найти здесь:
https: //wiki.ubuntu. ком / MultiarchSpec
Это изменение было сделано, чтобы включить установку версий той же библиотеки, скомпилированной для разных архитектур (например, в системе AMD64, одна версия может войти в /usr/lib/x86_64-linux-gnu, а другая — в i386-linux-gnu).
Как стандартный компоновщик, так и динамический компоновщик знают об этих каталогах, поэтому изменение должно быть невидимым для большинства приложений. Если приложение ищет файлы фактической библиотеки вручную, это потребует изменения.
Подробности об изменениях в Ubuntu можно найти здесь:
https: //wiki.ubuntu. ком / MultiarchSpec
Это изменение было сделано, чтобы включить установку версий той же библиотеки, скомпилированной для разных архитектур (например, в системе AMD64, одна версия может войти в /usr/lib/x86_64-linux-gnu, а другая — в i386-linux-gnu).
Как стандартный компоновщик, так и динамический компоновщик знают об этих каталогах, поэтому изменение должно быть невидимым для большинства приложений. Если приложение ищет файлы фактической библиотеки вручную, это потребует изменения.
Подробности об изменениях в Ubuntu можно найти здесь:
Источник
Mint: correct way to install /lib/i386-linux-gnu/libgmp.so.3
I have a 32-bit binary that needs libgmp.so.3 on an x86_64 installation.
The cheating way would be copying libgmp.so.3 from an i386 installation and placing it in /lib/i386-linux-gnu/. But what is the proper way to install a 32-bit libgmp.so.3 on a 64-bit installation?
I tried aptitude install ia32-libs and while that does install a lot of 32-bit libs it does not install libgmp.so.3.
1 Answer 1
If you want to find out which package contains a particular file, you can use apt-file . If you want to search archives for a different architecture, you have to use the -a option, first to create/update the cache for that architecture (normal updating only creates/updates the default one) and then when searching. You can try:
This should tell you the correct package to install. If the i386 isn’t enabled for you system, you will have to enable it. You should be able to check with:
If i386 isn’t listed, you can add it with:
The above should work for newer Ubuntu versions, but for older ones you might have to do:
After adding, update the package lists:
Then you should be able to install the package found from your apt-file search like this:
If apt-file doesn’t find anything, then it could mean that the library installs to a different place. You could try:
Then install whatever package it finds. If you do this and you program still doesn’t work, you could try symlinking /lib/i386-linux-gnu/libgmp.so.3 to wherever it does install to. Otherwise, if apt-file doesn’t find anything, it likely means that there is no package which contains that version of the library in the repositories. You could then look for a package from a different version of Mint/Ubuntu (or the backports for your release may be a good place to start looking if the release’s version is older). If you are really stuck, you would have to cross-compile and install from source.
Update
Your apt-file output, shows your distro libgmp package is libgmp10 which contains libgmp.so.10 . Since you are looking for libgmp.so.3 , there is no prizes for guessing this is an older version. No point looking in backports, since this is for newer packages.
A search on http://packages.ubuntu.com/ shows there is a libgmp3 in Ubuntu 12.04. The package page with links to the list of files is here — http://packages.ubuntu.com/precise/libgmp3c2. Installing the 32 bit package on 64 bit Ubuntu/Mint will put the files in different places though (ie libraries in /lib/i386-linux-gnu . You can download it here — http://packages.ubuntu.com/precise/i386/libgmp3c2/download
Usually this is can be problematic due to possible conflicts, but since the package has a different name it shouldn’t conflict with any current libgmp . It also has only one dependency on libc6 which is the same as what is in Ubuntu 13.04 (the base for Olivia). There will be a different minor version, which may cause some odd bugs, but most likely you will be ok.
You can install like:
You may also have to install the i386 version of libc6 if you don’t have it already:
Источник
«No such file or directory» error when executing a binary
I was installing a binary Linux application on Ubuntu 9.10 x86_64. The app shipped with an old version of gzip (1.2.4), that was compiled for a much older kernel:
I wasn’t able to execute this program. If I tried, this happened:
ldd was similarly unhappy with this binary:
I’m curious: What’s the most likely source of this problem? A corrupted file? Or a binary incompatibility due to being built for a much older
Per nos’s suggestsions, here’s the output of strace ./gzip :
Here’s the output of readelf -a ./gzip :
8 Answers 8
The answer is in this line of the output of readelf -a in the original question
I was missing the /lib/ld-linux.so.2 file, which is needed to run 32-bit apps. The Ubuntu package that has this file is libc6-i386.
Old question, but hopefully this’ll help someone else.
In my case I was using a toolchain on Ubuntu 12.04 that was built on Ubuntu 10.04 (requires GCC 4.1 to build). As most of the libraries have moved to multiarch dirs, it couldn’t find ld.so. So, make a symlink for it.
Check required path:
If you’re on 32bit, it’ll be i386-linux-gnu and not x86_64-linux-gnu.
You get this error when you try to run a 32-bit build on your 64-bit Linux.
Also contrast what file had to say on the binary you tried (ie: 32-bit) with what you get for your /bin/gzip :
which is what I get on Ubuntu 9.10 for amd64 aka x86_64.
Edit: Your expanded post shows that as the readelf output also reflects a 32-bit build.
I think you’re x86-64 install does not have the i386 runtime linker. The ENOENT is probably due to the OS looking for something like /lib/ld.so.1 or similar. This is typically part of the 32-bit glibc runtime, and while I’m not directly familiar with Ubuntu, I would assume they have some sort of 32-bit compatibility package to install. Fortunately gzip only depends on the C library, so that’s probably all you’ll need to install.
I also had problems because my program interpreter was /lib/ld-linux.so.2 however it was on an embedded device, so I solved the problem by asking gcc to use ls-uClibc instead as follows:
It is possible that the executable is statically linked and that is why ldd gzip does not see any links — because it isn’t. I don’t know much about things that far back so I don’t know if there would be incompatibilities if libraries are linked in statically. I might expect there to be.
I know it’s the most obvious thing going and I’m sure you’ve done it, but chmod +x ./gzip , yes? No such file or directory is a classic symptom of that not being done, that’s why I mention it.
Well another possible cause of this can be simple line break at end of each line and shebang line If you have been coding in windows IDE its possible that windows has added its own line break at the end of each line and when you try to run it on linux the line break cause problems
Not the answer you’re looking for? Browse other questions tagged linux or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
How to compile glibc 32bit on an x86_64 machine
I’m trying to compile glibc (as a secondary, not a system replacement) 2.6 on an x86_64, and trying to get it to produce 32-bit objects. When I give it a standard configure, it compiles fine, producing the usual 64-bit library objects. Some info:
Among other things, I’ve tried the following:
The configure succeeds, but make causes a stream of compilation errors which all look like this:
I get the same result if I add —with-tls, and/or —target=i386-pc-linux-gnu.
[EDIT: It looks like I was confusing —target for —build. I tried adding —build=i386-pc-linux-gnu instead, and also for all of the other attempts where I tried —target. In all cases, I got exactly the same result as before.]
Again, the same thing happens with —with-tls
I feel like this should be easier. Am I missing something?
If you need any more information, let me know and I’ll provide it.
Attempt 5 (suggested by EmployedRussian)
This time the build runs successfully for a long time before it reaches an error. I did a search and found something suggesting that I add a «-march» flag, which I did. This finally worked:
3 Answers 3
I edited the question, but then I realized the proper way is to add an answer. Here’s what finally worked:
I think putting -m32 in CC and CXX instead of CFLAGS and CXXFLAGS was important because there was at least one compile operation during the make which didn’t use CFLAGS or CXXFLAGS, and -m32 absolutely has to always be there. Not sure why -march=i686 was necessary (given the -m32 parts and the —host/build options), but it was.
The following works for me:
Three important ./configure flags:
- —build= The system performing the build. Looks like yours is x86_64-pc-linux-gnu .
- —host= The system on which the generated objects will be used. You want to set this to i386-pc-linux-gnu .
- —target= If you are building a compiler, the system for which the built compiler will generate objects.
To perform a cross-compile, you must specify both —build= and —host= . When you only specify —host= , it will still attempt to build a native ( x86_64 ) glibc.
Источник
//lib/i386-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
I’m trying to run a file that I wrote in September 2008 and I used the Ubuntu version of that year and it worked well. Now I’ve installed Ubuntu 14.04 with NASM version 2.10.09.
I’ve compiled the code with NASM successfully with this command:
but when I try to link the object file with this command:
I get the following error:
Can somebody tell me what do I’ve to do to solve the problem?
What have changed since then because it used to work in 2008?
1 Answer 1
You can’t use the GNU C library like this. Ordinarily the C compiler will link in 3 other files: crti.o (where _start is supposed to be defined), crt0.o (or crt1.o ), and crtn.o . These files contain the initialization, startup, and teardown procedures that the GNU C library depends on for its methods and symbols to even be resolved.
If you intend to make use of the C library’s printf function (or any other libc function for that matter) then you need to do it from within the method main .
So first you have to change your _start symbol to main . Then you have change your linker command to one of two options. The easy one is
The harder one is
Note: the order in which you specify the object files to link is very important. The order must be crti.o then crt<0,1>.o then you link in your own object files and only after all of that do you link in crtn.o .
Источник