# Raspberry Pi 3 and poudriere



## MrLudo (Nov 29, 2017)

Hello.

I have an existing poudriere environment which I successfully use to build a set of ports for my RPi2s.

I am trying my first pass at building the same set of ports for an RPi3.

I have created my RPi3 jail with the following command:

`poudriere jail -c -x -j rpi3v12 -m svn -a arm64.aarch64 -v head@319962`

The version of head was specified to match the O/S on the poudriere server to avoid any jail newer than host errors.

I then commenced my build with the following command:

`poudriere bulk -T -j rpi3v12 -p head -z default -f /usr/local/etc/poudriere-list-rpi`

The build I am running has failed to build www/w3m because of an assertion failure and skipped 4 other ports as a result.

The same ports tree builds correctly on my RPi2 jail in poudriere.

I have reported the fault on bugzilla. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223956 .

I recall when I first used poudriere and QEMU to build for RPI2s I had to add a signature for QEMU to recognize armv6hf like so to make it work:
`/usr/sbin/binmiscctl add armv6hf --interpreter "/usr/local/bin/qemu-arm-static" \
--magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" \
--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
--size 20 --set-enabled`

I did not do this for the RPi3 as the was already a signature for aarch64 shown by:

`binmiscctl lookup  aarch64`
This showed:
`name: aarch64
interpreter: /usr/local/bin/qemu-aarch64-static
flags: ENABLED USE_MASK
magic size: 20
magic offset: 0
magic: 0x7f 0x45 0x4c 0x46  0x02 0x01 0x01 0x00  0x00 0x00 0x00 0x00
       0x00 0x00 0x00 0x00  0x02 0x00 0xb7 0x00
mask:  0xff 0xff 0xff 0xff  0xff 0xff 0xff 0x00  0xff 0xff 0xff 0xff
       0xff 0xff 0xff 0xff  0xfe 0xff 0xff 0xff`

Is there anyone else using poudriere to build their RPi3 ports who can confirm my setup is correct ?

Is there some specific RPi3 signature to use instead of the already available aarch64 one ?


----------



## acheron (Nov 29, 2017)

armv6hf is just armv6.
qemu has a lot of bugs, the failure happens on real hw too?
Your setup is correct.


----------



## MrLudo (Nov 30, 2017)

acheron said:


> qemu has a lot of bugs, the failure happens on real hw too?
> Your setup is correct.



I will get my boss who is playing with the physical RPi3 to build w3m and see if it blows up for him in the same way.

Thanks for confirming my poudriere setup is correct.


----------



## MrLudo (Dec 6, 2017)

I was just reading https://wiki.freebsd.org/arm64/rpi3 which mentions the following in the Bugs/issues section...



> (fixed in HEAD and stable/11 now) Compiling ports directly on the RPI3 is possible, but due to a bug either in jemalloc or FreeBSD's locking code, /etc/malloc.conf needs to be set:
> 
> Diane Bruce suspects potential locking issues on arm64. jemalloc had some locking issues early on in FreeBSD's arm support.
> This bug can be worked around by disabling tcache: ln -s 'tcache:false' /etc/malloc.conf



I tried disabling tcache both inside the jail and on the host but this did not change the failure.

I will report back further here when the attempt to build w3m is done on the physical hardware.


----------



## Phishfry (Dec 6, 2017)

Silly question but have you tried using pkg. There is an aarch64 repository now and many packages exist. I had xorg, scfb and twm going.
There was no xfce4 though. I did try openbox but not w3m. LXDE is available too. Did'nt try it out though.
Was just messing around to see what worked.


----------



## acheron (Dec 6, 2017)

It builds fine on the cluster: http://thunderx1.nyi.freebsd.org/data/head-arm64-default/p454157_s325785/logs/w3m-0.5.3.20170102.log


----------

