{"id":68,"date":"2024-09-27T08:17:52","date_gmt":"2024-09-27T08:17:52","guid":{"rendered":"https:\/\/haco.club\/?p=68"},"modified":"2024-09-27T08:21:35","modified_gmt":"2024-09-27T08:21:35","slug":"installing-building-risc-v-toolchain","status":"publish","type":"post","link":"https:\/\/haco.club\/?p=68","title":{"rendered":"Installing &amp; Building RISC-V Toolchain"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/bernardnongpoh.github.io\/posts\/riscv\">https:\/\/bernardnongpoh.github.io\/posts\/riscv<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/riscv-collab\/riscv-gnu-toolchain\">https:\/\/github.com\/riscv-collab\/riscv-gnu-toolchain<\/a><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Several standard packages are needed to build the toolchain<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Create a directory and clone<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir ~\/riscv &amp;&amp; cd ~\/riscv\n$ git clone https:\/\/github.com\/riscv\/riscv-gnu-toolchain<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure and make<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir \/opt\/riscv\n$ .\/configure --prefix=\/opt\/riscv\n$ make linux<\/code><\/pre>\n\n\n\n<p>Your tool will be available on\u00a0<code>\/opt\/riscv\/bin<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add\u00a0<code>\/opt\/riscv\/bin<\/code>\u00a0to\u00a0<code>PATH<\/code><\/h2>\n\n\n\n<p>Edit the\u00a0<code>~\/.bashrc<\/code>\u00a0file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo vim ~\/.bashrc <\/code><\/pre>\n\n\n\n<p>Add below at the end of the file and save it<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.....\nexport PATH=\"$PATH:\/opt\/riscv\/bin\"\n.....<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/bernardnongpoh.github.io\/posts\/riscv https:\/\/github.com\/riscv-collab\/riscv-gnu-toolchain Prerequisites Several standard packages are needed to build [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[8,10],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-tutotial","tag-riscv","tag-toolchain"],"_links":{"self":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68"}],"version-history":[{"count":2,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":70,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions\/70"}],"wp:attachment":[{"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}