Giter Club home page Giter Club logo

gnu-toolchain-for-windows's Introduction

GNU Toolchain for Windows

This repository is a collection of binaries to create your own GNU Toolchain usable in Windows. The trunk of the master branch contains the sum of the latest versions of all binaries.

Binaries are provided for the following programs:

  • GCC 7
  • GCC 8
  • GCC 9
  • GCC 10
  • GCC 11
  • GCC Trunk (12)
  • make
  • binutils
  • gdb
  • MinGW

All binaries are 64 bit but the toolchain and debugger can produce and debug 32 Bit code as well

Executable without a prefix produce and handle 64 Bit Code. Executables with the prefix i686-w64-mingw32 produce and handle 32 Bit Code.

Only need a particular GCC version for your toolchain?

Checkout the branches:

  • GCC-7
  • GCC-8
  • GCC-9
  • GCC-10
  • GCC-11

for smaller readily available toolchains.

Features compiled in are:

  • GCC:
    • Modules support in GCC-11
    • Shared and static versions of runtime libraries such as libstdc++. By default programs are linked against shared versions. use the -static flag to compile against the static versions
    • Link Time Optimization support
    • C, C++, Fortran, ObjC, ObjC++ and D
    • OpenMP support
    • Quad Precision Math support
    • C++11 Threading using pthreads
    • Support for GCC Plugins
    • zstd LTO compression
    • iconv charset support
    • Version specific runtimes: Allows multiple GCC installations to live next to each other. This is done using version prefixes to runtime folders as well as version suffixes for each program. E.g. Executable of GCC 9 is called gcc-9. To create a symlink for the default version of gcc you want to use run one of the make-gcc-*-*-default.bat which will create symlinks such as gcc.exe and others (master branch only).
  • binutils:
    • Plugin support (needed for LTO)
  • gdb:
    • Pretty Printer support thanks to Python 2.7 statically linked into the binary
    • gdbserver
    • multi-arch support allowing debugging any target supported by gdb when remote debugging
    • iconv charset support
    • Minidebuginfo support with lzma compression
    • Precise floating point emulation with MPFR and GMP
  • MinGW:
    • Posix Threading
    • Default windows version of 0x601 (Windows 7)
    • MSVCRT Runtime instead of ucrt (Needed by e.g. Golang compiler)
    • Builds of winpthreads and winstorecompat

If you have any problems with the configuration used or are in need of any additional options and settings feel free to open an issue.

All binaries are either fully relocatable or only have a dependency on libwinpthread-1.dll. For GCC to function it requires the folder it's located in (the bin folder) to be in the system PATH.

Trunk version of this repository currently contains following versions:

  • GCC 7.5.0
  • GCC 8.5.0
  • GCC 9.4.1
  • GCC 10.3.1
  • GCC 11.1.1
  • GCC Trunk (12.0.0)
  • GDB Trunk (11.0.50)
  • Binutils Trunk (2.36.50)
  • MinGW Trunk (10.0.0)
  • Make Trunk (4.3.90)

For repositories, configure options and commit revisions see BUILDINFO.txt

gnu-toolchain-for-windows's People

Contributors

zero9178 avatar

Stargazers

 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  avatar

gnu-toolchain-for-windows's Issues

Add new branch of build

Gcc now actually supports C++20 modules now, and you can get the source from gitee using the following command:

git clone https://gitee.com/mirrors/gcc.git -b devel/c++-modules --depth=1

That way, it supports the following syntax:

import std.core;

Compilation error

While compiling with your complier, I met the following error:

C:\ptrs>C:\gcc11\gcc\bin\g++ ptrs.cpp
In file included from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\bits\postypes.h:40,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\iosfwd:40,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\ios:38,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\ostream:38,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\iostream:39,
                 from demo:1,
                 from ptrs.cpp:1:
c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\cwchar:44:10: fatal error: wchar.h: No such file or directory 
   44 | #include <wchar.h>
      |          ^~~~~~~~~
compilation terminated.

I used the following files:
demo:

#pragma once
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;

template <typename T>
class demo {
private:
    T var;
    string name;
    string scope;
    static string ato = "auto_ptr";
    static string uniq = "unique_ptr";
    static string shr = "shared_ptr";
public:
    demo(T val = 0, string n = "NULL", string sc = "main()", string pt = demo::ato) {
        var = val;
        name = n;
        scope = sc;
        cout << "Object " << name << " with value of " << var << " in scope " << scope << " created using " << pt << "." << endl;
    }
    
    ~demo() {
        cout << "Object " << name << " with value of " << var << " in scope " << scope << " destroyed by " << pt << "." << endl;
    }

    void setnm(string nm) {name = nm;}
    void setv(T v) {var = v;}
}

ptrs.cpp:

#include "demo"
#include <iostream>
#include <memory>
using namespace std;

int main() {
    auto_ptr p1 = new demo<unsigned short>(1, "p1");
    unique_ptr p2 = new demo<unsigned short>(2, "p2", , demo<unsigned short>::uniq);
    shared_ptr p3 = new demo<unsigned short>(3, "p3", , demo<unsigned short>::shr);
    auto_ptr p11 = p1;
    p11 -> setnm("p11");
    //unique_ptr p22 = p2;     will cause err at compile time
    //p22 -> setnm("p22");
    shared_ptr p33 = p3;
    p33 -> setnm("p33");
    return 0;
}

ld problem

rec.mp4

I met this ld problem, see video for more info.

Adding boost to default libraries

Boost is a very powerful librery for C++, so consider adding it to the default libraries.
You can download it from here.
PS: $version is the version you want, preferably latest stable for gcc7-10; latest beta for gcc trunk.

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.