{"id":862,"date":"2019-11-10T16:09:07","date_gmt":"2019-11-10T14:09:07","guid":{"rendered":"http:\/\/raytec.org\/wordpress\/?p=862"},"modified":"2019-11-10T21:01:41","modified_gmt":"2019-11-10T19:01:41","slug":"compiling-gcc-svn-on-macos-10-15","status":"publish","type":"post","link":"http:\/\/raytec.org\/wordpress\/2019\/11\/10\/compiling-gcc-svn-on-macos-10-15\/","title":{"rendered":"Compiling GCC-SVN on MacOS 10.15"},"content":{"rendered":"<p>It could be so easy, but with every MacOS release several things change and some break &#8212; again so with MacOS Catalina (aka MacOS 10.15).<\/p>\n<p>For GCC compilation, the directory \/usr\/include finally is gone for good (no .pkg-file to install aftwards to make it available again &#8212; see previous entry on <a href=\"http:\/\/raytec.org\/wordpress\/2019\/07\/12\/compiling-gcc-svn-on-macos-10-14-5\/\">GCC on MacOS 10.14<\/a>).<\/p>\n<p>With <code>\/usr\/include<\/code> gone, one needs to specify the SDK&#8217;s directory containing the native system files:<\/p>\n<pre>--with-build-sysroot=\/Library\/Developer\/CommandLineTools\/SDKs\/MacOSX10.15.sdk\/<\/pre>\n<p>The MacOS system header files have evolved. Bootstrapping the compiler fails compiling in <code>libstdc++\/libsupc++<\/code> the file <code>atexit_thread.cc<\/code>:<\/p>\n<pre>\r\nlibtool: compile: \/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/.\/gcc\/xgcc -shared-libgcc -B\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/.\/gcc -nostdinc++ -L\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/src -L\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/src\/.libs -L\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/libsupc++\/.libs -B\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/usr\/x86_64-apple-darwin19.0.0\/bin\/ -B\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/usr\/x86_64-apple-darwin19.0.0\/lib\/ -isystem \/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/usr\/x86_64-apple-darwin19.0.0\/include -isystem \/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/usr\/x86_64-apple-darwin19.0.0\/sys-include --sysroot=\/Library\/Developer\/CommandLineTools\/SDKs\/MacOSX10.15.sdk\/ -fno-checking -I\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/libstdc++-v3\/..\/libgcc -I\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/include\/x86_64-apple-darwin19.0.0 -I\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/include -I\/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/libstdc++-v3\/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=atexit_thread.lo -g -O2 -c ..\/..\/..\/..\/libstdc++-v3\/libsupc++\/atexit_thread.cc -fno-common -DPIC -D_GLIBCXX_SHARED -o atexit_thread.o\r\nIn file included from \/Library\/Developer\/CommandLineTools\/SDKs\/MacOSX10.15.sdk\/usr\/include\/sys\/wait.h:110,\r\nfrom \/Library\/Developer\/CommandLineTools\/SDKs\/MacOSX10.15.sdk\/usr\/include\/stdlib.h:66,\r\nfrom \/Users\/hpcraink\/DATA\/SOFTWARE\/gcc-svn\/BUILD-MacOS\/x86_64-apple-darwin19.0.0\/libstdc++-v3\/include\/cstdlib:75,\r\nfrom ..\/..\/..\/..\/libstdc++-v3\/libsupc++\/atexit_thread.cc:25:\r\n\/Library\/Developer\/CommandLineTools\/SDKs\/MacOSX10.15.sdk\/usr\/include\/sys\/resource.h:443:34: error: expected initializer before \u2018__OSX_AVAILABLE_STARTING\u2019\r\n443 | int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);\r\n| ^~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n<\/pre>\n<p>This is due to the system header&#8217;s file <code>Availability.h<\/code> not defining the macro <code>__OSX_AVAILABLE_STARTING<\/code>, since the just-compiled <code>cc1<\/code> does not offer <code>defined(__has_feature)<\/code>&#8230;<\/p>\n<p>One needs to amend the header <code>Availability.h<\/code> with the following patch:<\/p>\n<pre>--- Availability.h 2019-11-10 15:02:48.000000000 +0100\r\n+++ Availability.h.WORKS 2019-11-10 15:05:10.000000000 +0100\r\n@@ -290,6 +290,12 @@\r\n#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)\r\n#endif\r\n#endif\r\n+\r\n+ #ifndef __OSX_AVAILABLE_STARTING\r\n+   #define __OSX_AVAILABLE_STARTING(_osx, _ios)\r\n+   #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)\r\n+   #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)\r\n+ #endif\r\n#endif \/* __OSX_AVAILABLE_STARTING *\/\r\n\r\n#else<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It could be so easy, but with every MacOS release several things change and some break &#8212; again so with MacOS Catalina (aka MacOS 10.15). For GCC compilation, the directory \/usr\/include finally is gone for good (no .pkg-file to install &hellip; <a href=\"http:\/\/raytec.org\/wordpress\/2019\/11\/10\/compiling-gcc-svn-on-macos-10-15\/\">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":[1,5],"tags":[],"class_list":["post-862","post","type-post","status-publish","format-standard","hentry","category-allgemein","category-tec"],"_links":{"self":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/862","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=862"}],"version-history":[{"count":3,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":865,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/posts\/862\/revisions\/865"}],"wp:attachment":[{"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/media?parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/categories?post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/raytec.org\/wordpress\/wp-json\/wp\/v2\/tags?post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}