{"action":"created","issue":{"url":"https://api.github.com/repos/skycocker/chromebrew/issues/168","repository_url":"https://api.github.com/repos/skycocker/chromebrew","labels_url":"https://api.github.com/repos/skycocker/chromebrew/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/skycocker/chromebrew/issues/168/comments","events_url":"https://api.github.com/repos/skycocker/chromebrew/issues/168/events","html_url":"https://github.com/skycocker/chromebrew/issues/168","id":151470675,"number":168,"title":"Add support for ARM","user":{"login":"lyxell","id":4975941,"avatar_url":"https://avatars.githubusercontent.com/u/4975941?v=3","gravatar_id":"","url":"https://api.github.com/users/lyxell","html_url":"https://github.com/lyxell","followers_url":"https://api.github.com/users/lyxell/followers","following_url":"https://api.github.com/users/lyxell/following{/other_user}","gists_url":"https://api.github.com/users/lyxell/gists{/gist_id}","starred_url":"https://api.github.com/users/lyxell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyxell/subscriptions","organizations_url":"https://api.github.com/users/lyxell/orgs","repos_url":"https://api.github.com/users/lyxell/repos","events_url":"https://api.github.com/users/lyxell/events{/privacy}","received_events_url":"https://api.github.com/users/lyxell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":75,"created_at":"2016-04-27T19:27:20Z","updated_at":"2016-06-08T17:29:20Z","closed_at":null,"body":"Creating a new issue to follow up the discussion in #157.\r\n\r\nHere's my first try at compiling gcc for armv7l-cros-linux-gnueabi\r\nhttps://www.dropbox.com/s/og3ru96u0nqdc4p/armv7l-cros-linux-gnueabi-gcc-4.9.3.tar.gz?dl=1\r\n\r\nIt does not include glibc. Tell me if you need it.\r\n\r\n@bfayers Could you try this out?"},"comment":{"url":"https://api.github.com/repos/skycocker/chromebrew/issues/comments/224666869","html_url":"https://github.com/skycocker/chromebrew/issues/168#issuecomment-224666869","issue_url":"https://api.github.com/repos/skycocker/chromebrew/issues/168","id":224666869,"user":{"login":"lyxell","id":4975941,"avatar_url":"https://avatars.githubusercontent.com/u/4975941?v=3","gravatar_id":"","url":"https://api.github.com/users/lyxell","html_url":"https://github.com/lyxell","followers_url":"https://api.github.com/users/lyxell/followers","following_url":"https://api.github.com/users/lyxell/following{/other_user}","gists_url":"https://api.github.com/users/lyxell/gists{/gist_id}","starred_url":"https://api.github.com/users/lyxell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyxell/subscriptions","organizations_url":"https://api.github.com/users/lyxell/orgs","repos_url":"https://api.github.com/users/lyxell/repos","events_url":"https://api.github.com/users/lyxell/events{/privacy}","received_events_url":"https://api.github.com/users/lyxell/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T17:29:19Z","updated_at":"2016-06-08T17:29:19Z","body":"Here's gcc, glibc and binutils \r\nhttps://www.dropbox.com/s/4hk4172v7nxdrnn/armv7l-cros-linux-gnueabi-toolchain.tar.gz\r\n\r\n@bfayers could you try this?\r\n```sh\r\ncd ~/Downloads\r\nwget https://www.dropbox.com/s/4hk4172v7nxdrnn/armv7l-cros-linux-gnueabi-toolchain.tar.gz\r\ntar -xvzf armv7l-cros-linux-gnueabi-toolchain.tar.gz\r\ncd ~/Downloads/usr/local/lib\r\nfor f in $(ls /lib); do rm -rf $f; done\r\nfor f in $(ls /usr/lib); do rm -rf $f; done\r\ncp -R ~/Downloads/usr/local/* /usr/local/\r\n```\r\n\r\nThis is compiled with the following Dockerfile (compilation takes approximately 1.5 hours on a modern four core machine):\r\n```Dockerfile\r\nRUN apt-get update\r\nRUN apt-get install -y --no-install-recommends \\\r\n        ca-certificates \\\r\n        gcc \\\r\n        g++ \\\r\n        make \\\r\n        wget \\\r\n        bzip2 \\\r\n        gawk \\\r\n        gettext \\\r\n        perl \\\r\n        xz-utils \\\r\n        texinfo \\\r\n        file\r\n\r\n# versions\r\nENV BINUTILS_VERSION binutils-2.26\r\nENV GMP_VERSION gmp-5.0.5\r\nENV MPFR_VERSION mpfr-3.1.4\r\nENV MPC_VERSION mpc-1.0.3\r\nENV ISL_VERSION isl-0.12.2\r\nENV CLOOG_VERSION cloog-0.18.1\r\nENV GCC_VERSION gcc-4.9.3\r\nENV GLIBC_VERSION glibc-2.23\r\nENV KERNEL_VERSION linux-3.18.31\r\n\r\nWORKDIR /src\r\n\r\n### CROSS COMPILER\r\n\r\n# download sources\r\nRUN wget https://www.kernel.org/pub/linux/kernel/v3.x/${KERNEL_VERSION}.tar.xz\r\nRUN wget https://ftp.gnu.org/gnu/gmp/${GMP_VERSION}.tar.bz2\r\nRUN wget https://ftp.gnu.org/gnu/mpfr/${MPFR_VERSION}.tar.gz\r\nRUN wget https://ftp.gnu.org/gnu/mpc/${MPC_VERSION}.tar.gz\r\nRUN wget https://ftp.gnu.org/gnu/glibc/${GLIBC_VERSION}.tar.gz\r\nRUN wget https://ftp.gnu.org/gnu/gcc/${GCC_VERSION}/${GCC_VERSION}.tar.gz\r\nRUN wget https://ftp.gnu.org/gnu/binutils/${BINUTILS_VERSION}.tar.gz\r\nRUN wget ftp://gcc.gnu.org/pub/gcc/infrastructure/${ISL_VERSION}.tar.bz2\r\nRUN wget ftp://gcc.gnu.org/pub/gcc/infrastructure/${CLOOG_VERSION}.tar.gz\r\n\r\n# extract\r\nRUN for f in *.tar*; do tar xfk $f; done\r\n\r\n# link gcc tools\r\nRUN cd /src/${GCC_VERSION} \\\r\n        && ln -s ../${GMP_VERSION} gmp \\\r\n        && ln -s ../${MPFR_VERSION} mpfr \\\r\n        && ln -s ../${MPC_VERSION} mpc \\\r\n        && ln -s ../${ISL_VERSION} isl \\\r\n        && ln -s ../${CLOOG_VERSION} cloog\r\n\r\n# compilation flags\r\nENV TARGET armv7a-cros-linux-gnueabi\r\nENV HOST x86_64-pc-linux-gnu\r\nENV ARM_ARCH armv7-a\r\nENV ARM_TUNE cortex-a15\r\nENV ARM_FPU neon\r\nENV ARM_FLOAT hard\r\nENV HOST_PREFIX /opt/cross\r\nENV PARALLELISM 8\r\n\r\n# path\r\nENV PATH ${HOST_PREFIX}/bin:$PATH\r\n\r\n# install binutils\r\nRUN mkdir -p /build/binutils\r\nRUN cd /build/binutils \\\r\n        && /src/${BINUTILS_VERSION}/configure \\\r\n        --prefix=${HOST_PREFIX} \\\r\n        --build=${HOST} \\\r\n        --host=${HOST} \\\r\n        --target=${TARGET} \\\r\n        --with-arch=${ARM_ARCH} \\\r\n        --with-tune=${ARM_TUNE} \\\r\n        --with-fpu=${ARM_FPU} \\\r\n        --with-float=${ARM_FLOAT} \\\r\n        && make -j ${PARALLELISM} \\\r\n        && make install\r\n\r\n# install kernel headers\r\nRUN cd /src/${KERNEL_VERSION} \\\r\n        && make ARCH=arm INSTALL_HDR_PATH=${HOST_PREFIX}/${TARGET} headers_install\r\n\r\n# install compiler\r\nRUN mkdir -p /build/gcc\r\nRUN cd /build/gcc \\\r\n        && /src/${GCC_VERSION}/configure \\\r\n        --prefix=${HOST_PREFIX} \\\r\n        --build=${HOST} \\\r\n        --host=${HOST} \\\r\n        --target=${TARGET} \\\r\n        --enable-languages=c,c++ \\\r\n        --with-arch=${ARM_ARCH} \\\r\n        --with-tune=${ARM_TUNE} \\\r\n        --with-fpu=${ARM_FPU} \\\r\n        --with-float=${ARM_FLOAT} \\\r\n        && make -j ${PARALLELISM} all-gcc \\\r\n        && make install-gcc\r\n\r\n# install glibc\r\nRUN mkdir -p /build/glibc\r\nRUN cd /build/glibc \\\r\n        && /src/${GLIBC_VERSION}/configure \\\r\n        --prefix=${HOST_PREFIX}/${TARGET} \\\r\n        --build=${HOST} \\\r\n        --host=${TARGET} \\\r\n        --target=${TARGET} \\\r\n        --with-headers=${HOST_PREFIX}/${TARGET}/include \\\r\n        --with-arch=${ARM_ARCH} \\\r\n        --with-tune=${ARM_TUNE} \\\r\n        --with-fpu=${ARM_FPU} \\\r\n        --with-float=${ARM_FLOAT} \\\r\n        && make install-bootstrap-headers=yes install-headers \\\r\n        && make -j ${PARALLELISM} csu/subdir_lib \\\r\n        && install csu/crt1.o csu/crti.o csu/crtn.o ${HOST_PREFIX}/${TARGET}/lib \\\r\n        && ${TARGET}-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o ${HOST_PREFIX}/${TARGET}/lib/libc.so \\\r\n        && touch ${HOST_PREFIX}/${TARGET}/include/gnu/stubs.h\r\n\r\n# compiler support\r\nRUN cd /build/gcc \\\r\n        && make -j ${PARALLELISM} all-target-libgcc \\\r\n        && make install-target-libgcc\r\n\r\n# finish glibc\r\nRUN cd /build/glibc \\\r\n        && make -j ${PARALLELISM} \\\r\n        && make install\r\n\r\n# finish gcc\r\nRUN cd /build/gcc \\\r\n        && make -j ${PARALLELISM} all \\\r\n        && make install\r\n\r\n#### NATIVE COMPILER\r\n\r\nRUN mkdir /dist\r\nENV TARGET_PREFIX=\"/dist\"\r\n\r\nENV CFLAGS=\"-O2 -march=${ARM_ARCH} -mtune=${ARM_TUNE} -mfpu=${ARM_FPU} -mfloat-abi=${ARM_FLOAT}\"\r\nENV CXXFLAGS=\"-O2 -march=${ARM_ARCH} -mtune=${ARM_TUNE} -mfpu=${ARM_FPU} -mfloat-abi=${ARM_FLOAT}\"\r\n\r\nRUN cd /build/gcc \\\r\n        && rm -rf * \\\r\n        && /src/${GCC_VERSION}/configure \\\r\n        --prefix=${TARGET_PREFIX} \\\r\n        --build=${HOST} \\\r\n        --host=${TARGET} \\\r\n        --target=${TARGET} \\\r\n        --enable-languages=c,c++ \\\r\n        && make -j ${PARALLELISM} \\\r\n        && make install\r\n\r\nRUN cd /build/binutils \\\r\n        && rm -rf * \\\r\n        && /src/${BINUTILS_VERSION}/configure \\\r\n        --prefix=${TARGET_PREFIX} \\\r\n        --build=${HOST} \\\r\n        --host=${TARGET} \\\r\n        --target=${TARGET} \\\r\n        && make -j ${PARALLELISM} \\\r\n        && make install\r\n\r\nRUN cd /build/glibc \\\r\n        && rm -rf * \\\r\n        && /src/${GLIBC_VERSION}/configure \\\r\n        --prefix=${TARGET_PREFIX} \\\r\n        --build=${HOST} \\\r\n        --host=${TARGET} \\\r\n        --target=${TARGET} \\\r\n        && make -j ${PARALLELISM} \\\r\n        && make install\r\n```"}}
{"actor":{"display_login":"lyxell"}}