Requirements
- GCC (Gnu Compiler Collection)
- GNAT (Ada compiler for GCC)
- GCC source files. Download and untar the sources of version 4.9.x, 5.x, 6.x, 7.x, 8.x, 9.x, 10.x or 11.x (GCC mirror sites).
- First configure GHDL, specify GCC source directory and installation prefix (like
/usr/local
or/opt/ghdl
). - Next, invoke
make copy-sources
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. - Now, build and install GCC with
make
. - Last, build and install GHDL libraries.
Example:
$ cd <ghdl>
$ mkdir build
$ cd build
$ ../configure --with-gcc=/path/to/gcc/source/dir --prefix=/usr/local
$ 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/build
$ make ghdllib
$ make install