Properly link alias and function decls. This fixes PR2146