{"action":"created","issue":{"url":"https://api.github.com/repos/conda/conda-recipes/issues/279","labels_url":"https://api.github.com/repos/conda/conda-recipes/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/conda/conda-recipes/issues/279/comments","events_url":"https://api.github.com/repos/conda/conda-recipes/issues/279/events","html_url":"https://github.com/conda/conda-recipes/pull/279","id":71995325,"number":279,"title":"gcc-4.8: Fix Linux portability problems","user":{"login":"stuarteberg","id":1655821,"avatar_url":"https://avatars.githubusercontent.com/u/1655821?v=3","gravatar_id":"","url":"https://api.github.com/users/stuarteberg","html_url":"https://github.com/stuarteberg","followers_url":"https://api.github.com/users/stuarteberg/followers","following_url":"https://api.github.com/users/stuarteberg/following{/other_user}","gists_url":"https://api.github.com/users/stuarteberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stuarteberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuarteberg/subscriptions","organizations_url":"https://api.github.com/users/stuarteberg/orgs","repos_url":"https://api.github.com/users/stuarteberg/repos","events_url":"https://api.github.com/users/stuarteberg/events{/privacy}","received_events_url":"https://api.github.com/users/stuarteberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":108,"created_at":"2015-04-29T21:29:46Z","updated_at":"2015-07-23T09:44:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/conda/conda-recipes/pulls/279","html_url":"https://github.com/conda/conda-recipes/pull/279","diff_url":"https://github.com/conda/conda-recipes/pull/279.diff","patch_url":"https://github.com/conda/conda-recipes/pull/279.patch"},"body":"**Edit:** This thread is getting long, so I'll try to keep an up-to-date summary at the top here.\r\n\r\n**\\<tl;dr\\>**Without this patch, the `gcc` package is worthless on nearly all Linux distros.  But with this patch, it works on all non-ancient Linux distros.**\\</tl;dr\\>**\r\n\r\n**\\<SUMMARY\\>**\r\n\r\nConda's `gcc` package was built on CentOS 5.11, and only works on that distro.  However, we can make it work on more distros by adding a `post-link.sh` file.\r\n\r\nIn this PR, `post-link.sh` does three important things:\r\n\r\n1. Remove the headers generated by gcc's \"fixincludes\" build step.  They were made specifically for CentOS 5.11, and don't work elsewhere.  If your target OS already has ANSI-compliant libc headers, you don't need the extra \"fixed\" headers provided by gcc.  (On newer Linux distros, this seems to be the case.)\r\n2. Help gcc locate the system libc headers by adding an `-I` flag to the default gcc flags (via a `specs` file).\r\n3.  Help gcc locate certain system libc object files (e.g. `crt1.o`) by creating some symlinks to them.\r\n\r\nAlso, `post-link.sh` has the following features:\r\n\r\nI. If you are installing onto OSX, do nothing (`post-link.sh` is a no-op).\r\nII. If you are installing onto the **same OS** that was used to create the `gcc` package, do nothing. (Here, the definition of \"same OS\" means: compare the output of `cat /etc/*-release` at build-time and install-time.)\r\nIII. In interest of \"failing early\" if you're trying this `gcc` package on a system that just can't use it, the `post-link.sh` script compiles a \"Hello World\" program at install time.  If something is broken, running `conda install gcc` will simply fail.\r\n\r\n*Without* this PR, the `gcc` package is basically non-portable across Linux distros.\r\n\r\nIt's true: even *with* this PR, we still can't support *every* Linux distro under the sun, but at least now we can support a lot more.  And thanks to item `II` above, you can always just build the `gcc` recipe yourself (in which case `post-link.sh` becomes a no-op).  This means the Anaconda build server won't be affected by these changes.\r\n\r\n(Sadly, if your Linux distro is so old that it has \"bad\" libc headers, even this PR can't help you.  In that case your only option is to build gcc yourself, or obtain it through other means.)\r\n\r\nGood news! You can try this PR on own system without needing to build gcc yourself:\r\n\r\n    conda install -c stuarteberg gcc=4.8.4.99\r\n\r\nThat package is known to work on the following distros:\r\n- CentOS 5.11\r\n- CentOS 6.3\r\n- CentOS 6.6\r\n- Fedora 20\r\n- Ubuntu 12.04\r\n- Ubuntu 14.04\r\n- Archlinux\r\n\r\n**\\</SUMMARY\\>**\r\n\r\n----\r\nThis PR attempts to fix the issue described on the mailing list here:\r\nhttps://groups.google.com/a/continuum.io/d/msg/conda/HwUazgD-hJ0/aofO0vD-MhcJ\r\n\r\nTo summarize:\r\n- The gcc build scripts run a step called \"fixincludes\" which generates custom versions of several system header files.\r\n- Those files are compatible ONLY with the system gcc was built on, so including them in the gcc package makes the gcc binary non-portable to other systems.\r\n- Apparently, many Linux distros simply remove these \"fixed\" headers as a workaround for this problem.  (See http://ewontfix.com/12).  This PR does the same.\r\n- As long as the target system has ANSI-compatible headers (which don't use C language syntax that gcc doesn't support yet), it should be okay to omit the \"fixed\" versions.\r\n\r\n----\r\n**Update:** As described below, now this PR also address two other portability issues: locating system headers and locating system libc code on various distros.\r\n"},"comment":{"url":"https://api.github.com/repos/conda/conda-recipes/issues/comments/124035349","html_url":"https://github.com/conda/conda-recipes/pull/279#issuecomment-124035349","issue_url":"https://api.github.com/repos/conda/conda-recipes/issues/279","id":124035349,"user":{"login":"frol","id":304265,"avatar_url":"https://avatars.githubusercontent.com/u/304265?v=3","gravatar_id":"","url":"https://api.github.com/users/frol","html_url":"https://github.com/frol","followers_url":"https://api.github.com/users/frol/followers","following_url":"https://api.github.com/users/frol/following{/other_user}","gists_url":"https://api.github.com/users/frol/gists{/gist_id}","starred_url":"https://api.github.com/users/frol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frol/subscriptions","organizations_url":"https://api.github.com/users/frol/orgs","repos_url":"https://api.github.com/users/frol/repos","events_url":"https://api.github.com/users/frol/events{/privacy}","received_events_url":"https://api.github.com/users/frol/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T09:44:21Z","updated_at":"2015-07-23T09:44:21Z","body":"Uploaded `gcc-5` and `libgcc-5` (version 5.2.0):\r\n\r\n```\r\n$ conda install -c salford_systems gcc-5\r\n```\r\n\r\n```\r\n$ conda install -c salford_systems libgcc-5\r\n```\r\n\r\nIt works for me now!"}}