OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_10-27-gd50ced2

Gerrit Code Review gerrit@openafs.org
Thu, 5 Oct 2023 08:37:34 -0400


The following commit has been merged in the openafs-stable-1_8_x branch:
commit d50ced2a17e05884ea18bb3dfcde6378b2531dc7
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)
    
    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>
    (cherry picked from commit a4878a5e26b9997e40a3b197cea5f8c3b24f2539)
    
    Change-Id: Ie186658167a3f9e162fe85722aa0792cbe4fcfda
    Reviewed-on: https://gerrit.openafs.org/15540
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
    Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

-- 
OpenAFS Master Repository