You can't just arbitrarily pull in libpgport.a everywhere that libpq.sois used. That breaks anything that requires position-independent code... for instance ecpglib.
regards, tom lane