Repository navigation
Conversation
NML's CMS_XDR_UPDATER (libnml/cms/cms_xup.cc) serializes through the system RPC/XDR implementation, but the later usability probe calls get_myaddress, which NML does not use. Probe the fixed-width integer filters, xdrmem_create and stream position and destroy macros that cms_xup.cc already uses. This is expected to be neutral on working Linux configurations and diagnoses missing declarations or symbols in config.log before building NML. The probe only compiles and links; char, bytes, vector, float and double filters are not covered. Calls use parenthesized names so an undeclared function is an error even where older C compilers would implicitly declare a plain call. Stream operation macros remain unparenthesized so they can expand. The earlier rpc/rpc.h and libtirpc discovery is unchanged, including its get_myaddress library-symbol check.
Some system RPC/XDR implementations do not declare every fixed-width
filter CMS_XDR_UPDATER uses. The tested macOS SDK omits xdr_int8_t,
xdr_uint8_t and xdr_uint{16,32,64}_t, while providing the corresponding
unsigned xdr_u_int{16,32,64}_t primitives.
Check the five names with AC_CHECK_DECLS. For names not declared,
libnml/cms/nml_xdr_compat.h maps unsigned 16/32/64-bit routines to their
xdr_u_intN_t equivalents, with the same 4/8-byte encodings. The signed and
unsigned 8-bit adapters send one 32-bit XDR word, matching glibc/libtirpc:
decoding narrows without a range check, leaves the destination unchanged
on failure, and XDR_FREE is a no-op.
Declared native routines are always used. Where all five names are
declared, the header only includes rpc/rpc.h and stdint.h. config.h gains
five HAVE_DECL_* results, which cms_xup.cc includes before the header.
The configure probe uses the same compatibility header.
Mark the new header LGPL Version 2, matching the neighboring CMS files.
BsAtHome
reviewed
Nov 2, 2026
| AC_MSG_CHECKING([for usable fixed-width RPC/XDR routines]) | ||
| AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | ||
| #include <rpc/rpc.h> | ||
| #include "libnml/cms/nml_xdr_compat.h" |
Contributor
There was a problem hiding this comment.
Wouldn't this fail because config.h is not included?
This looks like a chicken-and-egg problem because config.h is generated by configure but you need it here for a test in configure. Besides, including from the source tree is not a "nice" thing to do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
Some (as I find) good news: My MacBook could eventually build some of our binaries. We are about four smaller patches away from it. All dependencies are installable via https://brew.sh. Changes are almost exclusively to the Makefiles or (like here) to the configuration.
I admit that I had used Codex to generate these changes. But I have also looked through them and think that they are good. I hope that you embrace these additions, less because of my Mac, more so because of other variants of Linux and why not also prepare for BSD.
NML’s XDR updater is bundled with LinuxCNC, but its serialization routines
come from the system RPC/XDR implementation. The later configure usability
check currently tests
get_myaddress, which NML does not call, rather thanthe fixed-width XDR interfaces it needs.
This series makes two focused changes:
by NML, giving an earlier diagnostic for missing declarations or symbols.
exist but the required fixed-width names are missing, as on the tested
macOS SDK.
Declared native routines remain preferred. Signedness and wire encodings
are unchanged. The existing RPC header discovery and TI-RPC fallback,
including its
get_myaddresslibrary-symbol check, remain unchanged.