Hello Adolf,
On 26 Nov 2022, at 22:24, Adolf Belka adolf.belka@ipfire.org wrote:
Hi All,
I tried to run a aarch64 build of samba so that I could get the correct rootfile but I had a few problems.
I installed qemu-user-static on Arch Linux but when I tried to run the gettoolchain command I got an error message about not finding the binfmt_misc helper.
Figured out that I needed to also install qemu-user-static-binfmt as well. Then the error message changed to the fact that it could not find /usr/bin/qemu-aarch64-static but it was in that directory.
Eventually used the find static command from ./make.sh and found that on Arch Linux it does not have "statically linked" but "static-pie linked". Changing the ./make.sh find static command to look for "static-pie linked" then allowed the build for aarch64 to proceed.
It is required that QEMU is statically linked.
The reason for that is that we copy the binary into the build environment where it has no access to any libraries of the host - and to make those available, they need to be compiled into the binary.
PIE does not have anything to do with a statically linked binary (well kind of, but I wouldn’t know why that is relevant in this context).
So what did you change exactly for this to work on your system? make.sh would normally automatically try to find the correct binary.
Of course having changed ./make.sh means that it now shows up as a modified file in the git status. I will look at changing the find static command to look for either "statically linked" or "static-pie linked" and submit it as a patch for consideration.
Regards,
Adolf.
-Michael