% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdflatex
\documentclass{article}

\begin{filecontents}{test-xr.tex}
\documentclass{article}
\usepackage{xr}
\externaldocument{mwe}
\begin{document}
Cross-ref external glossary entry \ref{glsentry-sample}.
\end{document}
\end{filecontents}

\usepackage{hyperref}
\usepackage[entrycounter]{glossaries}

\makeglossaries
\newglossaryentry{sample}{name={sample},
 description={an example}}

\begin{document}
\gls{sample}.
\printglossaries
\end{document}
