Misplaced Pages

GnuWin32

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In software engineering , porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally designed for (e.g., different CPU , operating system, or third party library ). The term is also used when software/hardware is changed to make them usable in different environments.

#547452

58-547: The G nu W in 32 project provides native ports in the form of executable computer programs, patches, and source code for various GNU and open source tools and software, much of it modified to run on the 32-bit Windows platform. The ports included in the G nu W in 32 packages are: Most programs have dependencies (typically DLLs ), so that the executable files cannot simply be run in Windows unless files they depend upon are available. An alternative set of ported programs

116-550: A 68000 Unix system with only 64 KB, and concluded he would have to write a new compiler from scratch. None of the Pastel compiler code ended up in GCC, though Stallman did use the C front end he had written. GCC was first released March 22, 1987, available by FTP from MIT . Stallman was listed as the author but cited others for their contributions, including Tower for "parts of the parser, RTL generator, RTL definitions, and of

174-430: A C++ compiler is required that understands ISO/IEC C++03 standard. On May 18, 2020, GCC moved away from ISO/IEC C++03 standard to ISO/IEC C++11 standard (i.e. needed to compile, bootstrap, the compiler itself; by default it however compiles later versions of C++). Each front end uses a parser to produce the abstract syntax tree of a given source file . Due to the syntax tree abstraction, source files of any of

232-460: A PC without the need for actual porting (instead relying on the common porting of individual component libraries ). Porting arcade games to home systems with inferior hardware was difficult. The ported version of Pac-Man for the Atari 2600 omitted many of the visual features of the original game to compensate for the lack of ROM space and the hardware struggled when multiple ghosts appeared on

290-537: A front-end for CHILL due to a lack of maintenance. Before version 4.0 the Fortran front end was g77 , which only supported FORTRAN 77 , but later was dropped in favor of the new GNU Fortran front end that supports Fortran 95 and large parts of Fortran 2003 and Fortran 2008 as well. As of version 4.8, GCC is implemented in C++. Support for Cilk Plus existed from GCC 5 to GCC 7. GCC has been ported to

348-581: A higher combined price than the previous bundle, which led many of Sun's users to buy or download GCC instead of the vendor's tools. While Stallman considered GNU Emacs as his main project, by 1990 GCC supported thirteen computer architectures, was outperforming several vendor compilers, and was used commercially by several companies. As GCC was licensed under the GPL, programmers wanting to work in other directions—particularly those writing interfaces for languages other than C—were free to develop their own fork of

406-399: A home console with the same specifications. This allowed arcade perfect games to be played at home. A "console port" is a game that was originally made for a console before an identical version is created which can be played on a personal computer . This term has been widely used by the gaming community. The process of porting a game from a console to a PC is often regarded negatively due to

464-433: A language-specific driver program ( gcc for C, g++ for C++, etc.), which interprets command arguments , calls the actual compiler, runs the assembler on the output, and then optionally runs the linker to produce a complete executable binary. Each of the language compilers is a separate program that reads source code and outputs machine code . All have a common internal structure. A per-language front end parses

522-447: A machine independent intermediate code in order to enhance portability of the compiler and minimize design efforts. The intermediate language defines a virtual machine that can execute all programs written in the intermediate language (a machine is defined by its language and vice versa). The intermediate code instructions are translated into equivalent machine code sequences by a code generator to create executable code . It

580-446: A much more limited scope, and have less high-level information. Some of these optimizations performed at this level include dead-code elimination , partial-redundancy elimination , global value numbering , sparse conditional constant propagation , and scalar replacement of aggregates . Array dependence based optimizations such as automatic vectorization and automatic parallelization are also performed. Profile-guided optimization

638-439: A policy was not always feasible; Bunten stated that "M.U.L.E. can't be done for an Apple", and that the non-Atari versions of The Seven Cities of Gold were inferior. Compute!'s Gazette wrote in 1986 that when porting from Atari to Commodore the original was usually superior. The latter's games' quality improved when developers began creating new software for it in late 1983, the magazine stated. In porting arcade games ,

SECTION 10

#1732771869548

696-498: A program between two standards-compliant platforms (such as POSIX.1 ) can be just a matter of loading the source code and recompiling it on the new platform, but practitioners often find that various minor corrections are required, due to subtle platform differences. Most standards suffer from "gray areas" where differences in interpretation of standards lead to small variations from platform to platform. There also exists an ever-increasing number of tools to facilitate porting, such as

754-602: A wide variety of instruction set architectures , and is widely deployed as a tool in the development of both free and proprietary software . GCC is also available for many embedded systems , including Symbian (called gcce ), ARM -based, and Power ISA -based chips. The compiler can target a wide variety of platforms, including video game consoles such as the PlayStation 2 , Cell SPE of PlayStation 3, and Dreamcast . It has been ported to more kinds of processors and operating systems than any other compiler. As of

812-459: Is UnxUtils ; these are usually older versions, but depend only on the Microsoft C - runtime msvcrt.dll . There is a package maintenance utility, GetGnuWin32, to download and install or update current versions of all GnuWin32 packages. This Microsoft Windows software -related article is a stub . You can help Misplaced Pages by expanding it . Porting Software is portable when

870-423: Is a simplified GENERIC, in which various constructs are lowered to multiple GIMPLE instructions. The C , C++ , and Java front ends produce GENERIC directly in the front end. Other front ends instead have different intermediate representations after parsing and convert these to GENERIC. In either case, the so-called "gimplifier" then converts this more complex form into the simpler SSA -based GIMPLE form that

928-443: Is also possible to skip the generation of machine code by actually implementing an interpreter or JIT for the virtual machine. The use of intermediate code enhances portability of the compiler, because only the machine dependent code (the interpreter or the code generator) of the compiler itself needs to be ported to the target machine. The remainder of the compiler can be imported as intermediate code and then further processed by

986-654: Is also possible. The GCC project includes an implementation of the C++ Standard Library called libstdc++, licensed under the GPLv3 License with an exception to link non-GPL applications when sources are built with GCC. Some features of GCC include: The primary supported (and best tested) processor families are 64- and 32-bit ARM, 64- and 32-bit x86_64 and x86 and 64-bit PowerPC and SPARC . GCC target processor families as of version 11.1 include: Lesser-known target processors supported in

1044-403: Is less complex and therefore easier to port than a code generator, because it is not able to do code optimizations due to its limited view of the program code (it only sees one instruction at a time, and users need a sequence to do optimization). Some interpreters are extremely easy to port, because they only make minimal assumptions about the instruction set of the underlying hardware. As a result,

1102-442: Is the common language for a large number of powerful language- and architecture-independent global (function scope) optimizations. GENERIC is an intermediate representation language used as a "middle end" while compiling source code into executable binaries . A subset, called GIMPLE , is targeted by all the front ends of GCC. The middle stage of GCC does all of the code analysis and optimization , working independently of both

1160-604: Is widely deployed as a tool in the development of both free and proprietary software . GCC is also available for many embedded systems , including ARM -based and Power ISA -based chips. As well as being the official compiler of the GNU operating system , GCC has been adopted as the standard compiler by many other modern Unix-like computer operating systems , including most Linux distributions. Most BSD family operating systems also switched to GCC shortly after its release, although since then, FreeBSD and Apple macOS have moved to

1218-513: The ARM being a widely used alternative. International standards, such as those promulgated by the ISO , greatly facilitate porting by specifying details of the computing environment in a way that helps reduce differences between different standards-conforming platforms . Writing software that stays within the bounds specified by these standards represents a practical although nontrivial effort. Porting such

SECTION 20

#1732771869548

1276-521: The Atari VCS became the console's killer app despite its differences, while the later Pac-Man port was notorious for its deviations from the arcade version. Arcade-accurate games became more prevalent starting in the 1990s as home consoles caught up to the power of arcade systems. Notably, the Neo Geo system from SNK , which was introduced as a multi-game arcade system, would also be offered as

1334-469: The C programming language . It was extended to compile C++ in December of that year. Front ends were later developed for Objective-C , Objective-C++ , Fortran , Ada , D , Go and Rust , among others. The OpenMP and OpenACC specifications are also supported in the C and C++ compilers. GCC has been ported to more platforms and instruction set architectures than any other compiler, and

1392-657: The Clang compiler, largely due to licensing reasons. GCC can also compile code for Windows , Android , iOS , Solaris , HP-UX , AIX and DOS . In late 1983, in an effort to bootstrap the GNU operating system, Richard Stallman asked Andrew S. Tanenbaum , the author of the Amsterdam Compiler Kit (also known as the Free University Compiler Kit ) for permission to use that software for GNU. When Tanenbaum advised him that

1450-755: The GNU Compiler Collection , which provides consistent programming languages on different platforms, and Autotools , which automates the detection of minor variations in the environment and adapts the software accordingly before compilation. The compilers for some high-level programming languages (e.g. Eiffel , Esterel ) gain portability by outputting source code in another high level intermediate language (such as C ) for which compilers for many platforms are generally available. Two activities related to (but distinct from) porting are emulating and cross-compiling . Instead of translating directly into machine code , modern compilers translate to

1508-463: The GNU toolchain which is used for most projects related to GNU and the Linux kernel . With roughly 15 million lines of code in 2019, GCC is one of the largest free programs in existence. It has played an important role in the growth of free software , as both a tool and an example. When it was first released in 1987 by Richard Stallman , GCC 1.0 was named the GNU C Compiler since it only handled

1566-592: The 13.1 release, GCC includes front ends for C ( gcc ), C++ ( g++ ), Objective-C and Objective-C++ , Fortran ( gfortran ), Ada ( GNAT ), Go ( gccgo ), D ( gdc , since 9.1), and Modula-2 ( gm2 , since 13.1) programming languages, with the OpenMP and OpenACC parallel language extensions being supported since GCC 5.1. Versions prior to GCC 7 also supported Java ( gcj ), allowing compilation of Java to native machine code. Regarding language version support for C++ and C, since GCC 11.1

1624-510: The Apple rewrites?" the audience shouted "No!" Garriott responded, "[otherwise] the Apple version will never get done. From a publisher's point of view that's not money wise". Others worked differently. Ozark Softscape , for example, wrote M.U.L.E. for the Atari first because it preferred to develop for the most advanced computers, removing or altering features as necessary during porting. Such

1682-620: The FSF officially halted development on their GCC 2.x compiler, blessed EGCS as the official version of GCC, and appointed the EGCS project as the GCC maintainers in April 1999. With the release of GCC 2.95 in July 1999 the two projects were once again united. GCC has since been maintained by a varied group of programmers from around the world under the direction of a steering committee. GCC 3 (2002) removed

1740-443: The GCC steering committee decided to allow use of a C++ compiler to compile GCC. The compiler was intended to be written mostly in C plus a subset of features from C++. In particular, this was decided so that GCC's developers could use the destructors and generics features of C++. In August 2012, the GCC steering committee announced that GCC now uses C++ as its implementation language. This means that to build GCC from sources,

1798-540: The Internet before execution can start on the target's Java virtual machine (JVM). Porting is also the term used when a video game designed to run on one platform, be it an arcade , video game console , or personal computer , is converted to run on a different platform, perhaps with some minor differences. From the beginning of video games through to the 1990s, "ports", at the time often known as "conversions", were often not true ports, but rather reworked versions of

GnuWin32 - Misplaced Pages Continue

1856-503: The Vax machine description", Jack Davidson and Christopher W. Fraser for the idea of using RTL as an intermediate language, and Paul Rubin for writing most of the preprocessor. Described as the "first free software hit" by Peter H. Salus , the GNU compiler arrived just at the time when Sun Microsystems was unbundling its development tools from its operating system , selling them separately at

1914-461: The code. These work on multiple representations, mostly the architecture-independent GIMPLE representation and the architecture-dependent RTL representation. Finally, machine code is produced using architecture-specific pattern matching originally based on an algorithm of Jack Davidson and Chris Fraser. GCC was written primarily in C except for parts of the Ada front end. The distribution includes

1972-482: The compiled language and the target architecture, starting from the GENERIC representation and expanding it to register transfer language (RTL). The GENERIC representation contains only the subset of the imperative programming constructs optimized by the middle end. In transforming the source code to GIMPLE, complex expressions are split into a three-address code using temporary variables . This representation

2030-423: The compiler is the "middle end." The exact set of GCC optimizations varies from release to release as it develops, but includes the standard algorithms, such as loop optimization , jump threading , common subexpression elimination , instruction scheduling , and so forth. The RTL optimizations are of less importance with the addition of global SSA-based optimizations on GIMPLE trees, as RTL optimizations have

2088-479: The compiler was not free, and that only the university was free, Stallman decided to work on a different compiler. His initial plan was to rewrite an existing compiler from Lawrence Livermore National Laboratory from Pastel to C with some help from Len Tower and others. Stallman wrote a new C front end for the Livermore compiler, but then realized that it required megabytes of stack space, an impossibility on

2146-438: The compiler, provided they meet the GPL's terms, including its requirements to distribute source code . Multiple forks proved inefficient and unwieldy, however, and the difficulty in getting work accepted by the official GCC project was greatly frustrating for many, as the project favored stability over new features. The FSF kept such close control on what was added to the official version of GCC 2.x (developed since 1992) that GCC

2204-460: The cost of porting it to a new platform is significantly less than the cost of writing it from scratch. The lower the cost of porting software relative to its implementation cost, the more portable it is said to be. The term "port" is derived from the Latin portāre , meaning "to carry". When code is not compatible with a particular operating system or architecture , the code must be "carried" to

2262-578: The default target is gnu++17 , a superset of C++17 , and gnu11 , a superset of C11 , with strict standard support also available. GCC also provides experimental support for C++20 and C++23 . Third-party front ends exist for many languages, such as Pascal ( gpc ), Modula-3 , and VHDL ( GHDL ). A few experimental branches exist to support additional languages, such as the GCC UPC compiler for Unified Parallel C or Rust . GCC's external interface follows Unix conventions. Users invoke

2320-402: The desktop today is much smaller than in the past. The dominance of the x86 architecture means that most desktop software is never ported to a different CPU. In that same market, the choice of operating systems has effectively been reduced to three: Microsoft Windows , macOS , and Linux . However, in the embedded systems and mobile markets, portability remains a significant issue, with

2378-410: The different supported languages can be processed by the same back end . GCC started out using LALR parsers generated with Bison , but gradually switched to hand-written recursive-descent parsers for C++ in 2004, and for C and Objective-C in 2006. As of 2021 all front ends use hand-written recursive-descent parsers. Until GCC 4.0 the tree representation of the program was not fully independent of

GnuWin32 - Misplaced Pages Continue

2436-455: The games due to the limitations of different systems. For example, the 1982 game The Hobbit , a text adventure augmented with graphic images, has significantly different graphic styles across the range of personal computers that its ports were developed for. However, many 21st century video games are developed using software (often in C++ ) that can output code for one or more consoles as well as for

2494-406: The higher levels of performance that computers generally have being underutilized, partially due to console hardware being fixed throughout their run (with games being developed for console specs), while PCs become more powerful as hardware evolves, but also due to ported games sometimes being poorly optimized for PCs, or lazily ported. While broadly similar, architectural differences may exist such as

2552-408: The latter machines' sprites and other sophisticated features made porting from them to Apple "far more difficult, perhaps even impossible". Reviews complained of ports that suffered from "Apple conversionitis", retaining the Apple's "lousy sound and black-white-green-purple graphics"; after Garriott's statement, when Dan Bunten asked "Atari and Commodore people in the audience, are you happy with

2610-425: The new environment (the target platform ), the experience of the original authors in knowing which programming language constructs and third party library calls are unlikely to be portable, and the amount of effort invested by the original authors in only using portable constructs (platform specific constructs often provide a cheaper solution). The number of significantly different CPUs and operating systems used on

2668-457: The new system. The term is not generally applied to the process of adapting software to run with less memory on the same CPU and operating system. Software developers often claim that the software they write is portable , meaning that little effort is needed to adapt it to a new environment. The amount of effort actually needed depends on several factors, including the extent to which the original environment (the source platform ) differs from

2726-404: The ported code generator or interpreter, thus producing the compiler software or directly executing the intermediate code on the interpreter. The machine independent part can be developed and tested on another machine (the host machine ). This greatly reduces design efforts, because the machine independent part needs to be developed only once to create portable intermediate code. An interpreter

2784-417: The processor being targeted. The meaning of a tree was somewhat different for different language front ends, and front ends could provide their own tree codes. This was simplified with the introduction of GENERIC and GIMPLE, two new forms of language-independent trees that were introduced with the advent of GCC 4.0. GENERIC is more complex, based on the GCC 3.x Java front end's intermediate representation. GIMPLE

2842-573: The screen creating a flickering effect. The poor performance of the Atari 2600 Pac-Man is cited by some scholars as a cause of the video game crash of 1983 . Many early ports suffered significant gameplay quality issues because computers greatly differed. Richard Garriott stated in 1984 at Origins Game Fair that Origin Systems developed video games for the Apple II first then ported them to Commodore 64 and Atari 8-bit computers , because

2900-446: The source code in that language and produces an abstract syntax tree ("tree" for short). These are, if necessary, converted to the middle end's input representation, called GENERIC form; the middle end then gradually transforms the program towards its final form. Compiler optimizations and static code analysis techniques (such as FORTIFY_SOURCE, a compiler directive that attempts to discover some buffer overflows ) are applied to

2958-756: The standard libraries for Ada and C++ whose code is mostly written in those languages. On some platforms, the distribution also includes a low-level runtime library, libgcc , written in a combination of machine-independent C and processor-specific machine code , designed primarily to handle arithmetic operations that the target processor cannot perform directly. GCC uses many additional tools in its build, many of which are installed by default by many Unix and Linux distributions (but which, normally, aren't present in Windows installations), including Perl , Flex , Bison , and other common tools. In addition, it currently requires three additional libraries to be present in order to build: GMP , MPC , and MPFR . In May 2010,

SECTION 50

#1732771869548

3016-464: The standard release have included: Additional processors have been supported by GCC versions maintained separately from the FSF version: The GCJ Java compiler can target either a native machine language architecture or the Java virtual machine 's Java bytecode . When retargeting GCC to a new platform, bootstrapping is often used. Motorola 68000, Zilog Z80, and other processors are also targeted in

3074-535: The target. According to the designers of the BCPL language, interpreted code (in the BCPL case) is more compact than machine code, typically by a factor of two to one. Interpreted code however runs about ten times slower than compiled code on the same machine. The designers of the Java programming language try to take advantage of the compactness of interpreted code, because a Java program may need to be transmitted over

3132-405: The terms "arcade perfect" or "arcade accurate" were often used to describe how closely the gameplay, graphics, and other assets on the ported version matched the arcade version. Many arcade ports in the early 1980s were far from arcade perfect as home consoles and computers lacked the sophisticated hardware in arcade games, but games could still approximate the gameplay. Notably, Space Invaders on

3190-553: The use of unified memory on a console. GNU Compiler Collection The GNU Compiler Collection ( GCC ) is a collection of compilers from the GNU Project that support various programming languages , hardware architectures and operating systems . The Free Software Foundation (FSF) distributes GCC as free software under the GNU General Public License (GNU GPL). GCC is a key component of

3248-402: The virtual machine is even simpler than the target CPU. Writing the compiler sources entirely in the programming language the compiler is supposed to translate, makes the following approach, better known as compiler bootstrapping , feasible on the target machine: The difficult part of coding the optimization routines is done using the high-level language instead of the assembly language of

3306-562: Was inspired by the SIMPLE representation proposed in the McCAT compiler by Laurie J. Hendren for simplifying the analysis and optimization of imperative programs . Optimization can occur during any phase of compilation; however, the bulk of optimizations are performed after the syntax and semantic analysis of the front end and before the code generation of the back end; thus a common, though somewhat self-contradictory, name for this part of

3364-887: Was used as one example of the "cathedral" development model in Eric S. Raymond 's essay The Cathedral and the Bazaar . In 1997, a group of developers formed the Experimental/Enhanced GNU Compiler System (EGCS) to merge several experimental forks into a single project. The basis of the merger was a development snapshot of GCC (taken around the 2.7.2 and later followed up to 2.8.1 release). Mergers included g77 (Fortran), PGCC ( P5 Pentium -optimized GCC), many C++ improvements, and many new architectures and operating system variants. While both projects followed each other's changes closely, EGCS development proved considerably more vigorous, so much so that

#547452