diff options
Diffstat (limited to 'doc/building/gcc/GNULinux-GNAT.rst')
-rw-r--r-- | doc/building/gcc/GNULinux-GNAT.rst | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/doc/building/gcc/GNULinux-GNAT.rst b/doc/building/gcc/GNULinux-GNAT.rst index 3733d763f..a8617449d 100644 --- a/doc/building/gcc/GNULinux-GNAT.rst +++ b/doc/building/gcc/GNULinux-GNAT.rst @@ -1,26 +1,38 @@ -.. _BUILD:mcode:GNULinux-GNAT: +.. _BUILD:gcc:GNULinux-GNAT: -GNU/Linux with GCC/GNAT -####################### +GCC Backend on GNU/Linux with GCC/GNAT +###################################### -On Linux, GHDL is configured by ``configure`` and build by ``make``. +.. HINT:: There are some dependencies for building GCC (``gmp``, ``mpfr`` and ``mpc``). If you have not them installed on your system, you can either build them manually or use the ``download_prerequisites`` script provided in the GCC source tree (recommended): ``cd /path/to/gcc/source/dir && ./contrib/download_prerequisites``. -* First, GHDL needs to be configured. It is common to specify a PREFIX - (installation directory like ``/usr/local`` or ``/opt/ghdl``). Without any - other option, ``configure`` select `mcode` as backend. +* First configure GHDL, specify GCC source directory and ``PREFIX`` (installation directory like ``/usr/local`` or ``/opt/ghdl``). +* Next, invoke ``make`` to copy GHDL sources in the source directory. +* Then, configure GCC. The list of ``--disable`` configure options can be adjusted to your needs. GHDL does not require all these optional libraries and disabling them will speed-up the build. -* Next, ``make`` starts the compilation process. +* Now, build and install GCC with ``make``. -* Finally, ``make install`` installs GHDL into the installation directory - specified by PREFIX. You may need super user privileges (``sudo ...``). +* Last, build and install GHDL libraries. .. rubric:: Example: .. code-block:: Bash - cd <ghdl> - mkdir build - cd build - ../configure --prefix=PREFIX - make - sudo make install + $ cd <ghdl> + $ mkdir build + $ cd build + $ ../configure --with-gcc=/path/to/gcc/source/dir --prefix=PREFIX + $ make copy-sources + $ mkdir gcc-objs; cd gcc-objs + $ /path/to/gcc/source/dir/configure --prefix=/usr/local --enable-languages=c,vhdl \ + --disable-bootstrap --disable-lto --disable-multilib --disable-libssp \ + --disable-libgomp --disable-libquadmath + $ make -j2 && make install + $ cd /path/to/ghdl/source/dir + $ make ghdllib + $ make install + +.. HINT:: Note that the prefix directory must be the same as the one used to configure GHDL. If you have manually built ``gmp``/``mpfr``/``mpc`` (without using the script in ``contrib``) and if you have installed them in a non-standard directory, you may need to add ``--with-gmp=GMP_INSTALL_DIR``. + +.. HINT:: If your system gcc was configured with ``--enable-default-pie`` (check if that option appears in the output of ``gcc -v``), you should also add it. + +.. HINT:: If you don't want to install ``makeinfo``, do ``make install MAKEINFO=false`` instead. |