HomeClusterLabs Projects

Low: gnulib: Fix building with --with-openssl.

Description

Low: gnulib: Fix building with --with-openssl.

I'm not convinced this is the right fix, or that it doesn't horribly
break something else in ways I can't detect right now, but it does at
least fix building with --with-openssl (which is an option we don't even
advertize).

The problem shows up with build errors like this:

In file included from md5.h:66,
                 from md5.c:27:
gl_openssl.h:78:1: error: no previous prototype for ‘md5_init_ctx’ [-Werror=missing-prototypes]
   78 | GL_CRYPTO_FN (_init_ctx) (struct _gl_ctx *ctx)

If you save the preprocessed output of lib/gnu/md5.c, you will come
across lines like the following:

  1. 77 "gl_openssl.h" extern void md5_init_ctx (struct md5_ctx *ctx) { (void) MD5_Init ((MD5_CTX *) ctx); }

There's a block like this for all the other functions that gl_openssl.h
assembles out of cpp macro magic. The extern seems to be throwing the
compiler off and making it look for another definition of md5_init_ctx
somewhere. There is no other definition.

So, GL_OPENSSL_INLINE must be getting defined as "extern". This happens
at the top of md5.c, with this block:

#if HAVE_OPENSSL_MD5
# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
#endif

The definition of _GL_EXTERN_INLINE is in the giant macro definition
maze that is m4/extern-inline.m4.

To make a long story short, we can just use _GL_INLINE instead. The
piece in GNUmakefile ensures this gets changed every time we update
gnulib.

Fixes T189.

Details

Provenance
clumensAuthored on Mar 30 2022, 3:28 PM
Parents
rP755d3a85226c: Maint: gnulib: Update gnulib for build changes.
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task