# Building xdev for Raspberry Pi



## Atarian (Jan 18, 2015)

Hi all,

I'm using Crochet to try and build a raspberry pi image. I've retrieved the FreeBSD source, then attempted to build xdev as per the instructions provided in the script.


```
Starting at Sun Jan 18 10:14:46 GMT 2015
Loading configuration from config.sh
Board: RaspberryPi
Option: ImageSize 3900mb
Option: AutoSize
Option: User matt
Option: SwapFile 256mb
Option: UsrPorts
  Will install up-to-date /usr/ports from portsnap
Source version is: r277307
Building FreeBSD version: 11.0
Image name is:
  /usr/home/matt/tmp/crochet-freebsd/work/FreeBSD-armv6-11.0-RPI-B-r277307.img
Building FreeBSD version: 11.0
Object files are at: /usr/home/matt/tmp/crochet-freebsd/work/obj/arm.armv6/usr/src
Found suitable FreeBSD source tree in:
  /usr/src
Can't find appropriate FreeBSD xdev tools.
Tested: /usr/armv6-freebsd/usr/bin/cc
If you have FreeBSD-CURRENT sources in /usr/src, you can build these with the following command:

cd /usr/src && sudo make XDEV=arm XDEV_ARCH=armv6 WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG=1 WITHOUT_CLANG_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 WITHOUT_TESTS=1 xdev

Run this script again after you have the xdev tools installed.
```

So I then do this:


```
root@Galactica:/usr/src # make XDEV=arm XDEV_ARCH=armv6 WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG=1 WITHOUT_CLANG_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 WITHOUT_TESTS=1 xdev
```

Which then begins bulding xdev, which fails compilation here:


```
/usr/src/usr.bin/addr2line/../../contrib/elftoolchain/addr2line/addr2line.c:105:39: error:
  passing 'Dwarf_Error' (aka 'struct _Dwarf_Error') to parameter of
  incompatible type 'Dwarf_Error *' (aka 'struct _Dwarf_Error *'); take the
  address with &
```

So I passed the address as the compiler suggested, but now I'm getting


```
/usr/src/usr.bin/addr2line/../../contrib/elftoolchain/addr2line/addr2line.c:119:14: error:
  use of undeclared identifier 'DW_DLV_ERROR'
  if (ret == DW_DLV_ERROR)
```

These errors look like clang compilation errors to me for a start, they're far too helpful for GCC. I can fix the odd dereferencing/pointer issue, but there's nothing I can do about undefined constants as I have no way of knowing what they should be. Does anyone have any ideas about what I've done wrong here?


----------



## tingo (Jan 27, 2015)

Someone on the freebsd-arm mailing list manged to build the xdev tools like this:


```
svn co http://svn.freebsd.org/base/release/10.1.0/ /usr/src2
make XDEV=arm XDEV_ARCH=armv6 WITH_GCC=1 xdev
```
I haven't tried this myself.
Relevant message and thread.


----------

