mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
userland: only link to lkmc.o if needed
This commit is contained in:
@@ -206,7 +206,7 @@ Default: build all examples that have their package dependencies met, e.g.:
|
||||
build_dir,
|
||||
dirpath_relative_root
|
||||
)
|
||||
common_objs_dir = [common_obj]
|
||||
common_objs_dir = []
|
||||
cc_flags_after = []
|
||||
cc_flags_dir = cc_flags.copy()
|
||||
if dirpath_relative_root_components_len > 0:
|
||||
@@ -270,12 +270,15 @@ Default: build all examples that have their package dependencies met, e.g.:
|
||||
))
|
||||
if my_path_properties['pedantic']:
|
||||
cc_flags_file.extend(['-pedantic', LF])
|
||||
common_objs_file = common_objs_dir.copy()
|
||||
if my_path_properties['lkmc_common_obj']:
|
||||
common_objs_file.append(common_obj)
|
||||
error = thread_pool.submit({
|
||||
'c_std': my_path_properties['c_std'],
|
||||
'cc_flags': cc_flags_file + my_path_properties['cc_flags'],
|
||||
'cc_flags_after': cc_flags_after,
|
||||
'cxx_std': my_path_properties['cxx_std'],
|
||||
'extra_objs': common_objs_dir,
|
||||
'extra_objs': common_objs_file,
|
||||
'in_path': in_path,
|
||||
'out_path': self.resolve_userland_executable(in_path),
|
||||
})
|
||||
|
||||
@@ -22,6 +22,10 @@ class PathProperties:
|
||||
'cxx_std',
|
||||
'exit_status',
|
||||
'interactive',
|
||||
# We should get rid of this if we ever properly implement dependency graphs.
|
||||
'lkmc_common_obj',
|
||||
# We were lazy to properly classify why we are skipping these tests.
|
||||
# TODO get it done.
|
||||
'skip_run_unclassified',
|
||||
'more_than_1s',
|
||||
# The path does not generate an executable in itself, e.g.
|
||||
@@ -92,6 +96,7 @@ path_properties_tree = PrefixTree(
|
||||
'cxx_std': None,
|
||||
'exit_status': 0,
|
||||
'interactive': False,
|
||||
'lkmc_common_obj': False,
|
||||
'skip_run_unclassified': False,
|
||||
'more_than_1s': False,
|
||||
# The path does not generate an executable in itself, e.g.
|
||||
@@ -106,8 +111,7 @@ path_properties_tree = PrefixTree(
|
||||
},
|
||||
{
|
||||
'userland': PrefixTree(
|
||||
{
|
||||
},
|
||||
{},
|
||||
{
|
||||
'arch': PrefixTree(
|
||||
{
|
||||
@@ -159,7 +163,6 @@ path_properties_tree = PrefixTree(
|
||||
'c': PrefixTree(
|
||||
{},
|
||||
{
|
||||
'assert_fail.c': PrefixTree({'exit_status': 1}),
|
||||
'false.c': PrefixTree({'exit_status': 1}),
|
||||
'getchar.c': PrefixTree({'interactive': True}),
|
||||
'infinite_loop.c': PrefixTree({'more_than_1s': True}),
|
||||
@@ -167,6 +170,14 @@ path_properties_tree = PrefixTree(
|
||||
),
|
||||
'gcc': PrefixTree(gnu_extensions),
|
||||
'kernel_modules': PrefixTree({**gnu_extensions, **{'requires_kernel_modules': True}}),
|
||||
'lkmc': PrefixTree(
|
||||
{'lkmc_common_obj': True},
|
||||
{
|
||||
|
||||
'assert_fail.c': PrefixTree({'exit_status': 1})
|
||||
}
|
||||
),
|
||||
'libs': PrefixTree({'skip_run_unclassified': True}),
|
||||
'linux': PrefixTree(
|
||||
{**gnu_extensions, **{'skip_run_unclassified': True}},
|
||||
),
|
||||
|
||||
1
userland/lkmc/README.adoc
Normal file
1
userland/lkmc/README.adoc
Normal file
@@ -0,0 +1 @@
|
||||
Testing mostly infrastructure of this repository rather than anything else.
|
||||
Reference in New Issue
Block a user