]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/install/host-target-specific-installation-notes-for-gcc.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / install / host-target-specific-installation-notes-for-gcc.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: Specific, Specific installation notes, Target specific installation, Host specific installation, Target specific installation notes
7
8.. _specific:
9
10Host/target specific installation notes for GCC
11-----------------------------------------------
12
13Please read this document carefully *before* installing the
14GNU Compiler Collection on your machine.
15
16Note that this list of install notes is *not* a list of supported
17hosts or targets. Not all supported hosts and targets are listed
18here, only the ones that require host-specific or target-specific
19information have to.
20
21aarch64\*-\*-\*
22===============
23
24Binutils pre 2.24 does not have support for selecting :option:`-mabi` and
25does not support ILP32. If it is used to build GCC 4.9 or later, GCC will
26not support option :option:`-mabi=ilp32`.
27
28To enable a workaround for the Cortex-A53 erratum number 835769 by default
29(for all CPUs regardless of -mcpu option given) at configure time use the
30:option:`--enable-fix-cortex-a53-835769` option. This will enable the fix by
31default and can be explicitly disabled during compilation by passing the
32:option:`-mno-fix-cortex-a53-835769` option. Conversely,
33:option:`--disable-fix-cortex-a53-835769` will disable the workaround by
34default. The workaround is disabled by default if neither of
35:option:`--enable-fix-cortex-a53-835769` or
36:option:`--disable-fix-cortex-a53-835769` is given at configure time.
37
38To enable a workaround for the Cortex-A53 erratum number 843419 by default
39(for all CPUs regardless of -mcpu option given) at configure time use the
40:option:`--enable-fix-cortex-a53-843419` option. This workaround is applied at
41link time. Enabling the workaround will cause GCC to pass the relevant option
42to the linker. It can be explicitly disabled during compilation by passing the
43:option:`-mno-fix-cortex-a53-843419` option. Conversely,
44:option:`--disable-fix-cortex-a53-843419` will disable the workaround by default.
45The workaround is disabled by default if neither of
46:option:`--enable-fix-cortex-a53-843419` or
47:option:`--disable-fix-cortex-a53-843419` is given at configure time.
48
49To enable Branch Target Identification Mechanism and Return Address Signing by
50default at configure time use the :option:`--enable-standard-branch-protection`
51option. This is equivalent to having :option:`-mbranch-protection=standard`
52during compilation. This can be explicitly disabled during compilation by
53passing the :option:`-mbranch-protection=none` option which turns off all
54types of branch protections. Conversely,
55:option:`--disable-standard-branch-protection` will disable both the
56protections by default. This mechanism is turned off by default if neither
57of the options are given at configure time.
58
59alpha\*-\*-\*
60=============
61
62This section contains general configuration information for all
63Alpha-based platforms using ELF. In addition to reading this
64section, please read all other sections that match your target.
65
66amd64-\*-solaris2\*
67===================
68
69This is a synonym for :samp:`x86_64-*-solaris2*`.
70
71amdgcn-\*-amdhsa
72================
73
74AMD GCN GPU target.
75
76Instead of GNU Binutils, you will need to install LLVM 13.0.1, or later, and copy
77:samp:`bin/llvm-mc` to :samp:`amdgcn-amdhsa/bin/as`,
78:samp:`bin/lld` to :samp:`amdgcn-amdhsa/bin/ld`,
79:samp:`bin/llvm-nm` to :samp:`amdgcn-amdhsa/bin/nm`, and
80:samp:`bin/llvm-ar` to both :samp:`bin/amdgcn-amdhsa-ar` and
81:samp:`bin/amdgcn-amdhsa-ranlib`.
82
83Use Newlib (3.2.0, or newer).
84
85To run the binaries, install the HSA Runtime from the
86`ROCm Platform <https://rocm.github.io>`_, and use
87:samp:`libexec/gcc/amdhsa-amdhsa/{version}/gcn-run` to launch them
88on the GPU.
89
90arc-\*-elf32
91============
92
93Use :samp:`configure --target=arc-elf32 --with-cpu={cpu} --enable-languages="c,c++"`
94to configure GCC, with :samp:`{cpu}` being one of :samp:`arc600`, :samp:`arc601`,
95or :samp:`arc700`.
96
97arc-linux-uclibc
98================
99
100Use :samp:`configure --target=arc-linux-uclibc --with-cpu=arc700 --enable-languages="c,c++"` to configure GCC.
101
102arm-\*-eabi
103===========
104
105ARM-family processors.
106
107Building the Ada frontend commonly fails (an infinite loop executing
108``xsinfo``) if the host compiler is GNAT 4.8. Host compilers built from the
109GNAT 4.6, 4.9 or 5 release branches are known to succeed.
110
111avr
112===
113
114ATMEL AVR-family micro controllers. These are used in embedded
115applications. There are no standard Unix configurations.
116See :ref:`gcc:avr-options`,
117for the list of supported MCU types.
118
119Use :samp:`configure --target=avr --enable-languages="c"` to configure GCC.
120
121Further installation notes and other useful information about AVR tools
122can also be obtained from:
123
124* `http://www.nongnu.org/avr/ <http://www.nongnu.org/avr/>`_
125
126* `http://www.amelek.gda.pl/avr/ <http://www.amelek.gda.pl/avr/>`_
127
128The following error:
129
130.. code-block:: bash
131
132 Error: register required
133
134indicates that you should upgrade to a newer version of the binutils.
135
136Blackfin
137========
138
139The Blackfin processor, an Analog Devices DSP.
140See :ref:`gcc:blackfin-options`,
141
142More information, and a version of binutils with support for this processor,
143are available at https://sourceforge.net/projects/adi-toolchain/.
144
145CRIS
146====
147
148CRIS is a CPU architecture in Axis Communications systems-on-a-chip, for
149example the ETRAX series. These are used in embedded applications.
150
151See :ref:`gcc:cris-options`,
152for a list of CRIS-specific options.
153
154Use :samp:`configure --target=cris-elf` to configure GCCfor building
155a cross-compiler for CRIS.
156
157DOS
158===
159
160Please have a look at the `binaries page <https://gcc.gnu.org/install/binaries.html>`_.
161
162You cannot install GCC by itself on MSDOS; it will not compile under
163any MSDOS compiler except itself. You need to get the complete
164compilation package DJGPP, which includes binaries as well as sources,
165and includes all the necessary compilation tools and libraries.
166
167epiphany-\*-elf
168===============
169
170Adapteva Epiphany.
171This configuration is intended for embedded systems.
172
173\*-\*-freebsd\*
174===============
175
176In order to better utilize FreeBSD base system functionality and match
177the configuration of the system compiler, GCC 4.5 and above as well as
178GCC 4.4 past 2010-06-20 leverage SSP support in libc (which is present
179on FreeBSD 7 or later) and the use of ``__cxa_atexit`` by default
180(on FreeBSD 6 or later). The use of ``dl_iterate_phdr`` inside
181:samp:`libgcc_s.so.1` and boehm-gc (on FreeBSD 7 or later) is enabled
182by GCC 4.5 and above.
183
184We support FreeBSD using the ELF file format with DWARF 2 debugging
185for all CPU architectures. There are
186no known issues with mixing object files and libraries with different
187debugging formats. Otherwise, this release of GCC should now match
188more of the configuration used in the stock FreeBSD configuration of
189GCC. In particular, :option:`--enable-threads` is now configured by
190default. However, as a general user, do not attempt to replace the
191system compiler with this release. Known to bootstrap and check with
192good results on FreeBSD 7.2-STABLE. In the past, known to bootstrap
193and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4,
1944.5, 4.8, 4.9 and 5-CURRENT.
195
196The version of binutils installed in :samp:`/usr/bin` probably works
197with this release of GCC. Bootstrapping against the latest GNU
198binutils and/or the version found in :samp:`/usr/ports/devel/binutils` has
199been known to enable additional features and improve overall testsuite
200results. However, it is currently known that boehm-gc may not configure
201properly on FreeBSD prior to the FreeBSD 7.0 release with GNU binutils
202after 2.16.1.
203
204ft32-\*-elf
205===========
206
207The FT32 processor.
208This configuration is intended for embedded systems.
209
210h8300-hms
211=========
212
213Renesas H8/300 series of processors.
214
215Please have a look at the `binaries page <https://gcc.gnu.org/install/binaries.html>`_.
216
217The calling convention and structure layout has changed in release 2.6.
218All code must be recompiled. The calling convention now passes the
219first three arguments in function calls in registers. Structures are no
220longer a multiple of 2 bytes.
221
222hppa\*-hp-hpux\*
223================
224
225Support for HP-UX version 9 and older was discontinued in GCC 3.4.
226
227We require using gas/binutils on all hppa platforms. Version 2.19 or
228later is recommended.
229
230It may be helpful to configure GCC with the :option:`--with-gnu-as` and
231:option:`--with-as=...` options to ensure that GCC can find GAS.
232
233The HP assembler should not be used with GCC. It is rarely tested and may
234not work. It shouldn't be used with any languages other than C due to its
235many limitations.
236
237Specifically, :option:`-g` does not work (HP-UX uses a peculiar debugging
238format which GCC does not know about). It also inserts timestamps
239into each object file it creates, causing the 3-stage comparison test to
240fail during a bootstrap. You should be able to continue by saying
241:samp:`make all-host all-target` after getting the failure from :samp:`make`.
242
243Various GCC features are not supported. For example, it does not support weak
244symbols or alias definitions. As a result, explicit template instantiations
245are required when using C++. This makes it difficult if not impossible to
246build many C++ applications.
247
248There are two default scheduling models for instructions. These are
249PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc
250architecture specified for the target machine when configuring.
251PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when
252the target is a :samp:`hppa1*` machine.
253
254The PROCESSOR_8000 model is not well suited to older processors. Thus,
255it is important to completely specify the machine architecture when
256configuring if you want a model other than PROCESSOR_8000. The macro
257TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
258default scheduling model is desired.
259
260As of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10
261through 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later.
262This namespace change might cause problems when bootstrapping with
263an earlier version of GCC or the HP compiler as essentially the same
264namespace is required for an entire build. This problem can be avoided
265in a number of ways. With HP cc, :envvar:`UNIX_STD` can be set to :samp:`95`
266or :samp:`98`. Another way is to add an appropriate set of predefines
267to :envvar:`CC`. The description for the munix= option contains
268a list of the predefines used with each standard.
269
270More specific information to :samp:`hppa*-hp-hpux*` targets follows.
271
272hppa\*-hp-hpux10
273================
274
275For hpux10.20, we *highly* recommend you pick up the latest sed patch
276``PHCO_19798`` from HP.
277
278The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are
279used for one-only code and data. This resolves many of the previous
280problems in using C++ on this target. However, the ABI is not compatible
281with the one implemented under HP-UX 11 using secondary definitions.
282
283hppa\*-hp-hpux11
284================
285
286GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot
287be used to compile GCC 3.0 and up.
288
289The libffi library haven't been ported to 64-bit HP-UXand doesn't build.
290
291Refer to `binaries page <https://gcc.gnu.org/install/binaries.html>`_ for information about obtaining
292precompiled GCC binaries for HP-UX. Precompiled binaries must be obtained
293to build the Ada language as it cannot be bootstrapped using C. Ada is
294only available for the 32-bit PA-RISC runtime.
295
296Starting with GCC 3.4 an ISO C compiler is required to bootstrap. The
297bundled compiler supports only traditional C; you will need either HP's
298unbundled compiler, or a binary distribution of GCC.
299
300It is possible to build GCC 3.3 starting with the bundled HP compiler,
301but the process requires several steps. GCC 3.3 can then be used to
302build later versions.
303
304There are several possible approaches to building the distribution.
305Binutils can be built first using the HP tools. Then, the GCC
306distribution can be built. The second approach is to build GCC
307first using the HP tools, then build binutils, then rebuild GCC.
308There have been problems with various binary distributions, so it
309is best not to start from a binary distribution.
310
311On 64-bit capable systems, there are two distinct targets. Different
312installation prefixes must be used if both are to be installed on
313the same system. The :samp:`hppa[1-2]*-hp-hpux11*` target generates code
314for the 32-bit PA-RISC runtime architecture and uses the HP linker.
315The :samp:`hppa64-hp-hpux11*` target generates 64-bit code for the
316PA-RISC 2.0 architecture.
317
318The script config.guess now selects the target type based on the compiler
319detected during configuration. You must define :envvar:`PATH` or :envvar:`CC` so
320that configure finds an appropriate compiler for the initial bootstrap.
321When :envvar:`CC` is used, the definition should contain the options that are
322needed whenever :envvar:`CC` is used.
323
324Specifically, options that determine the runtime architecture must be
325in :envvar:`CC` to correctly select the target for the build. It is also
326convenient to place many other compiler options in :envvar:`CC`. For example,
327:envvar:`CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"`
328can be used to bootstrap the GCC 3.3 branch with the HP compiler in
32964-bit K&R/bundled mode. The +DA2.0W option will result in
330the automatic selection of the :samp:`hppa64-hp-hpux11*` target. The
331macro definition table of cpp needs to be increased for a successful
332build with the HP compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to
333be defined when building with the bundled compiler, or when using the
334:option:`-Ac` option. These defines aren't necessary with :option:`-Ae`.
335
336It is best to explicitly configure the :samp:`hppa64-hp-hpux11*` target
337with the :option:`--with-ld=...` option. This overrides the standard
338search for ld. The two linkers supported on this target require different
339commands. The default linker is determined during configuration. As a
340result, it's not possible to switch linkers in the middle of a GCC build.
341This has been reported to sometimes occur in unified builds of binutils
342and GCC.
343
344A recent linker patch must be installed for the correct operation of
345GCC 3.3 and later. ``PHSS_26559`` and ``PHSS_24304`` are the
346oldest linker patches that are known to work. They are for HP-UX
34711.00 and 11.11, respectively. ``PHSS_24303``, the companion to
348``PHSS_24304``, might be usable but it hasn't been tested. These
349patches have been superseded. Consult the HP patch database to obtain
350the currently recommended linker patch for your system.
351
352The patches are necessary for the support of weak symbols on the
35332-bit port, and for the running of initializers and finalizers. Weak
354symbols are implemented using SOM secondary definition symbols. Prior
355to HP-UX 11, there are bugs in the linker support for secondary symbols.
356The patches correct a problem of linker core dumps creating shared
357libraries containing secondary symbols, as well as various other
358linking issues involving secondary symbols.
359
360GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
361run initializers and finalizers on the 64-bit port. The 32-bit port
362uses the linker +init and +fini options for the same
363purpose. The patches correct various problems with the +init/+fini
364options, including program core dumps. Binutils 2.14 corrects a
365problem on the 64-bit port resulting from HP's non-standard use of
366the .init and .fini sections for array initializers and finalizers.
367
368Although the HP and GNU linkers are both supported for the
369:samp:`hppa64-hp-hpux11*` target, it is strongly recommended that the
370HP linker be used for link editing on this target.
371
372At this time, the GNU linker does not support the creation of long
373branch stubs. As a result, it cannot successfully link binaries
374containing branch offsets larger than 8 megabytes. In addition,
375there are problems linking shared libraries, linking executables
376with :option:`-static`, and with dwarf2 unwind and exception support.
377It also doesn't provide stubs for internal calls to global functions
378in shared libraries, so these calls cannot be overloaded.
379
380The HP dynamic loader does not support GNU symbol versioning, so symbol
381versioning is not supported. It may be necessary to disable symbol
382versioning with :option:`--disable-symvers` when using GNU ld.
383
384POSIX threads are the default. The optional DCE thread library is not
385supported, so :option:`--enable-threads=dce` does not work.
386
387\*-\*-linux-gnu
388===============
389
390The ``.init_array`` and ``.fini_array`` sections are enabled
391unconditionally which requires at least glibc 2.1 and binutils 2.12.
392
393Versions of libstdc++-v3 starting with 3.2.1 require bug fixes present
394in glibc 2.2.5 and later. More information is available in the
395libstdc++-v3 documentation.
396
397i?86-\*-linux\*
398===============
399
400As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
401See :pr:`10877` for more information.
402
403If you receive Signal 11 errors when building on GNU/Linux, then it is
404possible you have a hardware problem. Further information on this can be
405found on `www.bitwizard.nl <https://www.bitwizard.nl/sig11/>`_.
406
407i?86-\*-solaris2\*
408==================
409
410Use this for Solaris 11.3 or later on x86 and x86-64 systems. Starting
411with GCC 4.7, there is also a 64-bit :samp:`amd64-*-solaris2*` or
412:samp:`x86_64-*-solaris2*` configuration that corresponds to
413:samp:`sparcv9-sun-solaris2*`.
414
415It is recommended that you configure GCC to use the GNU assembler. The
416versions included in Solaris 11.3, from GNU binutils 2.23.1 or
417newer (available as :samp:`/usr/bin/gas` and
418:samp:`/usr/gnu/bin/as`), work fine. The current version, from GNU
419binutils 2.34, is known to work. Recent versions of the Solaris assembler in
420:samp:`/usr/bin/as` work almost as well, though.
421
422For linking, the Solaris linker is preferred. If you want to use the GNU
423linker instead, the version in Solaris 11.3, from GNU binutils 2.23.1 or
424newer (in :samp:`/usr/gnu/bin/ld` and :samp:`/usr/bin/gld`), works,
425as does the latest version, from GNU binutils 2.34.
426
427To use GNU :command:`as`, configure with the options
428:option:`--with-gnu-as --with-as=/usr/gnu/bin/as`. It may be necessary
429to configure with :option:`--without-gnu-ld --with-ld=/usr/ccs/bin/ld` to
430guarantee use of Solaris :command:`ld`.
431
432.. todo:: why -without-gnu-ld -with-ld?
433
434ia64-\*-linux
435=============
436
437IA-64 processor (also known as IPF, or Itanium Processor Family)
438running GNU/Linux.
439
440If you are using the installed system libunwind library with
441:option:`--with-system-libunwind`, then you must use libunwind 0.98 or
442later.
443
444ia64-\*-hpux\*
445==============
446
447Building GCC on this target requires the GNU Assembler. The bundled HP
448assembler will not work. To prevent GCC from using the wrong assembler,
449the option :option:`--with-gnu-as` may be necessary.
450
451The GCC libunwind library has not been ported to HPUX. This means that for
452GCC versions 3.2.3 and earlier, :option:`--enable-libunwind-exceptions`
453is required to build GCC. For GCC 3.3 and later, this is the default.
454For gcc 3.4.3 and later, :option:`--enable-libunwind-exceptions` is
455removed and the system libunwind library will always be used.
456
457\*-ibm-aix\*
458============
459
460Support for AIX version 3 and older was discontinued in GCC 3.4.
461Support for AIX version 4.2 and older was discontinued in GCC 4.5.
462
463'out of memory' bootstrap failures may indicate a problem with
464process resource limits (ulimit). Hard limits are configured in the
465:samp:`/etc/security/limits` system configuration file.
466
467GCC 4.9 and above require a C++ compiler for bootstrap. IBM VAC++ / xlC
468cannot bootstrap GCC. xlc can bootstrap an older version of GCC and
469G++ can bootstrap recent releases of GCC.
470
471GCC can bootstrap with recent versions of IBM XLC, but bootstrapping
472with an earlier release of GCC is recommended. Bootstrapping with XLC
473requires a larger data segment, which can be enabled through the
474:samp:`{LDR_CNTRL}` environment variable, e.g.,
475
476.. code-block:: bash
477
478 % LDR_CNTRL=MAXDATA=0x50000000
479 % export LDR_CNTRL
480
481One can start with a pre-compiled version of GCC to build from
482sources. One may delete GCC's 'fixed' header files when starting
483with a version of GCC built for an earlier release of AIX.
484
485To speed up the configuration phases of bootstrapping and installing GCC,
486one may use GNU Bash instead of AIX :command:`/bin/sh`, e.g.,
487
488.. code-block:: bash
489
490 % CONFIG_SHELL=/opt/freeware/bin/bash
491 % export CONFIG_SHELL
492
493and then proceed as described in :ref:`building`,
494where we strongly recommend specifying an absolute path
495to invoke :samp:`{srcdir}` /configure.
496
497Because GCC on AIX is built as a 32-bit executable by default,
498(although it can generate 64-bit programs) the GMP and MPFR libraries
499required by gfortran must be 32-bit libraries. Building GMP and MPFR
500as static archive libraries works better than shared libraries.
501
502Errors involving ``alloca`` when building GCC generally are due
503to an incorrect definition of ``CC`` in the Makefile or mixing files
504compiled with the native C compiler and GCC. During the stage1 phase of
505the build, the native AIX compiler **must** be invoked as :command:`cc`
506(not :command:`xlc`). Once :command:`configure` has been informed of
507:command:`xlc`, one needs to use :samp:`make distclean` to remove the
508configure cache files and ensure that :envvar:`CC` environment variable
509does not provide a definition that will confuse :command:`configure`.
510If this error occurs during stage2 or later, then the problem most likely
511is the version of Make (see above).
512
513The native :command:`as` and :command:`ld` are recommended for
514bootstrapping on AIX. The GNU Assembler, GNU Linker, and GNU
515Binutils version 2.20 is the minimum level that supports bootstrap on
516AIX 5. The GNU Assembler has not been updated to support AIX 6or
517AIX 7. The native AIX tools do interoperate with GCC.
518
519AIX 7.1 added partial support for DWARF debugging, but full support
520requires AIX 7.1 TL03 SP7 that supports additional DWARF sections and
521fixes a bug in the assembler. AIX 7.1 TL03 SP5 distributed a version
522of libm.a missing important symbols; a fix for IV77796 will be
523included in SP6.
524
525AIX 5.3 TL10, AIX 6.1 TL05 and AIX 7.1 TL00 introduced an AIX
526assembler change that sometimes produces corrupt assembly files
527causing AIX linker errors. The bug breaks GCC bootstrap on AIX and
528can cause compilation failures with existing GCC installations. An
529AIX iFix for AIX 5.3 is available (APAR IZ98385 for AIX 5.3 TL10, APAR
530IZ98477 for AIX 5.3 TL11 and IZ98134 for AIX 5.3 TL12). AIX 5.3 TL11 SP8,
531AIX 5.3 TL12 SP5, AIX 6.1 TL04 SP11, AIX 6.1 TL05 SP7, AIX 6.1 TL06 SP6,
532AIX 6.1 TL07 and AIX 7.1 TL01 should include the fix.
533
534Building :samp:`libstdc++.a` requires a fix for an AIX Assembler bug
535APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a
536fix for another AIX Assembler bug and a co-dependent AIX Archiver fix
537referenced as APAR IY53606 (AIX 5.2) or as APAR IY54774 (AIX 5.1)
538
539.. _transferaixshobj:
540
541:samp:`libstdc++` in GCC 3.4 increments the major version number of the
542shared object and GCC installation places the :samp:`libstdc++.a`
543shared library in a common location which will overwrite the and GCC
5443.3 version of the shared library. Applications either need to be
545re-linked against the new shared library or the GCC 3.1 and GCC 3.3
546versions of the :samp:`libstdc++` shared object needs to be available
547to the AIX runtime loader. The GCC 3.1 :samp:`libstdc++.so.4`, if
548present, and GCC 3.3 :samp:`libstdc++.so.5` shared objects can be
549installed for runtime dynamic loading using the following steps to set
550the :samp:`F_LOADONLY` flag in the shared object for *each*
551multilib :samp:`libstdc++.a` installed:
552
553Extract the shared objects from the currently installed
554:samp:`libstdc++.a` archive:
555
556.. code-block:: bash
557
558 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
559
560Enable the :samp:`F_LOADONLY` flag so that the shared object will be
561available for runtime dynamic loading, but not linking:
562
563.. code-block:: bash
564
565 % strip -e libstdc++.so.4 libstdc++.so.5
566
567Archive the runtime-only shared object in the GCC 3.4
568:samp:`libstdc++.a` archive:
569
570.. code-block:: bash
571
572 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
573
574Eventually, the :option:`--with-aix-soname=svr4`
575configure option may drop the need for this procedure for libraries that
576support it.
577
578Linking executables and shared libraries may produce warnings of
579duplicate symbols. The assembly files generated by GCC for AIX always
580have included multiple symbol definitions for certain global variable
581and function declarations in the original program. The warnings should
582not prevent the linker from producing a correct library or runnable
583executable.
584
585AIX 4.3 utilizes a 'large format' archive to support both 32-bit and
58664-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
587to parse archive libraries did not handle the new format correctly.
588These routines are used by GCC and result in error messages during
589linking such as 'not a COFF file'. The version of the routines shipped
590with AIX 4.3.1 should work for a 32-bit environment. The :option:`-g`
591option of the archive command may be used to create archives of 32-bit
592objects using the original 'small format'. A correct version of the
593routines is shipped with AIX 4.3.2 and above.
594
595Some versions of the AIX binder (linker) can fail with a relocation
596overflow severe error when the :option:`-bbigtoc` option is used to link
597GCC-produced object files into an executable that overflows the TOC. A fix
598for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
599available from IBM Customer Support and from its
600`techsupport.services.ibm.com <https://techsupport.services.ibm.com/>`_
601website as PTF U455193.
602
603The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
604with a segmentation fault when invoked by any version of GCC. A fix for
605APAR IX87327 is available from IBM Customer Support and from its
606`techsupport.services.ibm.com <https://techsupport.services.ibm.com/>`_
607website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
608
609The initial assembler shipped with AIX 4.3.0 generates incorrect object
610files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
611TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
612`techsupport.services.ibm.com <https://techsupport.services.ibm.com/>`_
613website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
614
615AIX provides National Language Support (NLS). Compilers and assemblers
616use NLS to support locale-specific representations of various data
617formats including floating-point numbers (e.g., :samp:`.` vs :samp:`,` for
618separating decimal fractions). There have been problems reported where
619GCC does not produce the same floating-point formats that the assembler
620expects. If one encounters this problem, set the :envvar:`LANG`
621environment variable to :samp:`C` or :samp:`En_US`.
622
623A default can be specified with the :option:`-mcpu=cpu_type`
624switch and using the configure option :option:`--with-cpu-cpu_type`.
625
626iq2000-\*-elf
627=============
628
629Vitesse IQ2000 processors. These are used in embedded
630applications. There are no standard Unix configurations.
631
632lm32-\*-elf
633===========
634
635Lattice Mico32 processor.
636This configuration is intended for embedded systems.
637
638lm32-\*-uclinux
639===============
640
641Lattice Mico32 processor.
642This configuration is intended for embedded systems running uClinux.
643
644LoongArch
645=========
646
647LoongArch processor.
648The following LoongArch targets are available:
649
650``loongarch64-linux-gnu*``
651 LoongArch processor running GNU/Linux. This target triplet may be coupled
652 with a small set of possible suffixes to identify their default ABI type:
653
654 ``f64``
655 Uses ``lp64d/base`` ABI by default.
656
657 ``f32``
658 Uses ``lp64f/base`` ABI by default.
659
660 ``sf``
661 Uses ``lp64s/base`` ABI by default.
662
663``loongarch64-linux-gnu``
664 Same as ``loongarch64-linux-gnuf64``, but may be used with
665 :option:`--with-abi=*` to configure the default ABI type.
666
667 More information about LoongArch can be found at
668 https://github.com/loongson/LoongArch-Documentation.
669
670m32c-\*-elf
671===========
672
673Renesas M32C processor.
674This configuration is intended for embedded systems.
675
676m32r-\*-elf
677===========
678
679Renesas M32R processor.
680This configuration is intended for embedded systems.
681
682m68k-\*-\*
683==========
684
685By default,
686:samp:`m68k-*-elf*`, :samp:`m68k-*-rtems`, :samp:`m68k-*-uclinux` and
687:samp:`m68k-*-linux`
688build libraries for both M680x0 and ColdFire processors. If you only
689need the M680x0 libraries, you can omit the ColdFire ones by passing
690:option:`--with-arch=m68k` to :command:`configure`. Alternatively, you
691can omit the M680x0 libraries by passing :option:`--with-arch=cf` to
692:command:`configure`. These targets default to 5206 or 5475 code as
693appropriate for the target system when
694configured with :option:`--with-arch=cf` and 68020 code otherwise.
695
696The :samp:`m68k-*-netbsd` and
697:samp:`m68k-*-openbsd` targets also support the :option:`--with-arch`
698option. They will generate ColdFire CFV4e code when configured with
699:option:`--with-arch=cf` and 68020 code otherwise.
700
701You can override the default processors listed above by configuring
702with :option:`--with-cpu=target`. This :samp:`{target}` can either
703be a :option:`-mcpu` argument or one of the following values:
704:samp:`m68000`, :samp:`m68010`, :samp:`m68020`, :samp:`m68030`,
705:samp:`m68040`, :samp:`m68060`, :samp:`m68020-40` and :samp:`m68020-60`.
706
707GCC requires at least binutils version 2.17 on these targets.
708
709m68k-\*-uclinux
710===============
711
712GCC 4.3 changed the uClinux configuration so that it uses the
713:samp:`m68k-linux-gnu` ABI rather than the :samp:`m68k-elf` ABI.
714It also added improved support for C++ and flat shared libraries,
715both of which were ABI changes.
716
717microblaze-\*-elf
718=================
719
720Xilinx MicroBlaze processor.
721This configuration is intended for embedded systems.
722
723mips-\*-\*
724==========
725
726If on a MIPS system you get an error message saying 'does not have gp
727sections for all it's [sic] sectons [sic]', don't worry about it. This
728happens whenever you use GAS with the MIPS linker, but there is not
729really anything wrong, and it is okay to use the output file. You can
730stop such warnings by installing the GNU linker.
731
732It would be nice to extend GAS to produce the gp tables, but they are
733optional, and there should not be a warning about their absence.
734
735The libstdc++ atomic locking routines for MIPS targets requires MIPS II
736and later. A patch went in just after the GCC 3.3 release to
737make :samp:`mips*-*-*` use the generic implementation instead. You can also
738configure for :samp:`mipsel-elf` as a workaround. The
739:samp:`mips*-*-linux*` target continues to use the MIPS II routines. More
740work on this is expected in future releases.
741
742.. If you make -with-llsc the default for another target, please also
743 update the description of the -with-llsc option.
744
745The built-in ``__sync_*`` functions are available on MIPS II and
746later systems and others that support the :samp:`ll`, :samp:`sc` and
747:samp:`sync` instructions. This can be overridden by passing
748:option:`--with-llsc` or :option:`--without-llsc` when configuring GCC.
749Since the Linux kernel emulates these instructions if they are
750missing, the default for :samp:`mips*-*-linux*` targets is
751:option:`--with-llsc`. The :option:`--with-llsc` and
752:option:`--without-llsc` configure options may be overridden at compile
753time by passing the :option:`-mllsc` or :option:`-mno-llsc` options to
754the compiler.
755
756MIPS systems check for division by zero (unless
757:option:`-mno-check-zero-division` is passed to the compiler) by
758generating either a conditional trap or a break instruction. Using
759trap results in smaller code, but is only supported on MIPS II and
760later. Also, some versions of the Linux kernel have a bug that
761prevents trap from generating the proper signal (``SIGFPE``). To enable
762the use of break, use the :option:`--with-divide=breaks`
763:command:`configure` option when configuring GCC. The default is to
764use traps on systems that support them.
765
766moxie-\*-elf
767============
768
769The moxie processor.
770
771msp430-\*-elf\*
772===============
773
774TI MSP430 processor.
775This configuration is intended for embedded systems.
776
777:samp:`msp430-*-elf` is the standard configuration with most GCC
778features enabled by default.
779
780:samp:`msp430-*-elfbare` is tuned for a bare-metal environment, and disables
781features related to shared libraries and other functionality not used for
782this device. This reduces code and data usage of the GCC libraries, resulting
783in a minimal run-time environment by default.
784
785Features disabled by default include:
786
787* transactional memory
788
789* __cxa_atexit
790
791nds32le-\*-elf
792==============
793
794Andes NDS32 target in little endian mode.
795
796nds32be-\*-elf
797==============
798
799Andes NDS32 target in big endian mode.
800
801nvptx-\*-none
802=============
803
804Nvidia PTX target.
805
806Instead of GNU binutils, you will need to install
807`nvptx-tools <https://github.com/MentorEmbedded/nvptx-tools/>`_.
808Tell GCC where to find it:
809:option:`--with-build-time-tools=[install-nvptx-tools]/nvptx-none/bin`.
810
811You will need newlib 3.1.0 or later. It can be
812automatically built together with GCC. For this, add a symbolic link
813to nvptx-newlib's :samp:`newlib` directory to the directory containing
814the GCC sources.
815
816Use the :option:`--disable-sjlj-exceptions` and
817:option:`--enable-newlib-io-long-long` options when configuring.
818
819The :option:`--with-arch` option may be specified to override the
820default value for the :option:`-march` option, and to also build
821corresponding target libraries.
822The default is :option:`--with-arch=sm_30`.
823
824For example, if :option:`--with-arch=sm_70` is specified,
825:option:`-march=sm_30` and :option:`-march=sm_70` target libraries are
826built, and code generation defaults to :option:`-march=sm_70`.
827
828or1k-\*-elf
829===========
830
831The OpenRISC 1000 32-bit processor with delay slots.
832This configuration is intended for embedded systems.
833
834or1k-\*-linux
835=============
836
837The OpenRISC 1000 32-bit processor with delay slots.
838
839powerpc-\*-\*
840=============
841
842You can specify a default version for the :option:`-mcpu=cpu_type`
843switch by using the configure option :option:`--with-cpu-cpu_type`.
844
845You will need GNU binutils 2.20 or newer.
846
847powerpc-\*-darwin\*
848===================
849
850PowerPC running Darwin (Mac OS X kernel).
851
852Pre-installed versions of Mac OS X may not include any developer tools,
853meaning that you will not be able to build GCC from source. Tool
854binaries are available at
855https://opensource.apple.com.
856
857This version of GCC requires at least cctools-590.36. The
858cctools-590.36 package referenced from
859https://gcc.gnu.org/ml/gcc/2006-03/msg00507.html will not work
860on systems older than 10.3.9 (aka darwin7.9.0).
861
862powerpc-\*-elf
863==============
864
865PowerPC system in big endian mode, running System V.4.
866
867powerpc\*-\*-linux-gnu\*
868========================
869
870PowerPC system in big endian mode running Linux.
871
872powerpc-\*-netbsd\*
873===================
874
875PowerPC system in big endian mode running NetBSD.
876
877powerpc-\*-eabisim
878==================
879
880Embedded PowerPC system in big endian mode for use in running under the
881PSIM simulator.
882
883powerpc-\*-eabi
884===============
885
886Embedded PowerPC system in big endian mode.
887
888powerpcle-\*-elf
889================
890
891PowerPC system in little endian mode, running System V.4.
892
893powerpcle-\*-eabisim
894====================
895
896Embedded PowerPC system in little endian mode for use in running under
897the PSIM simulator.
898
899powerpcle-\*-eabi
900=================
901
902Embedded PowerPC system in little endian mode.
903
904rl78-\*-elf
905===========
906
907The Renesas RL78 processor.
908This configuration is intended for embedded systems.
909
910riscv32-\*-elf
911==============
912
913The RISC-V RV32 instruction set.
914This configuration is intended for embedded systems.
915This (and all other RISC-V) targets require the binutils 2.30 release.
916
917riscv32-\*-linux
918================
919
920The RISC-V RV32 instruction set running GNU/Linux.
921This (and all other RISC-V) targets require the binutils 2.30 release.
922
923riscv64-\*-elf
924==============
925
926The RISC-V RV64 instruction set.
927This configuration is intended for embedded systems.
928This (and all other RISC-V) targets require the binutils 2.30 release.
929
930riscv64-\*-linux
931================
932
933The RISC-V RV64 instruction set running GNU/Linux.
934This (and all other RISC-V) targets require the binutils 2.30 release.
935
936rx-\*-elf
937=========
938
939The Renesas RX processor.
940
941s390-\*-linux\*
942===============
943
944S/390 system running GNU/Linux for S/390.
945
946s390x-\*-linux\*
947================
948
949zSeries system (64-bit) running GNU/Linux for zSeries.
950
951s390x-ibm-tpf\*
952===============
953
954zSeries system (64-bit) running TPF. This platform is
955supported as cross-compilation target only.
956
957.. Please use Solaris 2 to refer to all release of Solaris, starting
958 with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for
959 SunOS 4 releases which we don't use to avoid confusion. Solaris
960 alone is too unspecific and must be avoided.
961
962\*-\*-solaris2\*
963================
964
965Support for Solaris 10 has been removed in GCC 10. Support for Solaris
9669 has been removed in GCC 5. Support for Solaris 8 has been removed in
967GCC 4.8. Support for Solaris 7 has been removed in GCC 4.6.
968
969Solaris 11.3 provides GCC 4.5.2, 4.7.3, and 4.8.2 as
970:command:`/usr/gcc/4.5/bin/gcc` or similar. Newer Solaris versions
971provide one or more of GCC 5, 7, and 9. Alternatively,
972you can install a pre-built GCC to bootstrap and install GCC. See the
973:ref:`binaries` for details.
974
975The Solaris 2 :command:`/bin/sh` will often fail to configure
976:samp:`libstdc++-v3`. We therefore recommend using the
977following initial sequence of commands
978
979.. code-block:: bash
980
981 % CONFIG_SHELL=/bin/ksh
982 % export CONFIG_SHELL
983
984and proceed as described in :ref:`configuration` the configure instructions.
985In addition we strongly recommend specifying an absolute path to invoke
986:samp:`{srcdir}/configure`.
987
988In Solaris 11, you need to check for ``system/header``,
989``system/linker``, and ``developer/assembler`` packages.
990
991Trying to use the linker and other tools in
992:samp:`/usr/ucb` to install GCC has been observed to cause trouble.
993For example, the linker may hang indefinitely. The fix is to remove
994:samp:`/usr/ucb` from your :envvar:`PATH`.
995
996The build process works more smoothly with the legacy Solaris tools so, if you
997have :samp:`/usr/xpg4/bin` in your :envvar:`PATH`, we recommend that you place
998:samp:`/usr/bin` before :samp:`/usr/xpg4/bin` for the duration of the build.
999
1000We recommend the use of the Solaris assembler or the GNU assembler, in
1001conjunction with the Solaris linker. The GNU :command:`as`
1002versions included in Solaris 11.3,
1003from GNU binutils 2.23.1 or newer (in :samp:`/usr/bin/gas` and
1004:samp:`/usr/gnu/bin/as`), are known to work.
1005The current version, from GNU binutils 2.34,
1006is known to work as well. Note that your mileage may vary
1007if you use a combination of the GNU tools and the Solaris tools: while the
1008combination GNU :command:`as` + Solaris :command:`ld` should reasonably work,
1009the reverse combination Solaris :command:`as` + GNU :command:`ld` may fail to
1010build or cause memory corruption at runtime in some cases for C++ programs.
1011
1012.. todo:: still?
1013
1014GNU :command:`ld` usually works as well. Again, the current
1015version (2.34) is known to work, but generally lacks platform specific
1016features, so better stay with Solaris :command:`ld`. To use the LTO linker
1017plugin (:option:`-fuse-linker-plugin`) with GNU :command:`ld`, GNU
1018binutils *must* be configured with :option:`--enable-largefile`.
1019
1020To enable symbol versioning in :samp:`libstdc++` with the Solaris linker,
1021you need to have any version of GNU :command:`c++filt`, which is part of
1022GNU binutils. :samp:`libstdc++` symbol versioning will be disabled if no
1023appropriate version is found. Solaris :command:`c++filt` from the Solaris
1024Studio compilers does *not* work.
1025
1026In order to build the GNU D compiler, GDC, a working :samp:`libphobos` is
1027needed. That library wasn't built by default in GCC 9--11 on SPARC, or
1028on x86 when the Solaris assembler is used, but can be enabled by
1029configuring with :option:`--enable-libphobos`. Also, GDC 9.4.0 is
1030required on x86, while GDC 9.3.0 is known to work on SPARC.
1031
1032The versions of the GNU Multiple Precision Library (GMP), the MPFR
1033library and the MPC library bundled with Solaris 11.3 and later are
1034usually recent enough to match GCC's requirements. There are two
1035caveats:
1036
1037* While the version of the GMP library in Solaris 11.3 works with GCC, you
1038 need to configure with :option:`--with-gmp-include=/usr/include/gmp`.
1039
1040* The version of the MPFR libary included in Solaris 11.3 is too old; you
1041 need to provide a more recent one.
1042
1043sparc\*-\*-\*
1044=============
1045
1046This section contains general configuration information for all
1047SPARC-based platforms. In addition to reading this section, please
1048read all other sections that match your target.
1049
1050Newer versions of the GNU Multiple Precision Library (GMP), the MPFR
1051library and the MPC library are known to be miscompiled by earlier
1052versions of GCC on these platforms. We therefore recommend the use
1053of the exact versions of these libraries listed as minimal versions
1054in :ref:`prerequisites` the prerequisites.
1055
1056sparc-sun-solaris2\*
1057====================
1058
1059When GCC is configured to use GNU binutils 2.14 or later, the binaries
1060produced are smaller than the ones produced using Solaris native tools;
1061this difference is quite significant for binaries containing debugging
1062information.
1063
1064Starting with Solaris 7, the operating system is capable of executing
106564-bit SPARC V9 binaries. GCC 3.1 and later properly supports
1066this; the :option:`-m64` option enables 64-bit code generation.
1067However, if all you want is code tuned for the UltraSPARC CPU, you
1068should try the :option:`-mtune=ultrasparc` option instead, which produces
1069code that, unlike full 64-bit code, can still run on non-UltraSPARC
1070machines.
1071
1072When configuring the GNU Multiple Precision Library (GMP), the MPFR
1073library or the MPC library on a Solaris 7 or later system, the canonical
1074target triplet must be specified as the :command:`build` parameter on the
1075configure line. This target triplet can be obtained by invoking :command:`./config.guess` in the toplevel source directory of GCC (and
1076not that of GMP or MPFR or MPC). For example on a Solaris 11 system:
1077
1078.. code-block:: bash
1079
1080 % ./configure --build=sparc-sun-solaris2.11 --prefix=xxx
1081
1082sparc-\*-linux\*
1083================
1084
1085sparc64-\*-solaris2\*
1086=====================
1087
1088When configuring a 64-bit-default GCC on Solaris/SPARC, you must use a
1089build compiler that generates 64-bit code, either by default or by
1090specifying :samp:`CC='gcc -m64' CXX='gcc-m64'` to :command:`configure`.
1091Additionally, you *must* pass :option:`--build=sparc64-sun-solaris2.11`
1092or :option:`--build=sparcv9-sun-solaris2.11` because :samp:`config.guess`
1093misdetects this situation, which can cause build failures.
1094
1095When configuring the GNU Multiple Precision Library (GMP), the MPFR
1096library or the MPC library, the canonical target triplet must be specified
1097as the :command:`build` parameter on the configure line. For example
1098on a Solaris 11 system:
1099
1100.. code-block:: bash
1101
1102 % ./configure --build=sparc64-sun-solaris2.11 --prefix=xxx
1103
1104sparcv9-\*-solaris2\*
1105=====================
1106
1107This is a synonym for :samp:`sparc64-*-solaris2*`.
1108
1109c6x-\*-\*
1110=========
1111
1112The C6X family of processors. This port requires binutils-2.22 or newer.
1113
1114visium-\*-elf
1115=============
1116
1117CDS VISIUMcore processor.
1118This configuration is intended for embedded systems.
1119
1120\*-\*-vxworks\*
1121===============
1122
1123Support for VxWorks is in flux. At present GCC supports *only* the
1124very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC.
1125We welcome patches for other architectures supported by VxWorks 5.5.
1126Support for VxWorks AE would also be welcome; we believe this is merely
1127a matter of writing an appropriate 'configlette' (see below). We are
1128not interested in supporting older, a.out or COFF-based, versions of
1129VxWorks in GCC 3.
1130
1131VxWorks comes with an older version of GCC installed in
1132:samp:`{$WIND_BASE}/host`; we recommend you do not overwrite it.
1133Choose an installation :samp:`{prefix}` entirely outside :samp:`{$WIND_BASE}`.
1134Before running :command:`configure`, create the directories :samp:`{prefix}`
1135and :samp:`{prefix}/bin`. Link or copy the appropriate assembler,
1136linker, etc. into :samp:`{prefix}/bin`, and set your :samp:`{PATH}` to
1137include that directory while running both :command:`configure` and
1138:command:`make`.
1139
1140You must give :command:`configure` the
1141:option:`--with-headers=$WIND_BASE/target/h` switch so that it can
1142find the VxWorks system headers. Since VxWorks is a cross compilation
1143target only, you must also specify :option:`--target=target`.
1144:command:`configure` will attempt to create the directory
1145:samp:`{prefix}/{target}/sys-include` and copy files into it;
1146make sure the user running :command:`configure` has sufficient privilege
1147to do so.
1148
1149GCC's exception handling runtime requires a special 'configlette'
1150module, :samp:`contrib/gthr_supp_vxw_5x.c`. Follow the instructions in
1151that file to add the module to your kernel build. (Future versions of
1152VxWorks will incorporate this module.)
1153
1154x86_64-\*-\*, amd64-\*-\*
1155=========================
1156
1157GCC supports the x86-64 architecture implemented by the AMD64 processor
1158(amd64-\*-\* is an alias for x86_64-\*-\*) on GNU/Linux, FreeBSD and NetBSD.
1159On GNU/Linux the default is a bi-arch compiler which is able to generate
1160both 64-bit x86-64 and 32-bit x86 code (via the :option:`-m32` switch).
1161
1162x86_64-\*-solaris2\*
1163====================
1164
1165GCC also supports the x86-64 architecture implemented by the AMD64
1166processor (:samp:`amd64-*-*` is an alias for :samp:`x86_64-*-*`) on
1167Solaris 10 or later. Unlike other systems, without special options a
1168bi-arch compiler is built which generates 32-bit code by default, but
1169can generate 64-bit x86-64 code with the :option:`-m64` switch. Since
1170GCC 4.7, there is also a configuration that defaults to 64-bit code, but
1171can generate 32-bit code with :option:`-m32`. To configure and build
1172this way, you have to provide all support libraries like :samp:`libgmp`
1173as 64-bit code, configure with :option:`--target=x86_64-pc-solaris2.11`
1174and :samp:`CC=gcc -m64`.
1175
1176xtensa\*-\*-elf
1177===============
1178
1179This target is intended for embedded Xtensa systems using the
1180:samp:`newlib` C library. It uses ELF but does not support shared
1181objects. Designed-defined instructions specified via the
1182Tensilica Instruction Extension (TIE) language are only supported
1183through inline assembly.
1184
1185The Xtensa configuration information must be specified prior to
1186building GCC. The :samp:`include/xtensa-config.h` header
1187file contains the configuration information. If you created your
1188own Xtensa configuration with the Xtensa Processor Generator, the
1189downloaded files include a customized copy of this header file,
1190which you can use to replace the default header file.
1191
1192xtensa\*-\*-linux\*
1193===================
1194
1195This target is for Xtensa systems running GNU/Linux. It supports ELF
1196shared objects and the GNU C library (glibc). It also generates
1197position-independent code (PIC) regardless of whether the
1198:option:`-fpic` or :option:`-fPIC` options are used. In other
1199respects, this target is the same as the
1200:samp:`xtensa*-*-elf` target.
1201
1202Microsoft Windows
1203=================
1204
1205Intel 16-bit versions
1206=====================
1207
1208The 16-bit versions of Microsoft Windows, such as Windows 3.1, are not
1209supported.
1210
1211However, the 32-bit port has limited support for Microsoft
1212Windows 3.11 in the Win32s environment, as a target only. See below.
1213
1214Intel 32-bit versions
1215=====================
1216
1217The 32-bit versions of Windows, including Windows 95, Windows NT, Windows
1218XP, and Windows Vista, are supported by several different target
1219platforms. These targets differ in which Windows subsystem they target
1220and which C libraries are used.
1221
1222* Cygwin \*-\*-cygwin: Cygwin provides a user-space
1223 Linux API emulation layer in the Win32 subsystem.
1224
1225* MinGW \*-\*-mingw32: MinGW is a native GCC port for
1226 the Win32 subsystem that provides a subset of POSIX.
1227
1228* MKS i386-pc-mks: NuTCracker from MKS. See
1229 https://www.mkssoftware.com for more information.
1230
1231Intel 64-bit versions
1232=====================
1233
1234GCC contains support for x86-64 using the mingw-w64
1235runtime library, available from https://www.mingw-w64.org/downloads/.
1236This library should be used with the target triple x86_64-pc-mingw32.
1237
1238Windows CE
1239==========
1240
1241Windows CE is supported as a target only on Hitachi
1242SuperH (sh-wince-pe), and MIPS (mips-wince-pe).
1243
1244Other Windows Platforms
1245=======================
1246
1247GCC no longer supports Windows NT on the Alpha or PowerPC.
1248
1249GCC no longer supports the Windows POSIX subsystem. However, it does
1250support the Interix subsystem. See above.
1251
1252Old target names including \*-\*-winnt and \*-\*-windowsnt are no longer used.
1253
1254PW32 (i386-pc-pw32) support was never completed, and the project seems to
1255be inactive. See http://pw32.sourceforge.net/ for more information.
1256
1257UWIN support has been removed due to a lack of maintenance.
1258
1259\*-\*-cygwin
1260============
1261
1262Ports of GCC are included with the
1263`Cygwin environment <http://www.cygwin.com/>`_.
1264
1265GCC will build under Cygwin without modification; it does not build
1266with Microsoft's C++ compiler and there are no plans to make it do so.
1267
1268The Cygwin native compiler can be configured to target any 32-bit x86
1269cpu architecture desired; the default is i686-pc-cygwin. It should be
1270used with as up-to-date a version of binutils as possible; use either
1271the latest official GNU binutils release in the Cygwin distribution,
1272or version 2.20 or above if building your own.
1273
1274\*-\*-mingw32
1275=============
1276
1277GCC will build with and support only MinGW runtime 3.12 and later.
1278Earlier versions of headers are incompatible with the new default semantics
1279of ``extern inline`` in ``-std=c99`` and ``-std=gnu99`` modes.
1280
1281To support emitting DWARF debugging info you need to use GNU binutils
1282version 2.16 or above containing support for the ``.secrel32``
1283assembler pseudo-op.
1284
1285Older systems
1286=============
1287
1288GCC contains support files for many older (1980s and early
12891990s) Unix variants. For the most part, support for these systems
1290has not been deliberately removed, but it has not been maintained for
1291several years and may suffer from bitrot.
1292
1293Starting with GCC 3.1, each release has a list of 'obsoleted' systems.
1294Support for these systems is still present in that release, but
1295:command:`configure` will fail unless the :option:`--enable-obsolete`
1296option is given. Unless a maintainer steps forward, support for these
1297systems will be removed from the next release of GCC.
1298
1299Support for old systems as hosts for GCC can cause problems if the
1300workarounds for compiler, library and operating system bugs affect the
1301cleanliness or maintainability of the rest of GCC. In some cases, to
1302bring GCC up on such a system, if still possible with current GCC, may
1303require first installing an old version of GCC which did work on that
1304system, and using it to compile a more recent GCC, to avoid bugs in the
1305vendor compiler. Old releases of GCC 1 and GCC 2 are available in the
1306:samp:`old-releases` directory on the
1307`GCC mirror sites <https://gcc.gnu.org/mirrors.html>`_.
1308Header bugs may generally be avoided using
1309:command:`fixincludes`, but bugs or deficiencies in libraries and the
1310operating system may still cause problems.
1311
1312Support for older systems as targets for cross-compilation is less
1313problematic than support for them as hosts for GCC; if an enthusiast
1314wishes to make such a target work again (including resurrecting any of
1315the targets that never worked with GCC 2, starting from the last
1316version before they were removed), patches
1317https://gcc.gnu.org/contribute.html following the usual requirements would be
1318likely to be accepted, since they should not affect the support for more
1319modern targets.
1320
1321For some systems, old versions of GNU binutils may also be useful,
1322and are available from :samp:`pub/binutils/old-releases` on
1323`sourceware.org mirror sites <https://sourceware.org/mirrors.html>`_.
1324
1325Some of the information on specific systems above relates to
1326such older systems, but much of the information
1327about GCC on such systems (which may no longer be applicable to
1328current GCC) is to be found in the GCC texinfo manual.
1329
1330all ELF targets (SVR4, Solaris 2, etc.)
1331=======================================
1332
1333C++ support is significantly better on ELF targets if you use the
1334GNU linker; duplicate copies of
1335inlines, vtables and template instantiations will be discarded
3ed1b4ce 1336automatically.