OS: Arch-Linux
Kernel: 4.2.5-1
GCC:5.3.0 & 5.1.0 <--(as of 20:11 MST 2015.12.20)
Processor: AMD A10-7300 Radeon R6, 10 compute cores 4c+6G
-------------------------------------------------------------
This post's purpose is to fill a gap for me and perhaps anyone out there that might have some of these questions but have had the difficulies in finding answers and information on the Internet: that is, compiling Gcc and its' various options. Hopefully, this could grow into something very useful for people like me that enjoy the challange and tend to do things the hard way.
This started with my need to install an earlier version of Gcc to suit the recommendations of the current LFS project; I have in working order Gcc-5.3.0 provided by my distrubtion-install. I have some experience from a couple of classes and hours of varied levels of success and failures with building from source.
A) Target
===========
I am attempting to build gcc-5.1.0 for a laptop that utilizes an AMD processor which I have listed above. My first attempt to build this compiler resulted in an output from 'uname -p' as unknown. I am certain that this is the target which the configure process provides by default, as per the GNU website
https://gcc.gnu.org/install/configure.html which states the following under "Target Specification" :
Quote:
GCC has code to correctly determine the correct value for target for nearly all native systems.
|
Also, a comment found here at
http://unix.stackexchange.com/questi...-in-arch-linux where user Wieland states
Quote:
it sounds like the information provided by that field is more of informational nature and unknown is just the default value GCC uses unless explicitly overwritten.
|
which supports the same.
However, therein are examples of output with specific and "complete" names of machines: x86_64-linux-gnu, x86_64-pc-linux-gnu, etc. Is the solution for disambiguation using the flag '--target'? I understand that the gcc.gnu.org specifically advises NOT to use this option:
Quote:
Therefore, we highly recommend you do not provide a configure target when configuring a native compiler.
|
Is there a way to use it safely? If the compiler has code to correctly identify the target, then why is my target listed as unknown? Would a valid designation, then, be '--target=x86_64-arch-linux-gnu', considering my distribution Arch-Linux?
If the solution is a simple as providing the option as above, then I have trouble reconciling the purpose of the list of target/host entries provided here for reference:
https://gcc.gnu.org/install/specific.html. Regarding this list, which one of these entries referrs to my processor listed above? I supsect it is the x86_64 or amd64 entry because I know my machine is not solaris and when I execute 'uname -m, the output is 'x86_64'. Incidently, are there any other ways that can confirm this for me?
B) Options
===========
If the target name provides a vital purpose in distinguishing the kind of machine for which the compilier produces code, setting-up the compilation environment for that particular machine to ensure success in compilation, etc, what then is the difference between specifying '--target' and '--with-cpu'? Both flags relate to idnentifying systems with computer architecture in mind, but in implementation, what would sucessfully using '--with-cpu' flag do? If '--target ' and '--with-cpu' are interchangable, then which of these options would be better - for lack of a better word - to use?
Would I be correct to assume that a valid argument for option '--with-cpu' coud be '--with-cpu=amd64'? If it is not a valid argument, what the, could be a valid one given the processor listed above?; is ther a list that anyone knows of that provides this sort of information? My next guess would be x86)_64 simply because of the output provided by uname and because of this statement from
https://gcc.gnu.org/install/configure.html:
Quote:
...these options are only supported for i386, x86-64 and PowerPC.
|
, to indicate a few of the possible arguments for the "--with-*" line of options listed on that page.
Please, anyone with any guidance, knowledge, experience: welcome; I am looking to learn and to be challanged.