]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
make: skip pdwtags when building with CLang
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 28 Feb 2018 14:38:20 +0000 (14:38 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 28 Feb 2018 17:53:23 +0000 (17:53 +0000)
When building with CLang the structs that are emitted by pdwtags appear
in a completely different order than with GCC, which causes the
comparison against expected data to fail.

Ideally the test would not be sensitive to the ordering, because even
future GCC could cause changes, but that's not easy to fix. So for now
just skip the test when using clang.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/Makefile.am

index 8d72f2f1e5c3b4f289a9f7a1303bb6d9696eb0f8..57949152469d74768fc7a4f9c995bdc6ea829a0f 100644 (file)
@@ -664,8 +664,16 @@ struct_prefix = ($(libs_prefix)|$(other_prefix))
 # remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
 # the newest of the two, in case configure options changed and a stale
 # file is left around from an earlier build.
+# The pdwtags output is completely different when building with clang
+# which causes the comparison against expected output to fail, so skip
+# if using clang as CC.
 PDWTAGS = \
-       $(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
+       $(AM_V_GEN)$CC -v 2>&1 | grep -q clang; \
+       if test $$? == 1; then \
+          echo 'WARNING: skipping pdwtags test with Clang' >&2; \
+          exit 0; \
+       fi; \
+       if (pdwtags --help) > /dev/null 2>&1; then \
          o=`ls -t $(<:.lo=.$(OBJEXT)) \
             $(subst /,/.libs/,$(<:.lo=.$(OBJEXT))) \
            2>/dev/null | sed -n 1p`; \