D3D resolves this by attaching semantics to the input/output and instead of matching by name it matches by semantic:
// vertex shader output
vec3 outposition : POSITION;

// fragment shader input...