Warning: Undefined array key 1 in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 505

Warning: Undefined array key 2 in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 505

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 557

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930
{"id":1968,"date":"2016-03-22T23:12:03","date_gmt":"2016-03-22T23:12:03","guid":{"rendered":"http:\/\/www.yogindar.com\/news\/?p=1968"},"modified":"2016-03-22T23:12:03","modified_gmt":"2016-03-22T23:12:03","slug":"a-quick-introduction-on-toolchain","status":"publish","type":"post","link":"http:\/\/blog.yogindar.org\/?p=1968","title":{"rendered":"A Quick introduction on Toolchain"},"content":{"rendered":"

What is a Toolchain?<\/p>\n

Its a set of tools linked together by specific stages which can be used to run on a specific machine.
\nIt contains tools for compiling, debugging , binary file manipulation and analysis.
\nThere are pre-built toolchain available in internet. We can build our own using automated tool chain build tools or from scratch.<\/p>\n

What are the types of Toolchain available?<\/p>\n

Tool chains are run on 3 machine types
\nBuild – The machine where the tool chain is first built.
\nHost – The machine where the tool chain is used to generate the target binary.
\nTarget – The machine where the target binary is run.<\/p>\n

Based on the above below are the Toolchain types
\nNative – The build, host and target are the same architecture. E.G:- The GCC compiler coming with RedHat x86 version
\nCross Compiled – The build and host are same architecture, but the target is different. E.G:- Using x86 GCC creating a cross compiled GCC which generates binary to run on an ARM processor.
\nCross Native – The host and target are of the same architecture. E.G;- Using x86 GCC create a cross native arm GCC, which can be used in an ARM Linux OS to generate binary which runs on ARM processor.
\nCanadian Build – The architecture for all the build, host and target differs. E.G:- Using X86 GCC create an ARM GCC which generates binary to run on a PPC machine. In this case build and target can be same architecture.<\/p>\n

What are the Toolchain components?
\nThe main components are
\nBinutils – as,ld,readelf etc
\nCompiler – gcc,g++ etc
\nC library – glibc, uclibc etc
\nDebugger – gdb
\nKernel – headers<\/p>\n

What are the stages in building a Toolchain?
\n1. Download sources for the components
\n2. Set the environment variables for the Toolchain build. e.g:- setting the build, host, target architecture and intermediate installation directories.
\n3. Build first the binutils
\n4. Build the bootstrap gcc with options –with-gnu-as –with-gnu-ld to instruct the compiler to use binutils assembler and linker than native assembler and linker.
\n5. Build glibc
\n6. Build gcc again with newly build glibc with options –with-gnu-as –with-gnu-ld to instruct the compiler to use binutils assembler and linker than native
\n7. Build gcc again with newly build glibc with options –with-gnu-as –with-gnu-ld to instruct the compiler to use binutils assembler and linker than native. This is to compare the binaries and make sure you are getting the same output and no compiler bug.
\n8. Use the Toolchain to build your application.
\n9. Run your application on the target machine.<\/p>\n

What are the options for building a Toolchain?
\nOption 1: Build your own
\nOption 2: Prebuilt Toolchain. e.g:- CodeSourcery, Linoro(ARM) etc
\nOption 3: Automated Toolchain build systems. e.g:- Buildroot, Open ADK, crosstool-NG<\/p>\n

Note:- The option 2 and 3 helps in quick development as the dependencies between the Toolchain components will be taken care by the maintainers of the Toolchain build systems.<\/p>\n","protected":false},"excerpt":{"rendered":"

What is a Toolchain? Its a set of tools linked together by specific stages which can be used to run on a specific machine. It contains tools for compiling, debugging , binary file manipulation and analysis. There are pre-built toolchain available in internet. We can build our own using automated tool chain build tools or […]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[1466,1484,1336,1483],"class_list":["post-1968","post","type-post","status-publish","format-standard","hentry","category-linux","tag-arm","tag-cross-compile","tag-gcc-2","tag-toolchain"],"_links":{"self":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1968"}],"version-history":[{"count":1,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1968\/revisions"}],"predecessor-version":[{"id":1969,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1968\/revisions\/1969"}],"wp:attachment":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1968"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}