{"action":"created","issue":{"url":"https://api.github.com/repos/MLton/mlton/issues/191","repository_url":"https://api.github.com/repos/MLton/mlton","labels_url":"https://api.github.com/repos/MLton/mlton/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/MLton/mlton/issues/191/comments","events_url":"https://api.github.com/repos/MLton/mlton/issues/191/events","html_url":"https://github.com/MLton/mlton/issues/191","id":245393149,"number":191,"title":"Better support for PIC","user":{"login":"MatthewFluet","id":931523,"avatar_url":"https://avatars2.githubusercontent.com/u/931523?v=4","gravatar_id":"","url":"https://api.github.com/users/MatthewFluet","html_url":"https://github.com/MatthewFluet","followers_url":"https://api.github.com/users/MatthewFluet/followers","following_url":"https://api.github.com/users/MatthewFluet/following{/other_user}","gists_url":"https://api.github.com/users/MatthewFluet/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewFluet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewFluet/subscriptions","organizations_url":"https://api.github.com/users/MatthewFluet/orgs","repos_url":"https://api.github.com/users/MatthewFluet/repos","events_url":"https://api.github.com/users/MatthewFluet/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewFluet/received_events","type":"User","site_admin":false},"labels":[{"id":113275968,"url":"https://api.github.com/repos/MLton/mlton/labels/Compiler","name":"Compiler","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-07-25T13:00:59Z","updated_at":"2017-08-08T11:08:44Z","closed_at":null,"body":"There are a number of short- and long-term improvements to better support PIC:\r\n\r\n- [ ] add a `-native-pic {false,true}` compile-time option\r\n- [ ] determine default PIC or non-PIC for target at configure time\r\n"},"comment":{"url":"https://api.github.com/repos/MLton/mlton/issues/comments/320924429","html_url":"https://github.com/MLton/mlton/issues/191#issuecomment-320924429","issue_url":"https://api.github.com/repos/MLton/mlton/issues/191","id":320924429,"user":{"login":"MatthewFluet","id":931523,"avatar_url":"https://avatars2.githubusercontent.com/u/931523?v=4","gravatar_id":"","url":"https://api.github.com/users/MatthewFluet","html_url":"https://github.com/MatthewFluet","followers_url":"https://api.github.com/users/MatthewFluet/followers","following_url":"https://api.github.com/users/MatthewFluet/following{/other_user}","gists_url":"https://api.github.com/users/MatthewFluet/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewFluet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewFluet/subscriptions","organizations_url":"https://api.github.com/users/MatthewFluet/orgs","repos_url":"https://api.github.com/users/MatthewFluet/repos","events_url":"https://api.github.com/users/MatthewFluet/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewFluet/received_events","type":"User","site_admin":false},"created_at":"2017-08-08T11:08:44Z","updated_at":"2017-08-08T11:08:44Z","body":"@mkoloberdin @xyproto Some comments:\r\n\r\n * It shouldn't be necessary to pass `COMPILE_ARGS=\"-codegen c -cc-opt '-fPIC'\"` to `make smlnj-mlton`; those `COMPILE_ARGS` are only meaningful to MLton.\r\n * For the next bootstrap step `make -C mlton COMPILE_ARGS=\"-codegen c -cc-opt '-fPIC'\" -j1 all-no-docs`, you are asking a SML/NJ built MLton to use the C codegen to build MLton.  That is acceptable, but note that a program built with the C codegen is generally a little less efficient than one built with the native codegen.  So, the final installed `mlton` will be less efficient than it could be.  On the other hand, because the SML/NJ built MLton is so slow, it is probably beneficial to use the C codegen, which has lower compile times than the native codegen.\r\n * I'm also not sure that you need `-cc-opt '-fPIC'` once you have the current sources of MLton built (whether with SML/NJ or via some other means).  In particular, note that `COMPILE_ARGS` only affects the build of `mlton` (the compiler proper); it is not used to build the other tools (`mllex`, `mlyacc`, `mlnlffigen`).  Assuming that the whole build completes without errors, then that means that those tools were compiled by the SML/NJ built MLton using the native codegen and without an explicit `-fPIC`.\r\n\r\nYou might try the following sequence:\r\n```\r\n### Build MLton with SML/NJ\r\nmake -C mlton -j1 smlnj-mlton\r\n### An SML/NJ built MLton is slow, so use C codegen (less time in SML/NJ, more time in gcc)\r\nmake -C mlton -j1 COMPILE_ARGS='-codegen c' all-no-docs\r\n### Clean the C-codgen built MLton\r\nmake -C mlton/mlton clean\r\n### Use the C-codgen built MLton to build a native-codegen built MLton\r\nmake -C mlton -j1 all-no-docs\r\n```\r\n"}}
{"actor":{"display_login":"MatthewFluet"}}