SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Let's say I built something from source but had no CFLAGS defined globally. What would the resulting binaries be? They would have been compiled on an i686 cpu more than likely but no -march, -mtune or -mcpu options are defined anywhere. Will gcc automatically default to i386 or would it somehow be a 'noarch' even tho binaries are involved?
I did compile it myself. Running a Slack/Arch hybrid at the moment. This is more of a curiosity than anything. I set a global CFLAGS and CXXFLAGS of -march=i686 -pipe -O2 but I was really curious what gcc will do on it's own if no CFLAGS are defined globally or in any given Makefile. You would think that the resulting binary should still run on an i386 arch if you didn't tell it to optimize for any given arch. It should pick the lowest common denominator... Thats just my guess anyway...
Anyone know how to test a binary file to see what arch it will run on?
I would think it is hard to figure out, the commands :
file /path/to/your/program
-->will just report the architecture and some stuff
strings /path/to/your/program
-->will output all strings found in the program (compiler and linker path, version, and more...)
Other than that a good assembly knowledge is required if you want to find which
with flags the program was compiled by dissassemble it and even in this case I would think
you won't find all flags infos
Interesting... Well, thanks. I let this one snow ball in my mind. I suppose it doesn't really matter tho I'd still like to know. It may be one of the unexplained mysteries of the universe...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.