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 248487 [details]
It seems to me that LDFLAGS are correctly applied. I did the verbose make and saw the -Wl,--as-needed and -Wl,O1 on the link command line
Need more info on that, sorry
Gha checked the log and indeed there is nothing you can do there to make it better; the ELF file is produced by fpc and that one doesn't use the LDFLAGS from environment.
Sorry for the extra noise.
*** Bug 361521 has been marked as a duplicate of this bug. ***