As mentioned in #5868, there is a problem with some (most) linux distro-provided mozjs-*/js*package (or whatever spidermonkey (any version) is packaged as on that system), in that it contains a copy of icu headers that don't match the version of icu installed on the system. This mismatch causes a linking issue in our build process.
This revision contains a possible solution, by telling gcc (and clang, as it follows enough of the same code path within premake) to look through the mozjs-* includes directory after the system standard directories. This means that gcc/clang will look for icu in the system standard location (and find it) before searching the mozjs-* location.
The downside to this solution is that it requires patching premake5, and the pkgconfig module for it we use. (Although if we agree that the principle is sound, we can submit a PR to the premake project.)