On Tue, Nov 17, 2015 at 4:20 PM Rich Felker <dalias@libc.org> wrote:
BTW could you refrain from top posting on the list? Even if you just
have a short reply that's in regards to the whole quoted message
rather than specific points to address inline, things get awkward to
follow in a hurry (just like now) when somebody else replies to you
but also wants to keep the quoted content you were replying to as
context (like below).

Yes, I'm sorry about that, that's the default configuration I use in my mail client, but I'll avoid it on the list.
 
Discussion on irc, along with some basic testing, showed that this
does not work. The obvious solution with $(subst ...) also does not
work because it's plausible that $(srcdir) also contains the substring
/$(ARCH)/, in which case it would get messed up. However I did find a
form that seems to work reliably and that's not hideous:

$(patsubst %,$(srcdir)/%,$(subst /$(ARCH)/,/,$(patsubst $(srcdir)/%,%,$(ARCH_OBJS))))

That yields the list of object files to filter out, which can then be
passed into $(filter-out ...).

I've reworked the patch following our discussion on IRC by placing all object files into a directory which enables the use of implicit rules. The rest of the logic is similar to what you proposed as well as to my previous patches: constructing the list of objects and then filtering out files for which (sub)architecture versions are available.