nthdimtech / signet-base

Signet firmware and device interface library
https://www.crowdsupply.com/nth-dimension/signet
GNU General Public License v3.0
15 stars 7 forks source link

Which environment / setup to successfully build the firmware? #24

Closed tuxlifan closed 6 years ago

tuxlifan commented 6 years ago

Could you please advise which setup (distribution, installed packages, etc.) is needed to successfully build the firmware?

The farthest I've come (using the 0.9.9 desktop client tarball with cloned nthdimtech nettle and crosstool-ng repos; as well as also with the signet-base repo directly) is with a freshly installed Devuan Jessie chroot (where /build is the $HOME for the building user) until the compilation of serial-loader.

With modified Makefile in firmware/:

  1. adding "-std=gnu11" (but any other std gives same result) to the "serial-loader:" gcc-invocation

  2. adding an additional /$(HTUPLE) since otherwise it wouldn't find "bfd.h": LIBBDF_INSTALLDIR=$(HOME)/x-tools/$(HTUPLE)/$(BTUPLE)/$(HTUPLE)

then I get the following failure: https://gist.github.com/tuxlifan/940531c73854c28de03c05fa5c827d78

I don't understand why "/build/[...]/firmware/ct-ng/.build/[...]" shows up in the error messages. Does it mean that something went wrong already when building the toolchain with ct-ng but was not reported at that time? If necessary I could also upload ct-ng's build.log.

Please let me know any additional information you might require.

At this point I really don't care if I have to setup a qemu virtual machine and let it build for a whole week or month, as long as I get it to successfully compile somewhere (well, on Linux, preferably ;-))...

Thanks!

dumblob commented 6 years ago

Didn't try it with the newest version, but about a month ago I've had success with the following minor modification of the client/client.pro file (I've been compiling the desktop client under Arch Linux):

-CONFIG(release, debug|release):LIBS += -L$$PWD/../signet-base/build-signetdev-$$QT_ARCH-release
-CONFIG(debug, debug|release):LIBS += -L$$PWD/../signet-base/build-signetdev-$$QT_ARCH-debug
+CONFIG(release, debug|release):LIBS += -L$$PWD/../signet-base/signetdev
+CONFIG(debug, debug|release):LIBS += -L$$PWD/../signet-base/signetdev

(even though it seems right now to have nothing to do with your issue, it might get handy later)

nthdimtech commented 6 years ago

@tuxlifan I think I have fixed all of the issues you hit. See my latest commit. I build on slackware 14.2. I have tried to build on a Debian based system before and recall some changes I had to make to get it to work. Looking deeper I've just discovered that on Slackware I wasn't actually linking against the non-system static libbfd as intended because of the missing $(HTUPLE). The link problems stem from this. The static libbfd requires "-liberty". For building the host tools "-std=c99" is needed. On my Slackware system C99 is a default. I've explicitly added the C99 option now. I will do a write up on building the firmware soon and publish it in the repo and the website but I hope you can build now with these changes

@dumblob That kind of change when building the client is no longer needed since the client now directly compiles "signetdev" instead of linking a signetdev lib. There are build instructions in the repository now. If those instructions don't work without modification then it's a bug.

tuxlifan commented 6 years ago

@nthdimtech I put a few

[...] -L./ct-ng/.build/arm-none-eabi/build/build-cc-gcc-final/libiberty -liberty [...]

in there and together with your previous tip (#23) of running

./signet-firmware-encoder signet-fw

SUCCESS :-D

In reference to #22: $ b2sum Downloads/signet-1.2.4.sfw /build/fromtarball/signet-desktop-client-0.9.9/signet-base/firmware/signet-1.2.4.sfw

2f7318c96d232d828942cc5e3a85dc4cf889d0d2cd95a1367fa495e92022fd4b34b354c40abaebe597f7f04f6a46c313361aea5d876b9ca580c7afc4e20e586c Downloads/signet-1.2.4.sfw # downloaded

2f7318c96d232d828942cc5e3a85dc4cf889d0d2cd95a1367fa495e92022fd4b34b354c40abaebe597f7f04f6a46c313361aea5d876b9ca580c7afc4e20e586c /build/fromtarball/signet-desktop-client-0.9.9/signet-base/firmware/signet-1.2.4.sfw # built

My next goal is to find out if I can coax guix into making it build reproducible :)