See attached build log.
(Please do not complain about the need for looking at the build log until you can provide an easy way to open bugs with the correct data picked out of a tinderbox log. Thanks.)
Created attachment 263983 [details]
Created attachment 286919 [details]
patch to respect LDFLAGS for the plugin .so
The bug nowadays applies only to the .so file, as the binaries have become shell launchers. Attached patch adds LDFLAGS to the .so file linking rule.
Applied, let's see about upstream.
You forgot to commit the patch itself to the java-overlay, which breaks prepare.