When build emacs-29.0.9999 with USE='gtk -X gui', it gives link error, while with dynamic-loading been selected, it can be built successfully
you can find more info here https://forums.gentoo.org/viewtopic-t-1147638-highlight-.html
Looks like a problem with the build system. Can you please report this upstream, too?
I have send a bug report email to bug-gnu-emacs@gnu.org, though I'm not quite familiar with bug report system of emacs. I will let you know once I get reply.
Upstream has confirmed this bug sloved. Could been close now.
Thanks for reporting!