Clang

Posted on  by 

  1. Clang Clang Clang Went The Trolley
  2. Clangers

Nov 18, 2013 Clang is the name of the whole compiler. However, from a command-line point of view: Clang is the C compiler. Clang is the C compiler (like g is a C compiler, whereas gcc is a C compiler) The -std=c11 option enables the new C11 standard (as in g). Clang definition is - to make a loud metallic ringing sound. How to use clang in a sentence. Find 3 ways to say CLANG, along with antonyms, related words, and example sentences at Thesaurus.com, the world's most trusted free thesaurus.

Clang
Home
Wikipedia

Clang is a 'LLVM native' C/C++/Objective-C compiler using LLVM as a backend and optimizer. It aims to be GCC compatible yet stricter, offers fast compile times with low memory usage, and has useful error and warning messages for easier compile troubleshooting.

Clang

Installation

Prerequisites

One of the goals of the Clang project is to be compatible with GCC, in dialect and on the command-line (see #Differences from GCC). Occasionally some packages will fail to build correctly with it and some may build successfully but segfault when executed. Some packages also have GCC specific code and will also fail during compiling. In these events, GCC will need to be used as a fallback.

USE flags

Some packages are aware of the clang USE flag.

Emerge

root #emerge --ask --update --deep --changed-use sys-devel/clang

Configuration

GCC fallback environments

Clang Clang Clang Went The Trolley

Create a configuration file with a set of environment variables using Portage's built in /etc/portage/env directory. This will override any defaults for any packages that fail to compile with clang. The name used below is just an example, so feel free to choose whatever name is desired for the fallback environment. Be sure to substitute chosen name with the examples used in this article.

Clangers

FILE/etc/portage/env/compiler-gccEnvironment named compiler-gcc
ClangClang

The above is the most basic environmental variable needed. You can change it to suit your needs, such as enabling/disabling link-time optimizations, alternative AR, NM, RANLIB, and so on. Here are two examples below:

Pastry
FILE/etc/portage/env/compiler-gcc-ltoEnvironment variable named compiler-gcc-lto
FILE/etc/portage/env/compiler-gccEnvironment variable named compiler-gcc

Coments are closed