[PATCH] rpc: genprotocol: Always apply fixups to rpcgen's output

Peter Krempa pkrempa at redhat.com
Wed Mar 8 08:56:15 UTC 2023


The platform check which determines when to apply the fixups mentions
all officially supported build targets (per docs/platforms.rst) thus
it's not really necessary.

Additionally while not explicitly written as supported the check does
not work properly when building with the MinGW toolchain on Windows as
it does not apply the needed transformations. They are necessary
there the same way as with MinGW on Linux.

https://gitlab.com/libvirt/libvirt/-/issues/453

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/rpc/genprotocol.pl | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index f567260588..adf3991d7a 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 #
-# Generate code for an XDR protocol, optionally applying
+# Generate code for an XDR protocol, applying
 # fixups to the glibc rpcgen code so that it compiles
 # with warnings turned on.
 #
@@ -47,20 +47,11 @@ open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
 open TARGET, ">$target"
     or die "cannot create $target: $!";

-my $fixup = $^O eq "linux" || $^O eq "gnukfreebsd" || $^O eq "freebsd" || $^O eq "darwin";
-
 if ($mode eq "-c") {
     print TARGET "#include <config.h>\n";
 }

 while (<RPCGEN>) {
-    # We only want to fixup the GLibc rpcgen output
-    # So just print data unchanged, if non-Linux
-    unless ($fixup) {
-        print TARGET;
-        next;
-    }
-
     if (m/^{/) {
         $in_function = 1;
         print TARGET;
-- 
2.39.2



More information about the libvir-list mailing list