Bug #687


rpcgen should not generate absolute #includes

Added by Rich Lowe over 11 years ago. Updated almost 7 years ago.

lib - userland libraries
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


Every so often (not often enough to remember about this) I move a workspace around, or otherwise build it when its prior location was inaccessible.
It turns out this fails, because libidmap's idmap_xdr.c is generated with an absolute path to idmap_xdr.h within it. It should use workspace-relative paths.

Actions #1

Updated by Rich Lowe over 11 years ago

The problem is anything generated by rpcgen(1).

Actions #2

Updated by Rich Lowe over 11 years ago

  • Subject changed from idmap_xdr.c is generated with full workspace paths to rpcgen should not generate absolute #includes
Actions #3

Updated by Gordon Ross over 11 years ago

In the past, I've dealt with this using sed in the Makefile like this:


foo_xdr.c : $(FOO_X)
$(RPCGEN) $(RPCGENFLAGS) -c -o $.tmp $(FOO_X)
sed -e $(SED_INCL) < $
.tmp > $
$(RM) -f $

Would be nice if rpcgen gave you a little more control instead...

Actions #4

Updated by Gary Mills almost 7 years ago

I tried to reproduce this problem, but was unable to do so. It's true that idmap_xdr.c contains an absolute path to the idmap_prot.h header, but the idmap_xdr.c file is also deleted and recreated at the beginning of every build. This happens because the file is added to the CLOBBERFILES macro in .

I don't see any problem here. It's true that rpcgen could be modified to generate a relative path, but that won't provide an immediate solution because the build uses rpcgen from the build host, not the one from illumos. could also be modified to produce a relative include path.

What should be fixed here? Maybe the bug report should simply be closed.

Actions #5

Updated by Igor Kozhukhov almost 7 years ago

i have made some change for using rpcgen from workspace(it built with tools) instead of build host.
i have found that if we have updated rpcgen it will be using only after install it to build host - it is a problem.
my changes works such as: build rpcgen with tools or by 'dmake setup' and use it from tools proto instead of build host.

Actions #6

Updated by Gary Mills almost 7 years ago

I'll look after this bug. I have a simple solution that solves the problem.

Actions #7

Updated by Electric Monk almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 77eb9dd4fa1a2a4b00af3d1973a84b60fbf40cdf

commit  77eb9dd4fa1a2a4b00af3d1973a84b60fbf40cdf
Author: Gary Mills <>
Date:   2015-07-02T17:53:15.000Z

    687 rpcgen should not generate absolute #includes
    Reviewed by: Marcel Telka <>
    Approved by: Dan McDonald <>


Also available in: Atom PDF