userland: only link to lkmc.o if needed

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent eba97f9cef
commit e5dbbcd8c2
6 changed files with 20 additions and 5 deletions

View File

@@ -206,7 +206,7 @@ Default: build all examples that have their package dependencies met, e.g.:
build_dir, build_dir,
dirpath_relative_root dirpath_relative_root
) )
common_objs_dir = [common_obj] common_objs_dir = []
cc_flags_after = [] cc_flags_after = []
cc_flags_dir = cc_flags.copy() cc_flags_dir = cc_flags.copy()
if dirpath_relative_root_components_len > 0: 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']: if my_path_properties['pedantic']:
cc_flags_file.extend(['-pedantic', LF]) 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({ error = thread_pool.submit({
'c_std': my_path_properties['c_std'], 'c_std': my_path_properties['c_std'],
'cc_flags': cc_flags_file + my_path_properties['cc_flags'], 'cc_flags': cc_flags_file + my_path_properties['cc_flags'],
'cc_flags_after': cc_flags_after, 'cc_flags_after': cc_flags_after,
'cxx_std': my_path_properties['cxx_std'], 'cxx_std': my_path_properties['cxx_std'],
'extra_objs': common_objs_dir, 'extra_objs': common_objs_file,
'in_path': in_path, 'in_path': in_path,
'out_path': self.resolve_userland_executable(in_path), 'out_path': self.resolve_userland_executable(in_path),
}) })

View File

@@ -22,6 +22,10 @@ class PathProperties:
'cxx_std', 'cxx_std',
'exit_status', 'exit_status',
'interactive', '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', 'skip_run_unclassified',
'more_than_1s', 'more_than_1s',
# The path does not generate an executable in itself, e.g. # The path does not generate an executable in itself, e.g.
@@ -92,6 +96,7 @@ path_properties_tree = PrefixTree(
'cxx_std': None, 'cxx_std': None,
'exit_status': 0, 'exit_status': 0,
'interactive': False, 'interactive': False,
'lkmc_common_obj': False,
'skip_run_unclassified': False, 'skip_run_unclassified': False,
'more_than_1s': False, 'more_than_1s': False,
# The path does not generate an executable in itself, e.g. # The path does not generate an executable in itself, e.g.
@@ -106,8 +111,7 @@ path_properties_tree = PrefixTree(
}, },
{ {
'userland': PrefixTree( 'userland': PrefixTree(
{ {},
},
{ {
'arch': PrefixTree( 'arch': PrefixTree(
{ {
@@ -159,7 +163,6 @@ path_properties_tree = PrefixTree(
'c': PrefixTree( 'c': PrefixTree(
{}, {},
{ {
'assert_fail.c': PrefixTree({'exit_status': 1}),
'false.c': PrefixTree({'exit_status': 1}), 'false.c': PrefixTree({'exit_status': 1}),
'getchar.c': PrefixTree({'interactive': True}), 'getchar.c': PrefixTree({'interactive': True}),
'infinite_loop.c': PrefixTree({'more_than_1s': True}), 'infinite_loop.c': PrefixTree({'more_than_1s': True}),
@@ -167,6 +170,14 @@ path_properties_tree = PrefixTree(
), ),
'gcc': PrefixTree(gnu_extensions), 'gcc': PrefixTree(gnu_extensions),
'kernel_modules': PrefixTree({**gnu_extensions, **{'requires_kernel_modules': True}}), '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( 'linux': PrefixTree(
{**gnu_extensions, **{'skip_run_unclassified': True}}, {**gnu_extensions, **{'skip_run_unclassified': True}},
), ),

View File

@@ -0,0 +1 @@
Testing mostly infrastructure of this repository rather than anything else.