Commit c3f35ec
clang: Add microsoft extensions build flags
Starting in Linux 6.19, `struct ns_common` fields were moved into an
anonymous nested forward declaration (`struct ns_tree;`) within a
union.[1]
This causes Clang to throw a `[-Wmissing-declarations]` warning and
fail with missing member errors.
This affects tools pulling in `<linux/pid_namespace.h>` directly or
transitively (e.g. filetop, runqlat)
Errors encountered:
include/linux/ns/ns_common_types.h:117:3: warning: declaration does not declare anything [-Wmissing-declarations]
117 | struct ns_tree;
| ^~~~~~~~~~~~~~
In file included from /virtual/main.c:5:
In file included from include/linux/pid_namespace.h:11:
include/linux/ns_common.h:25:23: error: no member named 'ns_id' in 'struct ns_common'
25 | VFS_WARN_ON_ONCE(ns->ns_id == 0);
| ~~ ^
include/linux/ns_common.h:26:13: error: no member named 'ns_id' in 'struct ns_common'
26 | return ns->ns_id <= NS_LAST_INIT_ID;
| ~~ ^
include/linux/ns_common.h:60:26: error: no member named '__ns_ref_active' in 'struct ns_common'
60 | return atomic_read(&ns->__ns_ref_active);
This patch fixes the issue globally by turning on microsoft extensions
flags. These flags have already been in the linux kernel. [2]
[1] torvalds/linux@a657bc8
[2] torvalds/linux@c4781dc
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
Fixes: iovisor#54881 parent 88c4e54 commit c3f35ec
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
0 commit comments