Changes between Version 6 and Version 7 of Tools/Clang


Ignore:
Timestamp:
Aug 2, 2019, 7:48:27 AM (2 years ago)
Author:
schiptsov
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tools/Clang

    v6 v7  
    11= Clang =
    22
    3 {{{clang}}} and {{{LLVM}}} are defacto standard toolchains of the whole modern world. Apple uses {{{clang}}} and developing its [wiki:/Languages/Swift Swift] with it, Google uses {{{clang}}} in NDK (and deprecated {{{gcc}}}), FreeBSD uses {{{clang}}} as a default compiler, and the standard builds of the Chrome browser are done with {{{clang}}}. LLVM's odegeration backend is used in GHC Haskell compiler, Ocaml, Julia and so on.
     3{{{clang}}} and {{{LLVM}}} are defacto standard tool-chains of the whole modern world. Apple uses {{{clang}}} and it is developing its [wiki:/Languages/Swift Swift] with it, Google uses {{{clang}}} in NDK (and deprecated {{{gcc}}}), FreeBSD uses {{{clang}}} as a default compiler, and the standard builds of the Chrome browser are done with {{{clang++}}}. LLVM's odegeration back-end is used in [wiki:/Tools/GHC GHC] [wiki:/Language/Haskell Haskell] compiler, [wiki:/Languages/Rust Rust] compiler, [wiki:/Languages/Ocaml Ocaml], Julia and so on.
    44
    5 {{{clang}}} comes with {{{libc++}}} - a clean, rewritten from scratch C++ standard library and STL implementation. It also supports native atomics, OpenMP 3.1 {{{libomp.so}}} and all the nice things, like native atomics, etc. with its {{{libcompiler_rt}}}.
     5{{{clang++}}} comes with [wiki:/Libs/Libc++ libc++] - a clean, rewritten from scratch C++11 standard library and STL implementation. It also supports native atomics, OpenMP 4.x via {{{libomp.so}}} and all the nice things, like native atomics, etc. with its {{{libcompiler_rt}}}.
    66
    7 Here is how to recompile a project with {{{clang}}} and {{{libc++}}} without using or linking with {{{libstdc++}}}. Notice the {{{-stdlib=libc++}}} flags. Usually the resulting binaries are ~20% faster (when you have re-built {{{libc++}}} itself with the same optimizations).
     7Here is how to recompile a project with {{{clang++}}} and {{{libc++}}} without using or linking with {{{libstdc++}}}. Notice the {{{-stdlib=libc++}}} flags. Usually the resulting binaries are ~20% faster (when you have re-built {{{libc++}}} itself with the same optimizations {{{-mtune=native}}}).
    88
    9 This configuration has been tested with whole LLVM toolchain itself and with NodeJS.
     9This configuration has been tested with whole LLVM toolchain itself and with shit like NodeJS.
    1010
    1111{{{#!sh
     
    1919export CFLAGS="-Wformat -Wformat-security -Werror=format-security \
    2020    -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
    21     -fstack-protector-strong -fstack-protector-all --param ssp-buffer-size=4 \
     21    -fstack-protector-strong --param ssp-buffer-size=4 \
    2222    -Wstrict-aliasing=2 -fno-strict-aliasing \
    2323    -D_FILE_OFFSET_BITS=64 -D_REENTRANT \
     
    3232    -fPIC \
    3333    -pthread \
     34    -lm \
    3435    -fopenmp=libomp \
    35     -lgcc_s \
    3636    -Wl,--gc-sections -Wl,--as-needed \
    3737    -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack"
    3838export CXXFLAGS="-Wformat -Wformat-security -Werror=format-security -Wstrict-aliasing=2 \
    3939    -fno-strict-aliasing \
    40     -fstack-protector-strong -fstack-protector-all --param ssp-buffer-size=4 \
     40    -fstack-protector-strong --param ssp-buffer-size=4 \
    4141    -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
    4242    -D_FILE_OFFSET_BITS=64 -D_REENTRANT \
     
    4545    -fPIC \
    4646    -pthread \
     47    -lm \
    4748    -fopenmp=libomp \
    4849    -std=c++1z -stdlib=libc++ \
     
    5455    -pthread \
    5556    -fopenmp=libomp \
    56     -lgcc_s \
    5757    -Wl,--gc-sections -Wl,--as-needed \
    5858    -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack"