Thanks to Hal Finkel for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191216
91177308-0d34-0410-b5e6-
96231b3b80d8
ready to switch to using gold, backup your existing ``/usr/bin/ld``
then replace it with ``ld-new``.
ready to switch to using gold, backup your existing ``/usr/bin/ld``
then replace it with ``ld-new``.
-You can produce bitcode files from ``clang`` using ``-emit-llvm`` or
-``-flto``, or the ``-O4`` flag which is synonymous with ``-O3 -flto``.
-
-Any of these flags will also cause ``clang`` to look for the gold plugin in
+You should produce bitcode files from ``clang`` with the option
+ ``-flto``. This flag will also cause ``clang`` to look for the gold plugin in
the ``lib`` directory under its prefix and pass the ``-plugin`` option to
``ld``. It will not look for an alternate linker, which is why you need
gold to be the installed system linker in your path.
the ``lib`` directory under its prefix and pass the ``-plugin`` option to
``ld``. It will not look for an alternate linker, which is why you need
gold to be the installed system linker in your path.
export AR="$PREFIX/bin/ar"
export NM="$PREFIX/bin/nm"
export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a
export AR="$PREFIX/bin/ar"
export NM="$PREFIX/bin/nm"
export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a
* Or you can just set your path:
* Or you can just set your path:
export CC="clang -flto"
export CXX="clang++ -flto"
export RANLIB=/bin/true
export CC="clang -flto"
export CXX="clang++ -flto"
export RANLIB=/bin/true
* Configure and build the project as usual:
.. code-block:: bash
* Configure and build the project as usual:
.. code-block:: bash