[LLVMbugs] [Bug 9254] New: clang can't build iptables in Linux kernel: error: fields must have a constant size: 'variable length array in structure' extension will never be supported

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 19 02:31:40 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9254

           Summary: clang can't build iptables in Linux kernel: error:
                    fields must have a constant size: 'variable length
                    array in structure' extension will never be supported
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu
        Depends on: 4068


clang doesn't support this, and says it won't:
crypto/hmac.c:57:8: error: fields must have a constant size: 'variable length
array in structure' extension will never be supported
                char ctx[crypto_shash_descsize(hash)];


That part of kernel code should probably be rewritten to not use this, but more
and more kernel code seems to turn up that uses this feature of gcc.
It used to be only the crypto API, now it is iptables too.

Meanwhile I opened this bug to document how to turn off the problematic parts
of the kernel, and its dependencies.
You need to turn off these:
CONFIG_INET_AH
CONFIG_INET_ESP
CONFIG_INET6_AH
CONFIG_INET6_ESP
CONFIG_NETFILTER
CONFIG_LIBCRC32C

The iptables is a problem though, without it we can't really say that "clang
builds a Linux kernel".
How hard would it be to implement this specific case in clang?
And how hard would it be to patch the kernel to not use this feature?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list