[PATCH] Clear CXX and TEST_CXX if TEST_CXX link test fails
H.J. Lu
hjl.tools@gmail.com
Thu Dec 12 11:15:05 GMT 2024
On Thu, Dec 12, 2024 at 6:54 AM Sam James <sam@gentoo.org> wrote:
>
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
> > On Thu, Dec 12, 2024 at 1:16 AM Joseph Myers <josmyers@redhat.com> wrote:
> >>
> >> This breaks the case where the $CXX compiler doesn't work. This can be
> >> seen with the m68k-linux-gnu-coldfire regressions in
> >> <https://sourceware.org/pipermail/libc-testresults/2024q4/013238.html>,
> >> where the "whether $CXX can link programs" test fails because of libstdc++
> >> referencing hidden symbols in libgcc.a.
> >>
> >> In the case where CXX is set to empty because the link test failed
> >>
> >> AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=])
> >>
> >> much the same should apply to TEST_CXX if it was defaulted from CXX, so
> >> that Makefile conditionals ifeq (,$(CXX)) and ifneq (,$(CXX)) work
> >> correctly in such a case.
> >>
> >
> > Here is the patch. Tested for m68k-linux-gnu-coldfire build and native
> > build on x86-64.
> >
> > Since the C++ compiler is only for testing, if TEST_CXX link test fails,
> > clear both CXX and TEST_CXX so that the C++ compiler isn't used for glibc
> > build nor test.
> >
> > H.J.
> >
> > [2. application/x-patch; 0001-Clear-CXX-and-TEST_CXX-if-TEST_CXX-link-test-fails.patch]...
>
> LGTM with s/==/=/. I would prefer it if we moved more to AS_IF but
> that's a different issue to be done en-masse.
Sent v2 using AS_IF.
--
H.J.
More information about the Libc-alpha
mailing list