码迷,mamicode.com
首页 > 其他好文 > 详细

target triplets

时间:2017-05-10 21:57:18      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:target   triplets   

Autoconf-generated configure scripts can make decisions based on a canonical name for the system type, or target triplet, which has the form: ‘cpu-vendor-os’, where os can be ‘system’ or ‘kernel-system’


configure can  guess the canonical name for the type of system it‘s running on. To do so it runs a script called config.guess, which infers the name using the uname command or symbols predefined by the C preprocessor.


Alternately, the user can specify the system type with command line arguments to configure (see System Type. Doing so is necessary when cross-compiling. In the most complex case of cross-compiling, three system types are involved. The options to specify them are:


--build=build-type

the type of system on which the package is being configured and compiled. It defaults to the result of running config.guess. 

--host=host-type

the type of system on which the package runs. By default it is the same as the build machine. Specifying it enables the cross-compilation mode.    

--target=target-type

the type of system for which any compiler tools in the package produce code (rarely needed). By default, it is the same as host.


 

 gcc


      -dumpmachine

           Print the compiler’s target machine (for example, i686-pc-linux-gnu)---and don’t do anything else.


       -dumpversion

           Print the compiler version (for example, 3.0)---and don’t do anything else.

       -dumpspecs

           Print the compiler’s built-in specs---and don’t do anything else.  (This is used when GCC itself is being built.)


[root@jerry ~]$ gcc -dumpmachine

x86_64-redhat-linux


[root@jerry ~]$ gcc -v

Using built-in specs.

Target: x86_64-redhat-linux


[[root@jerry ~]$ ld -V

GNU ld version 2.20.51.0.2-5.44.el6 20100205

  Supported emulations:

   elf_x86_64

   elf_i386

   i386linux

   elf_l1om


[root@jerry ~]$ uname -m -o

x86_64 GNU/Linux


$ as -v

GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.44.el6 


[root@jerry ~]$ file /usr/bin/file 

/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped


target triplets

标签:target   triplets   

原文地址:http://zhiyuandai.blog.51cto.com/9640630/1924224

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!