Linux gnu gcc compiler

GCC, the GNU Compiler Collection

We strive to provide regular, high quality releases, which we want to work well on a variety of native and cross targets (including GNU/Linux), and encourage everyone to contribute changes or help testing GCC. Our sources are readily and freely available via Git and weekly snapshots.

Major decisions about GCC are made by the steering committee, guided by the mission statement.

News

GCC 10.5 released [2023-07-07] GCC Code of Conduct adopted [2023-06-16] GCC 11.4 released [2023-05-29] GCC 12.3 released [2023-05-08] GCC 13.1 released [2023-04-26] GCC BPF in Compiler Explorer [2022-12-23] Support for a nightly build of the bpf-unknown-none-gcc compiler has been contributed to Compiler Explorer (aka godbolt.org) by Marc Poulhiès Modula-2 front end added [2022-12-14] The Modula-2 programming language front end has been added to GCC. This front end was contributed by Gaius Mulley. GNU Tools Cauldron 2022 [2022-09-02] Prague, Czech Republic and online, September 16-18 2022 GCC 12.2 released [2022-08-19] GCC 10.4 released [2022-06-28] GCC 9.5 released [2022-05-27] GCC 12.1 released [2022-05-06] GCC 11.3 released [2022-04-21]

Supported Releases

Get our announcements

For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help. Comments on these web pages and the development of GCC are welcome on our developer list at gcc@gcc.gnu.org. All of our lists have public archives.

Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

These pages are maintained by the GCC team. Last modified 2023-07-07.

Источник

Downloading GCC

GCC is distributed via git and via HTTPS as tarballs compressed with gzip or bzip2 .

Please refer to the releases web page for information on how to obtain GCC.

The source distribution includes the C, C++, Objective-C, Fortran, and Ada (in the case of GCC 3.1 and later) compilers, as well as runtime libraries for C++, Objective-C, and Fortran. For previous versions these were downloadable as separate components such as the core GCC distribution, which included the C language front end and shared components, and language-specific distributions including the language front end and the language runtime (where appropriate).

If you also intend to build binutils (either to upgrade an existing installation or for use in place of the corresponding tools of your OS), unpack the binutils distribution either in the same directory or a separate one. In the latter case, add symbolic links to any components of the binutils you intend to build alongside the compiler ( bfd , binutils , gas , gprof , ld , opcodes , …) to the directory containing the GCC sources.

Читайте также:  Linux включить подсветку клавиатуры

Likewise the GMP, MPFR and MPC libraries can be automatically built together with GCC. You may simply run the contrib/download_prerequisites script in the GCC source directory to set up everything. Otherwise unpack the GMP, MPFR and/or MPC source distributions in the directory containing the GCC sources and rename their directories to gmp , mpfr and mpc , respectively (or use symbolic links with the same name).

For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help. Comments on these web pages and the development of GCC are welcome on our developer list at gcc@gcc.gnu.org. All of our lists have public archives.

Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

These pages are maintained by the GCC team. Last modified 2023-03-22.

Источник

Installing GCC

The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources.

This document describes the generic installation procedure for GCC as well as detailing some target specific installation instructions.

GCC includes several components that previously were separate distributions with their own installation instructions. This document supersedes all package-specific installation instructions.

Before starting the build/install procedure please check the host/target specific installation notes. We recommend you browse the entire generic installation instructions before you proceed.

Lists of successful builds for released versions of GCC are available at https://gcc.gnu.org/buildstat.html. These lists are updated as new information becomes available.

The installation procedure itself is broken into five steps.

Please note that GCC does not support ‘ make uninstall ’ and probably won’t do so in the near future as this would open a can of worms. Instead, we suggest that you install GCC into a directory of its own and simply remove that directory when you do not need that specific version of GCC any longer, and, if shared libraries are installed there as well, no more binaries exist that use them.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled “GNU Free Documentation License”.

Читайте также:  Чтение файловой системы linux windows

(a) The FSF’s Front-Cover Text is:

(b) The FSF’s Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.

For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help. Comments on these web pages and the development of GCC are welcome on our developer list at gcc@gcc.gnu.org. All of our lists have public archives.

Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

These pages are maintained by the GCC team. Last modified 2023-03-22.

Источник

Installing GCC

This page is intended to offer guidance to avoid some common problems when installing GCC, the official installation docs are in the Installing GCC section of the main GCC documentation. N.B. those installation docs refer to the development trunk, the installation instructions for released versions are included in the release sources.

For most people the easiest way to install GCC is to install a package made for your operating system. The GCC project does not provide pre-built binaries of GCC, only source code, but all GNU/Linux distributions include packages for GCC. The BSD-based systems include GCC in their ports collections. For other operating systems the Installing GCC: Binaries page lists some third-party sources of GCC binaries.

If you cannot find suitable binaries for your system, or you need a newer version than is available, you will need to build GCC from source in order to install it.

Building GCC

  • do not run ./configure from within the source directory, this is not supported. You need to run configure from outside the source directory, in a separate directory created for the build (this is a FAQ)
  • if GCC links dynamically to the GMP, MPFR or MPC support libraries then the relevant shared libraries must be in the dynamic linker’s path, both when building gcc and when using the installed compiler (this is also a FAQ)
Читайте также:  Операционная система linux это

Support libraries

  • If it provides sufficiently recent versions, use your OS package management system to install the support libraries in standard system locations. For Debian-based systems, including Ubuntu, you should install the packages libgmp-dev, libmpfr-dev and libmpc-dev. For RPM-based systems, including Fedora and SUSE, you should install gmp-devel, mpfr-devel and libmpc-devel (or mpc-devel on SUSE) packages. The packages will install the libraries and headers in standard system directories so they can be found automatically when building GCC.
  • Alternatively, after extracting the GCC source archive, simply run the ./contrib/download_prerequisites script in the GCC source directory. That will download the support libraries and create symlinks, causing them to be built automatically as part of the GCC build process. Set GRAPHITE_LOOP_OPT=no in the script if you want to build GCC without ISL, which is only needed for the optional Graphite loop optimizations.

The difficult way, which is not recommended, is to download the sources for GMP, MPFR and MPC, then configure and install each of them in non-standard locations, then configure GCC with --with-gmp=/some/silly/path/gmp --with-mpfr=/some/silly/path/mpfr --with-mpc=/some/silly/path/mpc, then be forced to set LD_LIBRARY_PATH=/some/silly/path/gmp:/some/silly/path/mpfr:/some/silly/path/mpc/lib in your environment forever. This is silly and causes major problems for anyone who doesn’t understand how dynamic linkers find libraries at runtime. Do not do this. If building GCC fails when using any of the --with-gmp or --with-mpfr or --with-mpc options then you probably shouldn’t be using them.

Configuration

See Installing GCC: Configuration for the full documentation. A major benefit of running srcdir/configure from outside the source directory (instead of running ./configure) is that the source directory will not be modified in any way, so if your build fails or you want to re-configure and build again, you simply delete everything in the objdir and start again.

For example, configuring and building GCC 4.6.2 (with support for C, C++, Fortran and Go) should be as simple as:

tar xzf gcc-4.6.2.tar.gz cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir $PWD/../gcc-4.6.2/configure --prefix=$HOME/GCC-4.6.2 --enable-languages=c,c++,fortran,go make make install

The make step takes a long time. If your computer has multiple processors or cores you can speed it up by building in parallel using make -j 2 (or a higher number for more parallelism).

If your build fails and your configure command has lots of complicated options you should try removing options and keep it simple. Do not add lots of configure options you don’t understand, they might be the reason your build fails.

None: InstallingGCC (последним исправлял пользователь JonathanWakely 2017-07-20 19:47:08)

Источник

Оцените статью
Adblock
detector