Apple Darwin Bedienungsanleitung Seite 31

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 68
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 30
The first part of this document describes issues you should consider when bringing code to a 64-bit architecture.
You should read through those chapters before you compile your code for the first time, to help you determine
whether the compiler warnings are useful or relevant (and possibly do an initial code scrub to look for common
errors).
After you have read those chapters, it's time to compile your code with a 64-bit target architecture. You can
either compile your code directly (using GCC) or through Xcode. This chapter takes you through the process
of setting up your build environment for 64-bit compilation.
Compiling 64-Bit Code Using GCC
For the most part, compiling 64-bit code using GCC works the same way as compiling 32-bit code; there are
a few exceptions, however:
You must use GCC 4.0 or later. To choose a GCC version to be used when typing gcc on the command
line, type gcc_select 4.0. To change the GCC version to be used in Xcode, see Compiling 64-Bit Code
Using Xcode (page 32).
You should turn on the -Wall flag (and possibly the -Wconversion flag if you are debugging conversion
problems) in order to get additional warnings about potential pointer truncation and other issues.
You must specify a 64-bit architecture with -arch x86_64. You can also compile binaries with multiple
architectures, such as -arch ppc -arch i386 -arch x86_64.
In addition to these exceptions, there are a few new flags and features added for 64-bit architectures. Also, a
few flags are not available for 64-bit architectures. The key differences are described in the next section.
New Flags and Features for 64-Bit Architectures
Several flags related to 64-bit architectures have been added or modified in GCC:
-arch x86_64
The 64-bit x86 architecture option.
2012-12-13 | Copyright © 2004, 2012 Apple Inc. All Rights Reserved.
31
Compiling 64-Bit Code
Seitenansicht 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 67 68

Kommentare zu diesen Handbüchern

Keine Kommentare