https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78984
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Not a bug. You are trying to use a 64bit ld with a ld plugin that is just compiled as 32bit. You need to use the 32bit ld here too. Try using a chroot env rather than the hack you are doing.