Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libselinux: move functions out of header file
When building libselinux from its own directory GCC complains about the two functions free_spec_node() and sort_spec_node(), which are not tiny and also recursive. In file included from label_file.c:27: In function ‘load_mmap’, inlined from ‘process_file’ at label_file.c:1106:9: label_file.h:816:20: error: inlining failed in call to ‘free_spec_node’: --param max-inline-insns-single limit reached [-Werror=inline] 816 | static inline void free_spec_node(struct spec_node *node) | ^~~~~~~~~~~~~~ label_file.c:899:17: note: called from here 899 | free_spec_node(data->root); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ label_file.h:816:20: error: inlining failed in call to ‘free_spec_node’: --param max-inline-insns-single limit reached [-Werror=inline] 816 | static inline void free_spec_node(struct spec_node *node) | ^~~~~~~~~~~~~~ label_file.c:908:17: note: called from here 908 | free_spec_node(root); | ^~~~~~~~~~~~~~~~~~~~ In function ‘sort_specs’, inlined from ‘init’ at label_file.c:1350:3: label_file.h:404:20: error: inlining failed in call to ‘sort_spec_node’: --param max-inline-insns-single limit reached [-Werror=inline] 404 | static inline void sort_spec_node(struct spec_node *node, struct spec_node *parent) | ^~~~~~~~~~~~~~ label_file.h:433:9: note: called from here 433 | sort_spec_node(data->root, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘sort_specs’, inlined from ‘init’ at label_file.c:1370:3: label_file.h:404:20: error: inlining failed in call to ‘sort_spec_node’: --param max-inline-insns-single limit reached [-Werror=inline] 404 | static inline void sort_spec_node(struct spec_node *node, struct spec_node *parent) | ^~~~~~~~~~~~~~ label_file.h:433:9: note: called from here 433 | sort_spec_node(data->root, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 92306da ("libselinux: rework selabel_file(5) database") Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
- Loading branch information