[PATCH] binutils: Use AC_TRY_COMPILE to check target clang/gcc

H.J. Lu hjl.tools@gmail.com
Thu Oct 2 08:33:17 GMT 2025


On Thu, Oct 2, 2025 at 4:18 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Oct 01, 2025 at 09:02:43PM +0100, Sam James wrote:
> > "H.J. Lu" <hjl.tools@gmail.com> writes:
> >
> > > Use AC_TRY_COMPILE to check for the working target clang and gcc when
> > > configuring for cross tools.
> > >
> > > PR binutils/33503
> > > * configure: Regenerated.
> > >
> > > config/
> > >
> > > PR binutils/33503
> > > * clang-plugin.m4 (CLANG_PLUGIN_FILE_FOR_TARGET): Use
> > > AC_TRY_COMPILE to check the target clang and replace
> > > clang_cv_is_clang with clang_target_cv_working.
> > > * gcc-plugin.m4 (GCC_PLUGIN_OPTION_FOR_TARGET): Use
> > > AC_TRY_COMPILE to check the target gcc.
> >
> > Can you sync the GCC side?
>
> Also, can someone tell me why we need to invoke llvm-config?  Are
> there versions or installations of clang where
>   clang --print-file-name LLVMgold.so
> does not find/print the path to LLVMgold.so, but
>   `llvm-config --libdir`/LLVMgold.so
> will?  If it is only old versions or broken installations of clang,
> then should we bother?
>

See:

https://sourceware.org/bugzilla/show_bug.cgi?id=33198

for why llvm-config is used.

-- 
H.J.


More information about the Binutils mailing list