Changes between Version 4 and Version 5 of Building/Preparation/FreeBSD

Apr 14, 2013 7:51:05 PM (4 years ago)

Add further notes


  • Building/Preparation/FreeBSD

    v4 v5  
    7979Here is a random list of thoughts about things that are good to know when working on FreeBSD.
    81  - binutils / gcc
    82  - ncurses
    83  - gmp
    84  - tmpfs
     81 - The FreeBSD base system contains GCC and the GNU toolchain (at least for the time being) but they are not or only slowly updated.  GCC is technically stuck at version 4.2.1 which may not be optimal for building GHC these days.  Hence it is highly recommended to use the toolchain (`devel/binutils`) and GCC (`lang/gcc`) from the Ports Collectiom instead.
     83 - The FreeBSD base system is shipped with a version of `ncurses` but this may not be the latest.  Unfortunately, when `devel/ncurses` is installed one should add some extra lines to `mk/` to tell GNU make we want to use `ncurses` from `$LOCALBASE` (see above) instead, otherwise `terminfo` (which uses `ncurses`) becomes linked to `ncurses` in the base:
     85 {{{
     86SRC_HC_OPTS += -I$LOCALBASE/include -L$LOCALBASE/lib
     87libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes=$LOCALBASE/include --configure-option=--with-curses-libraries=$LOCALBASE/lib
     90 See #7472 for possible symptoms.
     92 - The GHC source code have an in-tree version of `libffi` and `gmp` which may work by accident -- especially if the version of `` and `` matches the version installed by the ports.  But using them is not recommended as they could result in various strange build and run-time errors.  See the `configure` options to work around them.
     94 - Building GHC sources and Haskell sources in general could be sped up by setting up a `tmpfs(5)` partition.  (This is not created by the default install.)  Just replace the `/tmp` parition with a tmpfs-backed entry in `/etc/fstab`:
     96 {{{
     97tmpfs /tmp tmpfs rw,mode=777 0 0
     100 and use your original `/tmp` partition as a swap device (substitute `ada0s1` with your device):
     102 {{{
     103/dev/ada0s1d none swap sw 0 0