{"id":68,"date":"2016-08-17T16:18:13","date_gmt":"2016-08-17T08:18:13","guid":{"rendered":"http:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/?p=68"},"modified":"2017-03-08T03:32:21","modified_gmt":"2017-03-07T19:32:21","slug":"gsoc-2016-code-submission-status","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/2016\/08\/17\/gsoc-2016-code-submission-status\/","title":{"rendered":"GSoC 2016: code submission status"},"content":{"rendered":"<p>This post serves as a tracker of code submitted in the domain of this GSoC project.<\/p>\n<p>This summer, I worked out a bunch of patches that enhance clang\/llvm\u00a0with\u00a0support for musl-libc, and had those patches contributed upstream. With these patches, clang is now able to correctly link binaries with musl.<\/p>\n<p>llvm musl-libc support:<br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272660\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272660<\/a><br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=273726\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=273726<\/a><\/p>\n<p>clang musl-libc support:<br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272662\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272662<\/a><br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272825\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272825<\/a><br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=273735\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=273735<\/a><br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=277985\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=277985<\/a><\/p>\n<p>There&#8217;s still a pending compatibility issue that prevents\u00a0llvm itself from\u00a0being built on musl as is. musl and llvm&#8217;s developers have different views on this issue [1], and I haven&#8217;t yet found a solution that pleases both side. Currently we&#8217;re using a downstream patch in Gentoo to make llvm and musl compatible [2].<\/p>\n<p>To have clang not link binaries with libgcc, I contributed another patch to clang that allows compiler-rt to be used as the default runtime library:<br \/>\n<a href=\"http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=276848\">http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=276848<\/a><\/p>\n<p>With those upstream enhancements, I wrote several ebuilds for Gentoo to construct a GCC-free C++ runtime environment, including:<\/p>\n<ul>\n<li>create new packages for LLVM&#8217;s libunwind and libc++abi<\/li>\n<li>enhance libc++ to support libc++abi and libunwind<\/li>\n<li>make\u00a0llvm compatible with musl-libc<\/li>\n<li>enhance clang to support libc++ as the default stdlib and compiler-rt as the default rtlib<\/li>\n<li>create a profile for using clang as the default compiler in Gentoo<\/li>\n<\/ul>\n<p>Code submitted to Gentoo:<br \/>\n<a href=\"https:\/\/github.com\/gentoo\/gentoo\/commits\/master?author=zzlei\">https:\/\/github.com\/gentoo\/gentoo\/commits\/master?author=zzlei<\/a><\/p>\n<p>Code under reviewing for Gentoo:<br \/>\n<a href=\"https:\/\/github.com\/gentoo\/gentoo\/pull\/2048\">https:\/\/github.com\/gentoo\/gentoo\/pull\/2048<\/a><br \/>\n<a href=\"https:\/\/github.com\/gentoo\/gentoo\/pull\/2049\">https:\/\/github.com\/gentoo\/gentoo\/pull\/2049<\/a><\/p>\n<p>Once the pending pull requests are merged, I&#8217;ll deliver a proper Gentoo stage3 with clang as the default compiler and all packages (except for kernel) built with clang.<\/p>\n<p>&nbsp;<\/p>\n<p>[1]\u00a0<a href=\"http:\/\/www.openwall.com\/lists\/musl\/2014\/04\/15\/5\">http:\/\/www.openwall.com\/lists\/musl\/2014\/04\/15\/5<\/a><br \/>\n[2]\u00a0<a href=\"https:\/\/github.com\/gentoo\/gentoo\/blob\/master\/sys-devel\/llvm\/files\/llvm-3.8-musl-fixes.patch\">https:\/\/github.com\/gentoo\/gentoo\/blob\/master\/sys-devel\/llvm\/files\/llvm-3.8-musl-fixes.patch<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post serves as a tracker of code submitted in the domain of this GSoC project. This summer, I worked out a bunch of patches that enhance clang\/llvm\u00a0with\u00a0support for musl-libc, and had those patches contributed upstream. With these patches, clang is now able to correctly link binaries with musl. llvm musl-libc support: http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=272660 http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&amp;revision=273726 clang &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/2016\/08\/17\/gsoc-2016-code-submission-status\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GSoC 2016: code submission status<\/span><\/a><\/p>\n","protected":false},"author":161,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/posts\/68"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/posts\/68\/revisions\/73"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc2016-native-clang\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}