GithubHelp home page GithubHelp logo

mvaisakh / gcc-build Goto Github PK

View Code? Open in Web Editor NEW
59.0 3.0 36.0 138 KB

Bleeding Edge Bare Metal GCC build script.

License: GNU General Public License v3.0

Shell 100.00%
gcc toolchain toolchain-builder toolchain-script x86-64 arm64 arm eva-gcc crosscompile cross-compiler cross-compiler-toolchain arm-gcc arm64-gcc hacktoberfest hacktoberfest-accepted linux ha hacktoberfest23

gcc-build's Introduction

GCC Cross Compiler Toolchain Build Script

GCC+LLD Build

This repository contains the script needed to compile bare metal GCC for various architectures using Linux distributions. The GCC source is fetched from the master branch hence, contains all the bleeding edge changes.

Before we start

Below are the packages you'll need

  • Ubuntu or other Debian based distros

    To install and set GCC 10 as the default compiler, you need to:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update
    sudo apt-get install flex bison ncurses-dev texinfo gcc gperf patch libtool automake g++ libncurses5-dev gawk subversion expat libexpat1-dev python-all-dev binutils-dev bc libcap-dev autoconf libgmp-dev build-essential pkg-config libmpc-dev libmpfr-dev autopoint gettext txt2man liblzma-dev libssl-dev libz-dev mercurial wget tar gcc-10 g++-10 zstd --fix-broken --fix-missing
  • Arch Linux

    sudo pacman -S base-devel clang cmake git libc++ lld lldb ninja
  • Fedora

    sudo dnf groupinstall "Development tools"
    sudo dnf install mpfr-devel gmp-devel libmpc-devel zlib-devel glibc-devel.i686 glibc-devel binutils-devel g++ texinfo bison flex cmake which clang ninja-build lld bzip2

Usage

Running this script is quite simple. We start by cloning this repository:

git clone https://github.com/mvaisakh/gcc-build.git gcc-build
./build-gcc.sh -a <architechture>

As of now, I only support arm, arm64 and x86 (compiles for x86_64 only). This list is subject to change as I receive requests.

Keep in mind that this script contains just the bare minimum prerequisites.

Credits

Looking for precompiled toolchains?

My GCC Cross Compiler builds are automated and pushed biweekly i.e. on Sundays & Thursdays at 00:00 GMT+5:30 (IST). They are pushed to the releases page!

Contributing to this repo

You're more than welcome to improve the contents within this script with a pull request. Enjoy :)

gcc-build's People

Contributors

cyberknight777 avatar dakkshesh07 avatar djchittoor avatar fadlyas07 avatar jebaitedneko avatar kenhv avatar mvaisakh avatar panchajanya1999 avatar sourajitk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gcc-build's Issues

Fortran and i686 support

Hello,
could it be possible to
(a) add Fortran support (--languages=c,c++,fortran) to your toolchains
and
(b) create similar cross-compiler set (arm-gcc, aarch64-gcc, x86_64-gcc) also for x86?
I tried to do it myself but unfortunately, I did not succeed even with the pre-set configuration in your script (using WSL Ubuntu)... either one of the downoad mirrors is unavailable from my place, or the compilation crashes elsewhere.
Thanks,
AL

internal compiler error: in related_int_vector_mode, at stor-layout.cc:581

during GIMPLE pass: vect
../techpack/camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c: In function 'cam_ife_csid_process_cmd':
../techpack/camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c:4597:12: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
4597 | static int cam_ife_csid_process_cmd(void *hw_priv,
| ^~~~~~~~~~~~~~~~~~~~~~~~
CC techpack/dataipa/drivers/platform/msm/ipa/ipa_v3/ipa_uc.o
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
CC drivers/clk/qcom/clk-opp.o
make[4]: *** [../scripts/Makefile.build:287: techpack/camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.o] Error 1

during GIMPLE pass: vect
../kernel/sched/psi.c: In function 'collect_percpu_times.constprop':
../kernel/sched/psi.c:312:13: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
312 | static void collect_percpu_times(struct psi_group *group,
| ^~~~~~~~~~~~~~~~~~~~
CC drivers/crypto/msm/qcedev.o
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
CC drivers/clk/qcom/clk-regmap-mux-div.o
make[3]: *** [../scripts/Makefile.build:287: kernel/sched/psi.o] Error 1

during GIMPLE pass: vect
../fs/proc/array.c: In function 'proc_pid_status':
../fs/proc/array.c:404:5: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
404 | int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
| ^~~~~~~~~~~~~~~
CC techpack/dataipa/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.o
CC lib/zstd/compress/zstd_fast.o
AR sound/usb/bcd2000/built-in.a
AR drivers/dax/pmem/built-in.a
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
CC techpack/display/msm/dp/dp_pll_5nm.o
CC mm/madvise.o
CC drivers/dax/super.o
AR sound/usb/caiaq/built-in.a
make[3]: *** [../scripts/Makefile.build:287: fs/proc/array.o] Error 1

during GIMPLE pass: vect
../lib/zstd/decompress/huf_decompress.c: In function 'HUF_readDTableX1_wksp':
../lib/zstd/decompress/huf_decompress.c:354:8: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
354 | size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags)
| ^~~~~~~~~~~~~~~~~~~~~
CC sound/usb/validate.o
CC sound/usb/media.o
CC net/ipv6/icmp.o
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
make[3]: *** [../scripts/Makefile.build:287: lib/zstd/decompress/huf_decompress.o] Error 1

during GIMPLE pass: vect
../drivers/net/wireless/cnss2/qmi.c: In function 'cnss_wlfw_request_mem_ind_cb':
../drivers/net/wireless/cnss2/qmi.c:2402:13: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
2402 | static void cnss_wlfw_request_mem_ind_cb(struct qmi_handle *qmi_wlfw,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC drivers/opp/cpu.o
AR drivers/media/usb/gspca/built-in.a
CC drivers/opp/of.o
In file included from ../techpack/display/msm/dsi/dsi_defs.h:12,
from ../techpack/display/msm/dsi/dsi_ctrl_hw.h:15,
from ../techpack/display/msm/dsi/dsi_ctrl_hw_2_2.c:7:
../techpack/display/msm/msm_drv.h:269:20: warning: 'msm_spr_pack_type_str' defined but not used [-Wunused-variable]
269 | static const char *msm_spr_pack_type_str[MSM_DISPLAY_SPR_TYPE_MAX] = {
| ^~~~~~~~~~~~~~~~~~~~~
CC drivers/pci/controller/pci-host-common.o
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
AR drivers/media/usb/siano/built-in.a
make[5]: *** [../scripts/Makefile.build:287: drivers/net/wireless/cnss2/qmi.o] Error 1

during GIMPLE pass: vect
../drivers/net/wireless/ath/ath9k/calib.c: In function 'ath9k_hw_getnf':
../drivers/net/wireless/ath/ath9k/calib.c:400:6: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
400 | bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
| ^~~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
make[6]: *** [../scripts/Makefile.build:287: drivers/net/wireless/ath/ath9k/calib.o] Error 1

during GIMPLE pass: vect
../drivers/net/wireless/ath/carl9170/rx.c: In function '__carl9170_rx':
../drivers/net/wireless/ath/carl9170/rx.c:854:13: internal compiler error: in related_int_vector_mode, at stor-layout.cc:581
854 | static void __carl9170_rx(struct ar9170 *ar, u8 *buf, unsigned int len)
| ^~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See https://gcc.gnu.org/bugs/ for instructions.
CC drivers/regulator/dummy.o
make[6]: *** [../scripts/Makefile.build:287: drivers/net/wireless/ath/carl9170/rx.o] Error 1

Gcc Eva version: 25072024.
https://bin.cyberknight777.dev/kdRJ/raw
kt: https://github.com/dev-sm8350/kernel_oneplus_sm8350

~$ gcc --version
gcc (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="40 (Toolbx Container Image)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Toolbx Container Image)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=40
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=40
SUPPORT_END=2025-05-13
VARIANT="Toolbx Container Image"
VARIANT_ID=toolbx

~$ ldd --version
ldd (GNU libc) 2.39
Copyright (C) 2024 Free Software Foundation, Inc.

ld.lld: error: undefined symbol: __popcountdi2

Log:
ld.lld: error: undefined symbol: __popcountdi2

referenced by msm_vidc_common.c
video/msm/vidc/msm_vidc_common.o:(msm_comm_set_color_format_constraints) in archive techpack/built-in.a
referenced by dp_link.c
display/msm/dp/dp_link.o:(dp_link_process_request) in archive techpack/built-in.a
make[1]: *** [/home/togo77/kernel_oneplus_sm8350/Makefile:1299: vmlinux] Error 1
make: *** [Makefile:192: sub-make] Error 2

Full log:
https://bin.cyberknight777.dev/eVQ6/raw

kt: https://github.com/dev-sm8350/kernel_oneplus_sm8350
gcc used: 29082024
gcc of the day: 22082024. It was ok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.