Bootstrapping mod-plugin-builder on Raspberry Pi 4

Hey :wave:

I am trying to bootstrap the mod-plugin-builder following in the instructions in the read me.

I am using Raspberry Pi4 and I’m targeting the Dwarf

.bootstrap.sh moddwarf fails after about 90mins. Here is the end of the output. Any ideas?

[INFO ]  Installing zlib for host: done in 9.84s (at 92:37)
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[EXTRA]    Configuring GMP
[EXTRA]    Building GMP
[ERROR]    tmp-divrem_1.s:129: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:145: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:158: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:175: Error: selected processor does not support `mls r1,r4,r3,r8' in ARM mode
[ERROR]    tmp-divrem_1.s:209: Error: selected processor does not support `mls r11,r4,r12,r3' in ARM mode
[ERROR]    make[3]: *** [Makefile:768: divrem_1.lo] Error 1
[ERROR]    make[3]: *** Waiting for unfinished jobs....
[ERROR]    make[2]: *** [Makefile:956: all-recursive] Error 1
[ERROR]    make[1]: *** [Makefile:775: all] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing GMP for host'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: do_gmp_backend[scripts/build/companion_libs/100-gmp.sh@108]
[ERROR]  >>        called from: do_gmp_for_host[scripts/build/companion_libs/100-gmp.sh@58]
[ERROR]  >>        called from: do_companion_libs_for_host[scripts/build/companion_libs.sh@36]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@696]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'docs/manual/B_Known_issues.md'
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]
[ERROR]  (elapsed: 94:33.19)
[94:36] / gmake: *** [ct-ng:261: build] Error 2

I suspect we might need to pass some flags to crosstool-ng, but I’m not sure where I can.

Thanks in advance!

Edit: Here’s the output for .bootstrap.sh raspberrypi4

  Installing ncurses for build: done in 126.66s (at 109:10)
[INFO ]  =================================================================
[INFO ]  Installing zlib for host
[EXTRA]    Configuring zlib
[EXTRA]    Building zlib
[EXTRA]    Installing zlib
[INFO ]  Installing zlib for host: done in 5.78s (at 109:16)
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[EXTRA]    Configuring GMP
[EXTRA]    Building GMP
[ERROR]    tmp-divrem_1.s:129: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:145: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:158: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
[ERROR]    tmp-divrem_1.s:175: Error: selected processor does not support `mls r1,r4,r3,r8' in ARM mode
[ERROR]    tmp-divrem_1.s:209: Error: selected processor does not support `mls r11,r4,r12,r3' in ARM mode
[ERROR]    make[3]: *** [Makefile:768: divrem_1.lo] Error 1
[ERROR]    make[3]: *** Waiting for unfinished jobs....
[ERROR]    make[2]: *** [Makefile:956: all-recursive] Error 1
[ERROR]    make[1]: *** [Makefile:775: all] Error 2
[ERROR]  /
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing GMP for host'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: do_gmp_backend[scripts/build/companion_libs/100-gmp.sh@108]
[ERROR]  >>        called from: do_gmp_for_host[scripts/build/companion_libs/100-gmp.sh@58]
[ERROR]  >>        called from: do_companion_libs_for_host[scripts/build/companion_libs.sh@36]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@696]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'docs/manual/B_Known_issues.md'
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]  /
[ERROR]  (elapsed: 111:20.39)
[111:23] / gmake: *** [ct-ng:261: build] Error 2
1 Like

@falkTX do you think the lastest tool chain updates mentioned in the 1.13-RC1 thread will help fix this?

1 Like

No, the CPU flags are just different so it is expected to fail.
We need a raspberry-pi specific toolchain config

1 Like

Thanks for the reply. If you you have any ideas what needs to change in the config, I’d be happy to test.

1 Like

there is already a raspberrypi4 target in mod-plugin-builder, you can simply use that one

2 Likes

Thanks for the info.

Just to check I understand the terminology, target is the place the plugin will run? Or the hardware that will build the plugin?

Should I run .bootstrap.sh raspberrypi4 if I want the plugin to run on a dwarf, but running mod-plugin-builder on a pi?

1 Like

The “target” is what the name suggests, the target build platform.
So raspberrypi4 will build for the pi4 indeed.

For building targetting moddwarf inside a pi4, indeed you were on the right path.

To be quite honest, I dont think building software with a Pi4 (or other similar units) is a good idea. They are quite slow for compilation tasks, and dont have enough RAM to even be able to finalize some builds.

You could try using docker to bypass the processor errors, there is an arm64 docker file on mod-plugin-builder which I use on a macOS M1 system.

3 Likes

Thanks for those clarifications and your advice.

Ah, thank you. I didn’t think to try the docker approach after the mod-sdk wouldn’t work. I’ll give it a try and report back.

This is a fair comment! It has been a dramatic change of pace from my normal machine :sweat_smile: but it was all I had available to use to follow the instructions.

3 Likes

@falkTX the docker approach does appear to work for building the plugins — thank you very much!

However, the built plugins are stuck inside the container — any clues as to how to get them to appear outside?

I tried docker run -v ~/mod-workdir mod-plugin-builder ./build moddwarf stone-phaser-labs as in the docs it looks like -v should get it out, but its not there.

Any clues?

2 Likes

see the docker-mount.sh script on the mod-plugin-builder repo, it should set things up for you in terms of mounted volumes.
it works on macOS, so it has to work on a Pi4 too

2 Likes

Got it, thanks for pointing me in the right direction. This has given me some good clues to keep trying!

Although I’m running the sdk (access via ssh, and local network) on the Pi4, I’m running the mpb on a macOS M1.

2 Likes