I guess it's not obvious to me there's a difference between "builtin" and "distro" (though we'd presumably not go putting the Wine builtin flag in mingw libraries). But yeah, I guess we'd want to vary load order depending on whether the library is a dependency of a PE builtin or not, in some way.
I was thinking about the possibility of a distro shipping a dll that's also a Wine builtin. But, we could probably resolve that case by saying "builtin" searches for wine builtins before distro libraries.
I guess we'd want the load order to be something like: * If explicitly set in registry or environment, use that. * If Wine builtin, use preattach. * If dependency of Wine builtin that exists in distro search path, builtin,native. * If dependency of a dll in distro search path (but not a Wine builtin), builtin,native. * Otherwise, native,builtin or maybe even native only (should Wine ever use a distro library to resolve dependencies of the application?).