What you are seeing is that the applicaion you built linked against
libffi, which we had to custom build. GHC is not smart enough to provide the libffi linking flags automatically for a non-in-tree libffi.
For the trivial HelloWorld sample I did not need libffi, however the Cross Compiling Template Haskell, I did need libffi, and showed how to copy the custom libffi library over, and use
LD_LIBRARY_PATH to provide the
libffi.so.7 to the system linker.
The alternative is to build a static libffi, and provide the
-lffi arguments when building the application.
Did you encounter this with the Hello World sample application?