llvm.org GIT mirror llvm / 8655b15
Rename CFEBuildInstrs.html to GCCFEBuildInstrs.html. Update all references to it and place a redirection page at the old address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47124 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 11 years ago
5 changed file(s) with 293 addition(s) and 264 deletion(s). Raw diff Collapse all Expand all
978978 DE66F38C08ABF35300323D32 /* CREDITS.TXT */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = CREDITS.TXT; path = ../CREDITS.TXT; sourceTree = SOURCE_ROOT; };
979979 DE66F38F08ABF35C00323D32 /* AliasAnalysis.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = AliasAnalysis.html; sourceTree = ""; };
980980 DE66F39008ABF35C00323D32 /* Bugpoint.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = Bugpoint.html; sourceTree = ""; };
981 DE66F39208ABF35C00323D32 /* CFEBuildInstrs.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CFEBuildInstrs.html; sourceTree = ""; };
981 DE66F39208ABF35C00323D32 /* GCCFEBuildInstrs.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = GCCFEBuildInstrs.html; sourceTree = ""; };
982982 DE66F39308ABF35C00323D32 /* CodeGenerator.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CodeGenerator.html; sourceTree = ""; };
983983 DE66F39408ABF35C00323D32 /* CodingStandards.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CodingStandards.html; sourceTree = ""; };
984984 DE66F39808ABF35C00323D32 /* bugpoint.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = bugpoint.pod; sourceTree = ""; };
25922592 children = (
25932593 DE66F38F08ABF35C00323D32 /* AliasAnalysis.html */,
25942594 DE66F39008ABF35C00323D32 /* Bugpoint.html */,
2595 DE66F39208ABF35C00323D32 /* CFEBuildInstrs.html */,
2595 DE66F39208ABF35C00323D32 /* GCCFEBuildInstrs.html */,
25962596 DE66F39308ABF35C00323D32 /* CodeGenerator.html */,
25972597 DE66F39408ABF35C00323D32 /* CodingStandards.html */,
25982598 DE66F39508ABF35C00323D32 /* CommandGuide */,
44
55
66 Building the LLVM C/C++ Front-End
7
78
89
9
1010
11 Building the LLVM GCC Front-End
12
13
14
15
  • Building llvm-gcc from Source
  • 16
  • License Information
  • 17
    18
    19
    20

    Written by the LLVM Team

    21
    22
    23
    24
    25 Building llvm-gcc from Source
    26
    27
    28
    29
    30
    31

    This section describes how to acquire and build llvm-gcc 4.0 and 4.2, which are

    32 based on the GCC 4.0.1/4.2.1 front-ends respectively. Both front-ends support C,
    33 C++, Objective-C and Objective-C++. The 4.2 front-end also supports Ada and
    34 Fortran to some extent. Note that the instructions for building these front-ends
    35 are completely different (and much easier!) than those for building llvm-gcc3 in
    36 the past.

    37
    38
    39
  • Retrieve the appropriate llvm-gcc4.x-y.z.source.tar.gz archive from the

  • 40 llvm web site.

    41
    42

    It is also possible to download the sources of the llvm-gcc front end

    43 from a read-only mirror using subversion. To check out the 4.0 code
    44 for first time use:

    45
    46
    47
    
                      
                    
    48 svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk dst-directory
    49
    50
    51
    52

    To check out the 4.2 code use:

    53
    54
    55
    
                      
                    
    56 svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk dst-directory
    57
    58
    59
    60

    After that, the code can be be updated in the destination directory

    61 using:

    62
    63
    64
    svn update
    65
    66
    67

    The mirror is brought up to date every evening.

    68
    69
  • Follow the directions in the top-level README.LLVM file for
  • 70 up-to-date instructions on how to build llvm-gcc. See below for building
    71 with support for Ada or Fortran.
    72
    73
    74
    75
    76
    77
    78 Building the Ada front-end
    79
    80
    81
    82

    Building with support for Ada amounts to following the directions in the

    83 top-level README.LLVM file, adding ",ada" to EXTRALANGS, for example:
    84 EXTRALANGS=,ada

    85
    86

    There are some complications however:

    87
    88
    89
  • The only platform for which the Ada front-end is known to build is

  • 90 32 bit intel x86 running linux. It is unlikely to build for other
    91 systems without some work.

    92
  • The build requires having a compiler that supports Ada, C and C++.

  • 93 The Ada front-end is written in Ada so an Ada compiler is needed to
    94 build it. What is more, the Ada compiler must not be more recent
    95 than what it is trying to compile, otherwise the build will fail.
    96 This rules out gcc-4.3 (but not gcc-4.2) and also the
    97 2007 GNAT GPL Edition.
    98 The LLVM parts of llvm-gcc are written in C++ so a C++
    99 compiler is needed to build them. The rest of gcc is written in C.
    100 Some linux distributions provide a version of gcc that supports all
    101 three languages (the Ada part often comes as an add-on package to
    102 the rest of gcc). Otherwise it is possible to combine two versions
    103 of gcc, one that supports Ada and C (such as the
    104 2006 GNAT GPL Edition)
    105 and another which supports C++, see below.

    106
  • Because the Ada front-end is experimental, it is wise to build the

  • 107 compiler with checking enabled. This causes it to run slower, but
    108 helps catch mistakes in the compiler (please report any problems using
    109 LLVM bugzilla).

    110
    111
    112

    Supposing appropriate compilers are available, llvm-gcc with Ada support can

    113 be built on an x86-32 linux box using the following recipe:

    114
    115
    116
  • Download the LLVM source

  • 117 and unpack it:

    118
    119
    120
    wget http://llvm.org/releases/2.2/llvm-2.2.tar.gz
    
                      
                    
    121 tar xzf llvm-2.2.tar.gz
    122 mv llvm-2.2 llvm
    123
    124
    125

    or check out the

    126 latest version from subversion:

    127
    128
    129
    svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    130
    131
    132
    133
  • Download the

  • 134 llvm-gcc-4.2 source
    135 and unpack it:

    136
    137
    138
    wget http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz
    
                      
                    
    139 tar xzf llvm-gcc4.2-2.2.source.tar.gz
    140 mv llvm-gcc4.2-2.2.source llvm-gcc-4.2
    141
    142
    143

    or check out the

    144 latest version from subversion:

    145
    146
    147
    svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk llvm-gcc-4.2
    148
    149
    150
    151
  • Make a build directory llvm-objects for llvm and make it the

  • 152 current directory:

    153
    154
    155
    mkdir llvm-objects
    
                      
                    
    156 cd llvm-objects
    157
    158
    159
    160
  • Configure LLVM (here it is configured to install into /usr/local):

  • 161
    162
    163
    ../llvm/configure --prefix=/usr/local
    164
    165
    166

    If you have a multi-compiler setup and the C++ compiler is not the

    167 default, then you can configure like this:

    168
    169
    170
    CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local
    171
    172
    173
    174
  • Build LLVM with checking enabled (use ENABLE_OPTIMIZED=1 to

  • 175 build without checking):

    176
    177
    178
    make ENABLE_OPTIMIZED=0
    179
    180
    181
    182
  • Install LLVM (optional):

  • 183
    184
    185
    make install
    186
    187
    188
    189
  • Make a build directory llvm-gcc-4.2-objects for llvm-gcc and make it the

  • 190 current directory:

    191
    192
    193
    
                      
                    
    194 cd ..
    195 mkdir llvm-gcc-4.2-objects
    196 cd llvm-gcc-4.2-objects
    197
    198
    199
    200
  • Configure llvm-gcc (here it is configured to install into /usr/local).

  • 201 The --enable-checking flag turns on sanity checks inside the compiler.
    202 If you omit it then LLVM must be built with make ENABLE_OPTIMIZED=1.
    203 Additional languages can be appended to the --enable-languages switch,
    204 for example --enable-languages=ada,c,c++.

    205
    206
    207
    ../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    208
    209
    210

    If you have a multi-compiler setup, then you can configure like this:

    211
    212
    213
    
                      
                    
    214 export CC=PATH_TO_C_AND_ADA_COMPILER
    215 export CXX=PATH_TO_C++_COMPILER
    216 ../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    217
    218
    219
    220
  • Build and install the compiler:

  • 221
    222
    223
    make
    
                      
                    
    224 make install
    225
    226
    227
    228
    229
    230
    231
    232
    233 Building the Fortran front-end
    234
    235
    236
    237

    238 To build with support for Fortran, follow the directions in the top-level
    239 README.LLVM file, adding ",fortran" to EXTRALANGS, for example:

    240
    241
    242
    
                      
                    
    243 EXTRALANGS=,fortran
    244
    245
    246
    247
    248
    249
    250
    251 License Information
    252
    253
    254
    255

    256 The LLVM GCC frontend is licensed to you under the GNU General Public License
    257 and the GNU Lesser General Public License. Please see the files COPYING and
    258 COPYING.LIB for more details.
    259

    260
    261

    262 More information is available in the FAQ.
    263

    11 This page has moved here.
    26412
    26513
    26614
    27321 src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
    27422
    27523 LLVM Compiler Infrastructure
    276 Last modified: $Date$
    24 Last modified: $Date: 2008-02-13 17:46:10 +0100 (Wed, 13 Feb 2008) $
    27725
    27826
    27927
    0
    1 "http://www.w3.org/TR/html4/strict.dtd">
    2
    3
    4
    5
    6 Building the LLVM GCC Front-End
    7
    8
    9
    10
    11 Building the LLVM GCC Front-End
    12
    13
    14
    15
  • Building llvm-gcc from Source
  • 16
  • License Information
  • 17
    18
    19
    20

    Written by the LLVM Team

    21
    22
    23
    24
    25 Building llvm-gcc from Source
    26
    27
    28
    29
    30
    31

    This section describes how to acquire and build llvm-gcc 4.0 and 4.2, which are

    32 based on the GCC 4.0.1/4.2.1 front-ends respectively. Both front-ends support C,
    33 C++, Objective-C and Objective-C++. The 4.2 front-end also supports Ada and
    34 Fortran to some extent. Note that the instructions for building these front-ends
    35 are completely different (and much easier!) than those for building llvm-gcc3 in
    36 the past.

    37
    38
    39
  • Retrieve the appropriate llvm-gcc4.x-y.z.source.tar.gz archive from the

  • 40 llvm web site.

    41
    42

    It is also possible to download the sources of the llvm-gcc front end

    43 from a read-only mirror using subversion. To check out the 4.0 code
    44 for first time use:

    45
    46
    47
    
                      
                    
    48 svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk dst-directory
    49
    50
    51
    52

    To check out the 4.2 code use:

    53
    54
    55
    
                      
                    
    56 svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk dst-directory
    57
    58
    59
    60

    After that, the code can be be updated in the destination directory

    61 using:

    62
    63
    64
    svn update
    65
    66
    67

    The mirror is brought up to date every evening.

    68
    69
  • Follow the directions in the top-level README.LLVM file for
  • 70 up-to-date instructions on how to build llvm-gcc. See below for building
    71 with support for Ada or Fortran.
    72
    73
    74
    75
    76
    77
    78 Building the Ada front-end
    79
    80
    81
    82

    Building with support for Ada amounts to following the directions in the

    83 top-level README.LLVM file, adding ",ada" to EXTRALANGS, for example:
    84 EXTRALANGS=,ada

    85
    86

    There are some complications however:

    87
    88
    89
  • The only platform for which the Ada front-end is known to build is

  • 90 32 bit intel x86 running linux. It is unlikely to build for other
    91 systems without some work.

    92
  • The build requires having a compiler that supports Ada, C and C++.

  • 93 The Ada front-end is written in Ada so an Ada compiler is needed to
    94 build it. What is more, the Ada compiler must not be more recent
    95 than what it is trying to compile, otherwise the build will fail.
    96 This rules out gcc-4.3 (but not gcc-4.2) and also the
    97 2007 GNAT GPL Edition.
    98 The LLVM parts of llvm-gcc are written in C++ so a C++
    99 compiler is needed to build them. The rest of gcc is written in C.
    100 Some linux distributions provide a version of gcc that supports all
    101 three languages (the Ada part often comes as an add-on package to
    102 the rest of gcc). Otherwise it is possible to combine two versions
    103 of gcc, one that supports Ada and C (such as the
    104 2006 GNAT GPL Edition)
    105 and another which supports C++, see below.

    106
  • Because the Ada front-end is experimental, it is wise to build the

  • 107 compiler with checking enabled. This causes it to run slower, but
    108 helps catch mistakes in the compiler (please report any problems using
    109 LLVM bugzilla).

    110
    111
    112

    Supposing appropriate compilers are available, llvm-gcc with Ada support can

    113 be built on an x86-32 linux box using the following recipe:

    114
    115
    116
  • Download the LLVM source

  • 117 and unpack it:

    118
    119
    120
    wget http://llvm.org/releases/2.2/llvm-2.2.tar.gz
    
                      
                    
    121 tar xzf llvm-2.2.tar.gz
    122 mv llvm-2.2 llvm
    123
    124
    125

    or check out the

    126 latest version from subversion:

    127
    128
    129
    svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    130
    131
    132
    133
  • Download the

  • 134 llvm-gcc-4.2 source
    135 and unpack it:

    136
    137
    138
    wget http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz
    
                      
                    
    139 tar xzf llvm-gcc4.2-2.2.source.tar.gz
    140 mv llvm-gcc4.2-2.2.source llvm-gcc-4.2
    141
    142
    143

    or check out the

    144 latest version from subversion:

    145
    146
    147
    svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk llvm-gcc-4.2
    148
    149
    150
    151
  • Make a build directory llvm-objects for llvm and make it the

  • 152 current directory:

    153
    154
    155
    mkdir llvm-objects
    
                      
                    
    156 cd llvm-objects
    157
    158
    159
    160
  • Configure LLVM (here it is configured to install into /usr/local):

  • 161
    162
    163
    ../llvm/configure --prefix=/usr/local
    164
    165
    166

    If you have a multi-compiler setup and the C++ compiler is not the

    167 default, then you can configure like this:

    168
    169
    170
    CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local
    171
    172
    173
    174
  • Build LLVM with checking enabled (use ENABLE_OPTIMIZED=1 to

  • 175 build without checking):

    176
    177
    178
    make ENABLE_OPTIMIZED=0
    179
    180
    181
    182
  • Install LLVM (optional):

  • 183
    184
    185
    make install
    186
    187
    188
    189
  • Make a build directory llvm-gcc-4.2-objects for llvm-gcc and make it the

  • 190 current directory:

    191
    192
    193
    
                      
                    
    194 cd ..
    195 mkdir llvm-gcc-4.2-objects
    196 cd llvm-gcc-4.2-objects
    197
    198
    199
    200
  • Configure llvm-gcc (here it is configured to install into /usr/local).

  • 201 The --enable-checking flag turns on sanity checks inside the compiler.
    202 If you omit it then LLVM must be built with make ENABLE_OPTIMIZED=1.
    203 Additional languages can be appended to the --enable-languages switch,
    204 for example --enable-languages=ada,c,c++.

    205
    206
    207
    ../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    208
    209
    210

    If you have a multi-compiler setup, then you can configure like this:

    211
    212
    213
    
                      
                    
    214 export CC=PATH_TO_C_AND_ADA_COMPILER
    215 export CXX=PATH_TO_C++_COMPILER
    216 ../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    217
    218
    219
    220
  • Build and install the compiler:

  • 221
    222
    223
    make
    
                      
                    
    224 make install
    225
    226
    227
    228
    229
    230
    231
    232
    233 Building the Fortran front-end
    234
    235
    236
    237

    238 To build with support for Fortran, follow the directions in the top-level
    239 README.LLVM file, adding ",fortran" to EXTRALANGS, for example:

    240
    241
    242
    
                      
                    
    243 EXTRALANGS=,fortran
    244
    245
    246
    247
    248
    249
    250
    251 License Information
    252
    253
    254
    255

    256 The LLVM GCC frontend is licensed to you under the GNU General Public License
    257 and the GNU Lesser General Public License. Please see the files COPYING and
    258 COPYING.LIB for more details.
    259

    260
    261

    262 More information is available in the FAQ.
    263

    264
    265
    266
    267
    268
    269
    270
    271 src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">
    272
    273 src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
    274
    275 LLVM Compiler Infrastructure
    276 Last modified: $Date$
    277
    278
    279
    280
    337337
    338338

    The GCC front end is not very portable at the moment. If you want to get it

    339339 to work on another platform, you can download a copy of the source and
    340 href="CFEBuildInstrs.html">try to compile it on your platform.

    340 href="GCCFEBuildInstrs.html">try to compile it on your platform.

    341341
    342342
    343343
    517517 the "convert_from_eh_region_ranges_1" GCC function.

    518518
    519519

    Cygwin GCC 3.3.3: The version of GCC 3.3.3 commonly shipped with

    520 Cygwin does not work. Please upgrade
    520 Cygwin does not work. Please upgrade
    521521 to a newer version if possible.

    522522

    SuSE GCC 3.3.3: The version of GCC 3.3.3 shipped with SuSE 9.1 (and

    523523 possibly others) does not compile LLVM correctly (it appears that exception
    740740 you run svn update.

    741741
    742742

    If you would like to get the GCC front end source code, you can also get it

    743 and build it yourself. Please follow these
    743 and build it yourself. Please follow these
    744744 instructions to successfully get and build the LLVM GCC front-end.

    745745
    746746
    755755

    Before configuring and compiling the LLVM suite, you can optionally extract the

    756756 LLVM GCC front end from the binary distribution. It is used for running the
    757757 llvm-test testsuite and for compiling C/C++ programs. Note that you can optionally
    758 build llvm-gcc yourself after building the
    758 build llvm-gcc yourself after building the
    759759 main LLVM repository.

    760760
    761761

    To install the GCC front end, do the following:

    780780 linked with libraries not available on your system.

    781781
    782782

    In cases like these, you may want to try

    783 href="CFEBuildInstrs.html">building the GCC front end from source. This is
    783 href="GCCFEBuildInstrs.html">building the GCC front end from source. This is
    784784 much easier now than it was in the past.

    785785
    786786
    835835 will fail as these libraries require llvm-gcc and llvm-g++. See
    836836 Install the GCC Front End for details on installing
    837837 the C/C++ Front End. See
    838 Bootstrapping the LLVM C/C++ Front-End
    838 Bootstrapping the LLVM C/C++ Front-End
    839839 for details on building the C/C++ Front End.
    840840
    --with-tclinclude
    841841
    Path to the tcl include directory under which tclsh can be
    104104
  • LLVM Test Suite Guide - A reference
  • 105105 manual for using the LLVM test suite.
    106106
    107
  • How to build the C/C++ front-end -
  • 107
  • How to build the C/C++ front-end -
  • 108108 Instructions for building the front-end from source.
    109109
    110110
  • The LLVM Lexicon - Definition of acronyms, terms