I forgot to note that I tested this only for x86_64 and not for other architectures. Don't have time for that currently and hope that at least it's better than nothing.