OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-169-ga4878a5

Gerrit Code Review gerrit@openafs.org
Wed, 8 Jun 2022 23:40:15 -0400


The following commit has been merged in the master branch:
commit a4878a5e26b9997e40a3b197cea5f8c3b24f2539
Author: Cheyenne Wills <cwills@sinenomine.net>
Date:   Thu Feb 17 18:27:02 2022 -0700

    cf: Avoid nested C functions built by autoconf
    
    Currently, two of the Linux-related autoconf macros try to compile code
    containing nested C functions (AC_CHECK_LINUX_OPERATION and
    LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID).  For example, the
    AC_CHECK_LINUX_OPERATION check for 'follow_link' generates this code
    where 'op' is a nested function inside 'conftest':
    
       #include <linux/module.h>
       #include <linux/fs.h>
       void conftest(void)
       {
           struct inode_operations ops;
           const char *op(struct dentry *dentry, void **link_date) {
               return (const char *)0;
           };
           ops.follow_link = op;
       }
    
    Nested functions are a gcc-specific feature, and are not supported by
    other compilers (e.g. clang), causing these checks to always fail when
    using clang, leading to incorrect configure results.
    
    To fix this, change AC_CHECK_LINUX_OPERATION and
    LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID macros to just define the
    relevant function as a proper top-level function.
    
    (these were discovered by forcing a clang build of both the Linux kernel
    and the openafs kernel module)
    
    Change-Id: I1f5410d6702025d228b6ed80e7b86b9745ffe3dc
    Reviewed-on: https://gerrit.openafs.org/14901
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Andrew Deason <adeason@sinenomine.net>
    Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

 src/cf/linux-test1.m4 | 5 ++++-
 src/cf/linux-test4.m4 | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
OpenAFS Master Repository