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