{"action":"created","issue":{"url":"https://api.github.com/repos/skycocker/chromebrew/issues/2059","repository_url":"https://api.github.com/repos/skycocker/chromebrew","labels_url":"https://api.github.com/repos/skycocker/chromebrew/issues/2059/labels{/name}","comments_url":"https://api.github.com/repos/skycocker/chromebrew/issues/2059/comments","events_url":"https://api.github.com/repos/skycocker/chromebrew/issues/2059/events","html_url":"https://github.com/skycocker/chromebrew/issues/2059","id":304594877,"number":2059,"title":"Building gcc7.3 from source.","user":{"login":"nickjmeyer","id":9648755,"avatar_url":"https://avatars1.githubusercontent.com/u/9648755?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjmeyer","html_url":"https://github.com/nickjmeyer","followers_url":"https://api.github.com/users/nickjmeyer/followers","following_url":"https://api.github.com/users/nickjmeyer/following{/other_user}","gists_url":"https://api.github.com/users/nickjmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjmeyer/subscriptions","organizations_url":"https://api.github.com/users/nickjmeyer/orgs","repos_url":"https://api.github.com/users/nickjmeyer/repos","events_url":"https://api.github.com/users/nickjmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/nickjmeyer/received_events","type":"User","site_admin":false},"labels":[{"id":50836017,"url":"https://api.github.com/repos/skycocker/chromebrew/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-03-13T01:17:23Z","updated_at":"2018-04-01T17:37:59Z","closed_at":null,"author_association":"NONE","body":"## Description\r\nI am attempting to set up a new package to build gcc from source.  I'm trying to build gcc-7.3 and I've named the packet `Gcc7`.  Below are the contents of `Gcc7.rb`.\r\n\r\n```\r\nrequire 'package'\r\n\r\nclass Gcc7 < Package\r\n  description 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go.'\r\n  homepage 'https://www.gnu.org/software/gcc/'\r\n  version '7.3.0'\r\n\r\n  source_url 'https://github.com/gcc-mirror/gcc/archive/gcc-7_3_0-release.zip'\r\n\r\n  source_sha256 'd8cb199f0d98bd83e3dac645126722e44137c24cbe5e87e1113dd4270f7530c6'\r\n\r\n  depends_on 'buildessential'\r\n  depends_on 'binutils'\r\n  depends_on 'gmp'\r\n  depends_on 'mpfr'\r\n  depends_on 'mpc'\r\n  depends_on 'isl'\r\n  depends_on 'cloog'\r\n  depends_on 'glibc'\r\n\r\n  def self.build\r\n    system \"./configure\", \"-v\", \"--build=x86_64-linux-gnu\", \"--host=x86_64-linux-gnu\", \"--target=x86_64-linux-gnu\", \"--prefix=#{CREW_DEST_DIR}\", \"--libdir=#{CREW_LIB_PREFIX}\", \"--enable-checking=release\", \"--enable-languages=c,c++,fortran\", \"--disable-multilib\", \"--program-suffix=-7.3\" \r\n    system \"make\"\r\n  end\r\n\r\n  def self.install\r\n    system \"make\", \"DESTDIR=#{CREW_DEST_DIR}\", \"install-strip\"\r\n  end\r\n\r\n  def self.check\r\n    system \"make\", \"check\"\r\n  end\r\nend\r\n```\r\n\r\nTo install it, I copy `Gcc7.rb` to the installed directory:\r\n```shell\r\nchronos@localhost ~/repos/chromebrew $ cp ~/repos/chromebrew/packages/gcc7.rb /usr/local/lib/crew/packages/\r\n```\r\n\r\nThen install:\r\n```shell\r\nchronos@localhost ~/repos/chromebrew $ crew install gcc7\r\n```\r\n\r\nThe download is successful.  The build starts, but ultimately fails.  Here is the tail of the output:\r\n```\r\ngcc -E ../.././gcc/params-options.h | sed 's/^#.*//;/^$/d' > tmp-params.options\r\n/bin/bash ../.././gcc/../move-if-change tmp-all-tree.def all-tree.def\r\n/bin/bash ../.././gcc/../move-if-change tmp-params.options params.options\r\n/bin/bash ../.././gcc/../move-if-change tmp-params.list params.list\r\necho timestamp > s-alltree\r\necho \"g++ -std=gnu++98    -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H \" > checksum-options.tmp \\\r\n&& ../.././gcc/../move-if-change checksum-options.tmp checksum-options\r\necho timestamp > s-params.options\r\necho timestamp > s-params.list\r\nmawk -f ../.././gcc/config/i386/i386-builtin-types.awk ../.././gcc/config/i386/i386-builtin-types.def > tmp-bt.inc\r\nmawk: run time error: redirection not allowed in sandbox mode\r\n        FILENAME=\"\" FNR=0 NR=0\r\nmake[3]: *** [../.././gcc/config/i386/t-i386:32: s-i386-bt] Error 2\r\nmake[3]: *** Waiting for unfinished jobs....\r\n/bin/bash ../.././gcc/../move-if-change tmp-mlib.h multilib.h\r\necho timestamp > s-mlib\r\nmake[3]: Leaving directory '/usr/local/tmp/crew/gcc-7_3_0-release.zip.dir/gcc-gcc-7_3_0-release/host-x86_64-linux-gnu/gcc'\r\nmake[2]: *** [Makefile:4548: all-stage1-gcc] Error 2\r\nmake[2]: Leaving directory '/usr/local/tmp/crew/gcc-7_3_0-release.zip.dir/gcc-gcc-7_3_0-release'\r\nmake[1]: *** [Makefile:23455: stage1-bubble] Error 2\r\nmake[1]: Leaving directory '/usr/local/tmp/crew/gcc-7_3_0-release.zip.dir/gcc-gcc-7_3_0-release'\r\nmake: *** [Makefile:934: all] Error 2\r\ngcc7 failed to install: `make V=0 -j4` exited with 2\r\n```\r\n\r\n## Versions and system information\r\n```shell\r\nchronos@localhost ~/repos/chromebrew $ crew --version\r\n0.4.3\r\n```\r\nChromeOS:\r\n```\r\nchronos@localhost ~/repos/chromebrew $ cat /etc/lsb-release \r\nCHROMEOS_ARC_ANDROID_SDK_VERSION=25\r\nCHROMEOS_ARC_VERSION=4613139\r\nCHROMEOS_AUSERVER=https://tools.google.com/service/update2\r\nCHROMEOS_BOARD_APPID={01906EA2-3EB2-41F1-8F62-F0B7120EFD2E}\r\nCHROMEOS_CANARY_APPID={90F229CE-83E2-4FAF-8479-E368A34938B1}\r\nCHROMEOS_DEVSERVER=\r\nCHROMEOS_RELEASE_APPID={01906EA2-3EB2-41F1-8F62-F0B7120EFD2E}\r\nCHROMEOS_RELEASE_BOARD=eve-signed-mpkeys\r\nCHROMEOS_RELEASE_BRANCH_NUMBER=76\r\nCHROMEOS_RELEASE_BUILDER_PATH=eve-release/R64-10176.76.0\r\nCHROMEOS_RELEASE_BUILD_NUMBER=10176\r\nCHROMEOS_RELEASE_BUILD_TYPE=Official Build\r\nCHROMEOS_RELEASE_CHROME_MILESTONE=64\r\nCHROMEOS_RELEASE_DESCRIPTION=10176.76.0 (Official Build) stable-channel eve \r\nCHROMEOS_RELEASE_NAME=Chrome OS\r\nCHROMEOS_RELEASE_PATCH_NUMBER=0\r\nCHROMEOS_RELEASE_TRACK=stable-channel\r\nCHROMEOS_RELEASE_VERSION=10176.76.0\r\nDEVICETYPE=CHROMEBOOK\r\nGOOGLE_RELEASE=10176.76.0\r\n```\r\n\r\nModel: Pixelbook\r\n\r\nArchitecture: x86_64\r\n\r\n## Addtional information\r\nIf I download the source code and build using the same commands from the package file, I do not see the same failure.  The build is successful.  I will continue to tinker, but I wanted to post this to see if anyone had any thoughts.\r\n\r\nAlso, I found a blog post about installing gcc7 on chromebooks but it is not part of chromebrew.  I'm using the same command they are for building.\r\nhttps://solarianprogrammer.com/2017/10/05/building-gcc-chromebook-chrome-os/"},"comment":{"url":"https://api.github.com/repos/skycocker/chromebrew/issues/comments/377803305","html_url":"https://github.com/skycocker/chromebrew/issues/2059#issuecomment-377803305","issue_url":"https://api.github.com/repos/skycocker/chromebrew/issues/2059","id":377803305,"user":{"login":"nickjmeyer","id":9648755,"avatar_url":"https://avatars1.githubusercontent.com/u/9648755?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjmeyer","html_url":"https://github.com/nickjmeyer","followers_url":"https://api.github.com/users/nickjmeyer/followers","following_url":"https://api.github.com/users/nickjmeyer/following{/other_user}","gists_url":"https://api.github.com/users/nickjmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjmeyer/subscriptions","organizations_url":"https://api.github.com/users/nickjmeyer/orgs","repos_url":"https://api.github.com/users/nickjmeyer/repos","events_url":"https://api.github.com/users/nickjmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/nickjmeyer/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T17:37:59Z","updated_at":"2018-04-01T17:37:59Z","author_association":"NONE","body":"Ah that's probably the better solution.  I tried modifying `mxrt-utils.c` to include `linux/limits.h` and that seemed to work, but it feels like a really bad idea..."}}
{"actor":{"display_login":"nickjmeyer"}}