r286024 lets ranlib ignore the -D flag and default to non-deterministic mode as the chunk that sets AR_D is only reached when running as ar. The attached patch is one way to fix this. Obtained from ElectroBSD.
Created attachment 160479 [details] usr.bin/ar: Fix deterministic mode when running as ranlib
A commit references this bug: Author: emaste Date: Mon Aug 31 12:28:14 UTC 2015 New revision: 287324 URL: https://svnweb.freebsd.org/changeset/base/287324 Log: ar: fix deterministic mode when running as ranlib This was broken by r286024. PR: 202741 Submitted by: fk@fabiankeil.de Obtained from: ElectroBSD Changes: head/usr.bin/ar/ar.c
I intend to MFC the change to enable deterministic mode by default, and will include this fix.