Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is a rather complex situation and I'll happily accept somebody telling me a better way to do any part of this.
1. I have to use an old version of gcc (4.1), so I built and installed it into a subdirectory which does not interfere with the versions which I've had ubuntu install. (4.4,4.5,4.6)
2. Upon using this compiler by adjusting the /usr/bin/g{cc,++,fortran} links to the gcc 4.1 versions, I found that many times the wrong libstdc++ was being linked against causing symbol lookup errors. To solve this problem (and avoid using LD_LIBRARY_PATH and LD_RUN_PATH) I decided to use the a gcc specs file to add the correct run path at the linking stage. I did this by using a perl script to add the spec file argument before all other arguments passed to the various gcc compilers.
%rename link old_link
*link:
-rpath=/usr/local/src/gnu/gcc/4.1/install/lib64 %{old_link}
3. Now for the problem. When I try to compile a simple hello world test,
test program:
Code:
#include "stdio.h"
int main()
{
printf("Hello world!");
return 0;
}
I find that I cannot execute the output './a.out' because bash thinks it doesn't exist! Below I've attached several diagnostic commands which show that a.out compiled correctly, exists, it's linked properly and yet bash won't execute it. I've also included two commands which I've read can help diagnose the problem, but that I don't really understand what they say, and am hoping someone else who reads this will understand.
I had this really wonky thing happen to me when I upgraded from Debian Squeeze to Debian Wheezy... The dist-upgrade finished, I did a reboot, only to find that I couldn't execute anything in the current directory even though the files were chmod'd to be executable. It just couldn't find the file in the current directory even with ./
I could only execute things if I typed in the fully qualified path (/home/david/test.sh). I did another apt-get update and apt-get dist-upgrade.. Installed a bunch more stuff, rebooted and after that it was fixed.. Sorry, I'm sure that's probably not much help to you.
The only thing of this that still remains is that if there is an executable for a difference architecture in the current folder, and even if it's set as executable, the filesystem simply pretends that it doesn't see it.. This is still the case in Debian wheezy and I'm not sure what to make of it.. I want to file a bug, but then again, I realized that the executable I was running was compiled for a different architecture (AMD64 executable on an i386 system) which I guess would just segfault anyway.
I'm positive that in Debian Lenny (years ago), it would try to run it no matter what and then just segfault or throw an error. Now it just pretends that it doesn't see the file, if the file is executable and for a different architecture. It gives a very confusing error message saying it can't find the file when it's clearly right there in the folder and executable.
Have you tried adding both AMD64 and i386 to your architecture? Debian is moving towards "multi-architecture" and looking to get rid of the ia32-libs package which is ridiculously large and full of redundant libs. This might be something related to the move to MultiArch as a *LOT* of libs are getting shuffled around during this transition.
Such strange stuff.. Hope that helps... Or at the very least puts you on the right path to finding a solution.. Maybe there is nothing wrong with your binary and the problems is with your distro installation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.