TMP folder hardend results in error when build the cardano-node

When I execute cabal build cardano-cli cardano-node then it fails with followin error message:

ghc: panic! (the 'impossible' happened)
  (GHC version 8.10.2:
        Loading temp shared object failed: /tmp/ghc5459_0/ failed to map segment from shared object

Please report this as a GHC bug:

cabal: Failed to build th-orphans-0.13.11 (which is required by
test:cardano-node-test from cardano-node-1.24.2, test:cardano-cli-test from
cardano-cli-1.24.2 and others). See the build log above for details.

I assume because I hardened my TMP folder with the following guide: List of things for hardening Ubuntu ยท GitHub

Is there are workaround? Otherwise, I will revert the restriction tomorrow. Thanks!

I solved it by reverting my restriction for the installation!

May I ask how you did it?
Was it just
sudo unlink /var/tmp
sudo umount /tmp
cabal build all
and then again
sudo mount -o loop,noexec,nosuid,rw /tmpdisk /tmp
sudo mount -o remount /tmp
sudo ln -s /tmp /var/tmp

I cannot exactly recall now, but something like this. Yes.