Page 1 of 1

Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-22 13:37
by berillions

I'm trying to backports LLVM in these both version to have the latest version of Mesa for my hardware in buster (i have an AMD rx5600XT).
Unfortunately, it fails at the "debian-full-build' step in debian/rules :
Code: Select all
# Check the stage 2 build worked
   if test "$(BUILD_METHOD)" = "stage2"; then \
   if ! readelf --string-dump .comment  $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \
      echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \
   fi; \

   touch $@

To build LLVM, i use pbuilder and i use this command :
Code: Select all
DIST=stable pdebuild --debbuildopts -j10

I share you the .build file. ... WQ2FwHO12Q

Thanks for your help,

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-23 15:49
by kedaha
That is a huge backport.
You might have better luck with dpkg-buildpackage -us -uc
I was able to build the llvm-toolchain-9_9.0.1-6.debian.tar.xz version with that.

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-23 16:00
by stevepusser
I haven't been able to do so either, with the same sort of errors. I have to use sbuild for a schroot build instead.We already have backports in the MX 19 "AHS" section for our backported Mesas, currently up to 20.1.1.

Llvm automatically uses all your available cores for the compiling, so you don't have to force it to do that. I want to limit that most of the time so I have a few cycles left for other things, so can try this type of command:
Code: Select all
sbuild  --arch=amd64 -d buster --debbuildopt=-J6 --force-orig-source -s -A

The upper case "J" is more forceful than the lower case. Llvm is weird in that both the primary amd64 build and any secondary builds still generate the same set of packages, when the secondary build is supposed to leave out any arch-independent ones, like the docs package.

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-23 19:34
by kedaha
Unless there's a specific reason for backporting LLVM, which takes ages and ages to eventually churn out 60 deb packages, there is also a repository available for Buster at

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-24 02:02
by stevepusser
The 5600XT is also going to need Navi firmware, currently not available in any version of Debian. You'll have to get it manually, which a lot of people have trouble doing , it seems, or install the "linux-firmware" package I've ported from Ubuntu for MX Linux. There's a current thread here about a 5700XT on testing which is having trouble without "linux-firmware", though others have successfully used it here in other threads.

You may want to try the Live session of MX 19.2 AHS edition, which has all those backports already, just to confirm that it works. Then you can redo all our backports if you want.

Most of the build time for LLVM is for the self testing after the compile step, which can be disabled by an override in debian/rules if you know how. We don't disable those for the MX backports, though.

Anyway, creating an sbuild environment is pretty easy. Install sbuild from buster-backports along with ubuntu-dev-tools from main. Then, if you're on amd64 and need the 32-bit packages also:
Code: Select all
mk-sbuild buster
mk-sbuild buster --arch=i386

Then log out and back in to make sure you're in the sbuild group.

Check out sbuild's man page and the Ubuntu and Debian wiki pages for sbuild also--though some tricks still seem to be poorly documented, such as adding multiple outside repos to it, like debian-backports at the same time as the MX repos, but it can be done.

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-24 17:53
by stevepusser
BTW, if you do use sbuild (or pbuilder for other projects like kernel backports from Debian), the builds take place in your root by default, so either configure them elsewhere, or make sure to have many GB free in /. Kernel backports have been taking over 60 GB recently, but LLVM somewhat less.

Re: Unable to backports LLVM 9/10 with PBuilder

PostPosted: 2020-06-25 02:23
by stevepusser
Oh, yeah, I have also used the OBS to backport some llvm 9 and 10 releases, too. Great if you really don't have the hardware to do so. ... ort-buster

Though I really haven't had the time to maintain that repo recently. I've updated the Nvidia set of drivers, along with Virtual Box and bbswitch, in the MX repos to build on the 5.7 kernel, but now the 5.7 Liquorix kernel won't suspend or hibernate correctly (confirmed by the Liquorix developer today on his own laptop). :(