Well, add a simple example, preferably not relying on Lazarus but pure FPC, that reproduces the issue. Without code there is little we can do.
Note FPC 3.1.1 is a *very* old trunk version. Trunk has been 3.3.1 for years now. Better test with 3.0.4 (current release) or 3.2.0 (in RC phase) or a recent trunk.
Trunk versions need to be up-to-date. If you use it, You are responsible to keep it up-to-date.
If you do not know how to do that you should not attempt to use a trunk version in the first place: trunk versions are moving targets and also contain experimental code that may not even reach a release.
There is also no support for older trunk versions, only the latest and there have been many fixes since 3.1.1.
For your platform there is a pre-packaged 3.2.0 RC available.