I sorted out the problem by a series of steps...
1. I uninstalled Xcode completely.
2. I reinstalled Xcode from the AppStore
3. I ran `sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o /usr/lib/crt1.10.5.o` from the command line.
4. I ran `sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.o /usr/lib/crt1.o` from the command line.
5. I used `fpc hello.pas` where `hello.pas` contained just
begin
writeln('hello');
end.
to confirm that steps 3 and 4 worked.
6. I rebuilt the IDE using `Tools -> Build Lazarus with Profile: Normal IDE`
7. Breathed huge sigh of relief when all of my previous installed packages and IDE changes were restored!
Big thanks to @laguna who provided the forum post which provided step 3 and from which I was able to suss out step 4.