{"id":456,"date":"2023-06-12T21:03:47","date_gmt":"2023-06-12T21:03:47","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=456"},"modified":"2023-06-12T21:03:47","modified_gmt":"2023-06-12T21:03:47","slug":"weekly-report-2-llvm-libc","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/12\/weekly-report-2-llvm-libc\/","title":{"rendered":"Weekly report 2, LLVM libc"},"content":{"rendered":"<p>Hi! This week I&#8217;ve continued my work on getting Python to run. It has<br \/>\nmostly involved defining a lot of missing functions and types for<br \/>\nPython.<\/p>\n<p>These are mostly taken from musl libc, but some things are also just<br \/>\nimplemented using a no op.<\/p>\n<p>In LLVM libc there are currenly some headers without all the needed<br \/>\ndeclarations available. That will make &#8220;HAVE_*_H&#8221; configuration tests<br \/>\npass, but then fail later. For some of these cases I simply did<br \/>\n&#8216;#undef&#8217; and hoped the functionality wasn&#8217;t needed.<\/p>\n<p>My current plan is to just get Python to build, and then go back to<br \/>\nfix things properly, within reason.<\/p>\n<p>I also found a bug in LLVM libc where the <a href=\"https:\/\/llvm.org\/docs\/TableGen\/\" rel=\"noopener\" target=\"_blank\">TableGen<\/a> specifications for<br \/>\ntruncate and ftruncate had mixed up argument types. Because the<br \/>\nlibc headers are generated from these specifications, the unistd.h<br \/>\nheader had incorrect declarations for these functions. As this did not<br \/>\nadd any new things, and was easy to implement, I got it committed into<br \/>\nupstream LLVM instead of keeping it locally like the other fixes. Sam<br \/>\nsuggested that if I get stuck on something and want to do something<br \/>\nelse for I while I could go through the spec files and look for errors<br \/>\nsimilar to this (<a href=\"https:\/\/reviews.llvm.org\/D152664\" rel=\"noopener\" target=\"_blank\">truncate commit on phabricator<\/a>).<\/p>\n<p>At the end of the week I went back to fix an error I got while setting<br \/>\nup LLVM libc, that being an error related to PRId64 format string. Sam<br \/>\nsuggested that I could use this to learn how to use cvise, which I<br \/>\nwill do next week.<\/p>\n<p>Next week I aim to be finished with Python, and in that case I&#8217;ll<br \/>\ncontinue with getting Crossdev to work with LLVM by making it able to<br \/>\ncompile compiler-rt for non-host triples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi! This week I&#8217;ve continued my work on getting Python to run. It has mostly involved defining a lot of missing functions and types for Python. These are mostly taken from musl libc, but some things are also just implemented &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/12\/weekly-report-2-llvm-libc\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":177,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/456"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/177"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=456"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/456\/revisions"}],"predecessor-version":[{"id":457,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/456\/revisions\/457"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}