build x86-64 application on 32-bit machine using x86-64 toolchain
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
build x86-64 application on 32-bit machine using x86-64 toolchain
Hi,all
on 32-bit machine,i make a x86-64 toolchain using crosstool-0.43
I want to build a 64 bit helloworld application link libusb using toolchain
the libusb is download from ubuntu offical website(not built by my toolchain on purpose)
$ x86_64-unknown-linux-gnu-gcc -Iinclude -Llib -lusb main.c
lib/libusb.so: file not recognized: File format not recognized
$ lynn@lynn-oe-dev:~/temp$ ls include/
usb.h
$ lynn@lynn-oe-dev:~/temp$ ls lib/
libusb-0.1.so.4 libusb-0.1.so.4.4.4 libusb.so
I need to know which files are responsible for telling getconf that my system is x86_64-slackware64-linux, not x86_64-unknown-linux-gnu.
checking build system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
If I can't get this answered here, I will have to post it someplace else.
Edit: I just noticed that I have cpp as a file, not a link in /usr/bin/. Is cpp supposed to point somewhere else, or is that correct? Or is something else supposed to point to cpp?
Shingoshi
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1pre) Gecko/20090530 Shiretoko/3.5pre - Build ID: 20090530042121
Alien Bob,
Thank you! I will also forward this information on to someone else who specifically needs it as well. I knew something had to be wrong. I just couldn't figure out what it was. I really appreciated your help.
Ok. I have a question. And it's not meant to poke at anyone. It's just a question. Why is it that in the past, I had no problems building any applications on Slamd64 (which obviously is x86_64)? I've never even seen this before. And I've built a lot of applications. This is new to me. Has something changed in the way the compiler is (not) working? Does it have anything to do with how Slackware64 is configured itself? Is there some way to perform this operation (with a bash alias maybe) before every compile?
alias configure "cp -p /usr/share/libtool/config.{guess,sub} . && ./configure"
Did you try to build this exact same application on Slamd64? If so, what happened there?
In general, compiling software for x86_64 (more specifically Slackware64 because that is what I compile on) will not display this problem. It was only in very rare cases that I had to mess with the program's original config.sub and config.guess files in the almost 1000 Slackware64 packages that I built before release.
I have gotten the same error on every attempted configure run in Slackware64. I always have x86_64-unknown-linux-gnu returned without fail. And I believe I have all of the required tools installed. I even went back to check to make sure. None of my toolchain is x86 ia32.
So would adding this to your bash profile fix this?
alias configure "cp -p /usr/share/libtool/config.{guess,sub} . && ./configure"
And the thing that is really interesting, is that I used to build packages using Tukaani's tukbuild and Gilbert Ashley's src2pkg. Neither of them produced errors when building on Slamd64. So how is it that this is happening now? Someone mentioned a problem with Autoconf. Has that package changed from the functionality it used to provide?
Is there ever a situation where "cp -p /usr/share/libtool/config.{guess,sub} ." doesn't work? Can it ever actually be harmful in any way? If it is safe to always use that line without any issues, why can't a /etc/profile.d/configure.sh be created to provide an alias for configure as I have already described?
Quote:
#!/bin/bash
## /etc/profile.d/configure.sh
alias configure "cp -p /usr/share/libtool/config.{guess,sub} . && ./configure"
I would really like to have a global solution that works for all builds.
Did you try to build this exact same application on Slamd64? If so, what happened there?
You persevere in only listening at your own ramblings do you? Not just in the SLackware forum. Why don't you just try to anwer a helpful question? Yes, "x86_64-unknown-linux-gnu" works for a lot of other software. On slackware64.
Not that there will be any more help from me, the way you are spreading FUD against Slackware64 again after your week of having been banned from LQ.
I thought I did answer this question. But for the sake of clarity:
1.) I haven't run Slamd64 in a very long time.
2.) This isn't happening to only one application.
3.) I get this any time I run ./configure, for everything. Even when attempting to run it from the command line.
4.) I'm also getting this as well: configure: error: C compiler cannot create executables
For some reason whatever is responsible for setting the system environment for gcc, isn't working. I hope no one else has this same problem. Because they will have become collateral damage, and their systems also.
I thought I did answer this question. But for the sake of clarity:
1.) I haven't run Slamd64 in a very long time.
2.) This isn't happening to only one application.
3.) I get this any time I run ./configure, for everything. Even when attempting to run it from the command line.
4.) I'm also getting this as well: configure: error: C compiler cannot create executables
Have you tried using ARCH=x86_64 ? This is required when compiling 32bit software on a multilib x86_64 system like Slamd64 and Slackware64. As I said, and I will repeat again, I have been compiling a lot of applications on Slackware64 and there will probably be 5 packages that are part of Slackware64, and none 3rd party, that had an issue with "machine `x86_64-unknown' not recognized".
I have no idea what the consequences were of installing these Bluewhite64 packages but you may experience a result of that action.
Quote:
For some reason whatever is responsible for setting the system environment for gcc, isn't working. I hope no one else has this same problem. Because they will have become collateral damage, and their systems also.
In that case, they have only you to blame, because of your stubbornness to prove to everybody that your solution is the only correct one.
Don't misinterpret me - your solution may work well for you, and I have no issues with that. If it works, use it. But if it works for you, that does not imply that it works for everyone else.
Have you tried using ARCH=x86_64 ? This is required when compiling 32bit software on a multilib x86_64 system like Slamd64 and Slackware64. As I said, and I will repeat again, I have been compiling a lot of applications on Slackware64 and there will probably be 5 packages that are part of Slackware64, and none 3rd party, that had an issue with "machine `x86_64-unknown' not recognized".
I have no idea what the consequences were of installing these Bluewhite64 packages but you may experience a result of that action.
In that case, they have only you to blame, because of your stubbornness to prove to everybody that your solution is the only correct one.
Don't misinterpret me - your solution may work well for you, and I have no issues with that. If it works, use it. But if it works for you, that does not imply that it works for everyone else.
Eric
I greatly appreciate your comment about Bluewhite64's compatibility layer. I'm sorry to all for having been so defensive of my decision to use them. My point was simply that anyone should be free to try something that might work for them. But the overwhelming response has been, "no, you shouldn't do that. And it's obvious that no one who was objecting, had ever attempted to determine whether doing so would work. So for the most part, I was defending my right to try something others don't deem appropriate.
Now continuing with the build issue.
1.) ARCH=x86_64: I'm not attempting to compile any 32-bit applications. I'm only attempting to compile for 64-bit. What I wind up with, are no packages being built at all, or empty packages.
2.) I'm also getting an error stating: configure: error: C compiler cannot create executables
Again. I'm getting this for everything (64-bit) I try to build. Along with another statement: You must run configure first.
3.) I'm still looking to see if this is MY FAULT! It's possible that it is. I had a gcc environment control which I created setup (while I was running Slackware 32-bit) in /etc/profile.d/gcc.sh which gave the following parameters:
gcc="-g -m32 pipe"
I had to do that in order to allow me compiling any sources on my system while running a 64-bit kernel. But once I upgraded to a 64-bit system, I removed that file.
Now what I'm not sure of is whether I have to go back now and explicitly state something else to get my system to be recognized as x86_64-slackware-linux. Can I now do something similar to declare TARGET=x86_64-slackware-linux somewhere in /etc? Or do I simply need to run "unset"? I've encountered that before, when building other things with a build.sh script. I think it was some self-contained build environment I was experimenting with. I don't remember which. I just know that I had to use unset. Now I remember. It was the L4Linux setup.
I greatly appreciate your comment about Bluewhite64's compatibility layer. I'm sorry to all for having been so defensive of my decision to use them. My point was simply that anyone should be free to try something that might work for them. But the overwhelming response has been, "no, you shouldn't do that. And it's obvious that no one who was objecting, had ever attempted to determine whether doing so would work. So for the most part, I was defending my right to try something others don't deem appropriate.
I will never deny people their right to make their own decisions. Nor the right to make their own mistakes (and learn from them).
What I try fight however (second nature perhaps, being a Slackware contributor, LQ regular and IRC channel operator) is people making claims about what is right and stuffing that through other people's throats. The harder you pushed, the harder I would push back.
Quote:
Now continuing with the build issue.
1.) ARCH=x86_64: I'm not attempting to compile any 32-bit applications. I'm only attempting to compile for 64-bit. What I wind up with, are no packages being built at all, or empty packages.
2.) I'm also getting an error stating: configure: error: C compiler cannot create executables
Again. I'm getting this for everything (64-bit) I try to build. Along with another statement: You must run configure first.
3.) I'm still looking to see if this is MY FAULT! It's possible that it is. I had a gcc environment control which I created setup (while I was running Slackware 32-bit) in /etc/profile.d/gcc.sh which gave the following parameters:
gcc="-g -m32 pipe"
I had to do that in order to allow me compiling any sources on my system while running a 64-bit kernel. But once I upgraded to a 64-bit system, I removed that file.
Now what I'm not sure of is whether I have to go back now and explicitly state something else to get my system to be recognized as x86_64-slackware-linux. Can I now do something similar to declare TARGET=x86_64-slackware-linux somewhere in /etc? Or do I simply need to run "unset"? I've encountered that before, when building other things with a build.sh script. I think it was some self-contained build environment I was experimenting with. I don't remember which. I just know that I had to use unset. Now I remember. It was the L4Linux setup.
Your problems do stem from a completely over-customized system that no longer bears any resemblance to a Slackware configuration, judging from what you describe here.
So, what if you just wipe your computer completely clean (keeping backups of /home /etc and /var/spool and other goodies) and install Slackware64 from scratch, then add 32bit compatibility packages on top? And then start building software? It would be interesting to see what results you get.
I may try building a completely new system. But this one is my communications link. I won't be touching this one, until I find out on another machine what the problem is. I can live for the time being, without building packages. And, I could always setup another chroot to build the packages I need.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.