Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As noted in <a href="http://jingfenghanmax.blogspot.co.uk/2010/09/configure-with-host-target-and-build.html" rel="noreferrer">this blog post</a> and alluded to in the <a href="http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html" rel="noreferrer">GCC Configure Terms</a>, <code>--target</code> only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you use </p> <pre><code>--build=the architecture of the build machine --host=the architecture that you want the file to run on </code></pre> <p>However, when you <em>are</em> building toolchains, things can get more complicated. I think that the following is correct (though I can't say I've ever manually compiled a cross-debugger):</p> <p>Lets say that you have:</p> <ul> <li>a powerpc build machine that you are going to do all compilation on</li> <li>several embedded devices, with mips processors, which your code is going to run on</li> <li>an x86 laptop that you are going to use for debugging these devices in the field </li> </ul> <p>You would configure and build your debugging server (eg gdbserver) to run on your embedded device with </p> <pre><code>./configure --build=powerpc --host=mips </code></pre> <p>so that you could putty on to your embedded device and run "gdbserver :1234 a.out" to start debugging and listen on port 1234.</p> <p>You would then build your debugging client (which connects to and controls the gdbserver) with </p> <pre><code>./configure --build=powerpc --host=i686 --target=mips </code></pre> <p>which you would copy to your x86 laptop so that in the field you could run "gdbclient embedded.device:1234" in order to debug your a.out program.</p> <p>This all applies to compilers too for which you might want to look at the GCC link above or this section about the <a href="http://airs.com/ian/configure/configure_6.html#SEC41" rel="noreferrer">Canadian cross</a> compile.</p> <p>Also note that, in practice, you might not see build, host or target specified because, according to <a href="http://www.hep.by/gnu/autoconf/Hosts-and-Cross_002dCompilation.html" rel="noreferrer">this Autoconf manual page</a>, "target defaults to host, host to build, and build to the result of config.guess."</p> <p>In a word, build the code on <code>--build</code>, run it on <code>--host</code> with <code>--target</code> architecture environment.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload