{"id":846,"date":"2019-07-12T12:19:32","date_gmt":"2019-07-12T10:19:32","guid":{"rendered":"http:\/\/raytec.org\/wordpress\/?p=846"},"modified":"2019-07-12T12:20:27","modified_gmt":"2019-07-12T10:20:27","slug":"compiling-gcc-svn-on-macos-10-14-5","status":"publish","type":"post","link":"http:\/\/raytec.org\/wordpress\/2019\/07\/12\/compiling-gcc-svn-on-macos-10-14-5\/","title":{"rendered":"Compiling GCC-SVN on MacOS 10.14.5"},"content":{"rendered":"\r\n<p>Again <a href=\"https:\/\/support.apple.com\/en-us\/HT204899\">SIP<\/a> has brought along some user-visible changes (see previous issue with <a href=\"http:\/\/raytec.org\/wordpress\/2019\/05\/02\/apple-mail-cannot-retrieve-emails-after-macos-upgrade\/\">Apple Mail<\/a>). With the update of XCode 10 the directory <code>\/usr\/include<\/code> is not available anymore &#8212; not even after installing XCode and <code>xcode-select --install<\/code>. Without <code>\/usr\/include<\/code>, one cannot compile the GNU Compiler from source anymore. The <a href=\"https:\/\/forums.developer.apple.com\/thread\/104296\">forum&#8217;s preferred solution<\/a> is to install the package <code>\/Library\/Developer\/CommandLineTools\/Packages\/macOS_SDK_headers_for_macOS_10.14.pkg<\/code><\/p>\r\n\r\n\r\n\r\n<p>Prior to compiling GCC, one needs updated libraries, e.g. using brew: <code>brew update<\/code>. Then run <code>brew install gmp mpfr libmpc isl<\/code><\/p>\r\n\r\n\r\n\r\n<p>My configure line for GCC currently is:<\/p>\r\n<p><code>..\/configure --prefix=$PWD\/usr --enable-bootstrap --enable-languages=c,c++,fortran,jit,lto --enable-host-shared --disable-multiarch<\/code><\/p>\r\n\r\n<p>The options mean:<\/p>\r\n<ul>\r\n<li><code>--prefix=<\/code> Installation path is in the present working directory under <code>usr\/<\/code>. This allows prepending this installation&#8217;s <code>bin<\/code> directory to my <code>PATH<\/code> (and equivalent for the library&#8217;s directory to <code>LD_LIBRARY_PATH<\/code>) in order to test the new compiler.<\/li>\r\n<li><code>--enable-bootstrap<\/code> After compiling GCC with the system compiler (Apple uses an adapted Clang compiler), recompile GCC with itself in multiple sttages.<\/li>\r\n<li><code>--enable-languages<\/code> Apart from C and C++, compile with the Fortran compiler, the Just-in-Time compilation support (which requires <code>--enable-host-shared<\/code>) and link-time-optimization frontend (to allow optimization at the final link-step, which offers more optimization opportunities).<\/li>\r\n<li><code>--enable-host-shared<\/code> The GCC-internal host libraries are build as shared libraries. These are required to be dynamically loadable at runtime by applications compiling just-in-time code.<\/li>\r\n<li><code>--disable-multilib<\/code> Just compile natively for x86_64-architecture, do not compile multi-library version, e.g. 32-bit i386.<\/li>\r\n<\/ul>\r\n<p>Alternatively using <code>--with-native-system-header-dir<\/code> one may search for header files in the directory found above, not in the non-existent <code>\/usr\/include<\/code>; so here, this would be <code>--with-native-system-header-dir=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/usr\/include<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Again SIP has brought along some user-visible changes (see previous issue with Apple Mail). With the update of XCode 10 the directory \/usr\/include is not available anymore &#8212; not even after installing XCode and xcode-select &#8211;install. Without \/usr\/include, one cannot &hellip; <a href=\"http:\/\/raytec.org\/wordpress\/2019\/07\/12\/compiling-gcc-svn-on-macos-10-14-5\/\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[12],"class_list":["post-846","post","type-post","status-publish","format-standard","hentry","category-tec","tag-tec"],"_links":{"self":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/comments?post=846"}],"version-history":[{"count":7,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/846\/revisions"}],"predecessor-version":[{"id":855,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/846\/revisions\/855"}],"wp:attachment":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/media?parent=846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/categories?post=846"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/tags?post=846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}