Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always emit an amalgam file, even if it contains no microkernels; this ensures that all expected files are present for the build system, even during early stages of a new ISA when it might be empty. #6829

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions tools/update-microkernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,25 +592,24 @@ def main(args):
prod_microkernels.intersection(microkernels),
key=human_sort_key,
)
if microkernels:
filepaths = [
fp if os.path.isabs(fp) else os.path.join(root_dir, fp)
for fp in microkernels
]
if '_' in isa_spec:
isa, arch = isa_spec.split('_')
amalgam_filename = f'{isa}-{arch}.c'
else:
isa = isa_spec
amalgam_filename = f'{isa}.c'
header = ISA_TO_HEADER_MAP.get(isa)
amalgam_text = amalgamate_microkernel_sources(
filepaths, include_header=header
)
xnncommon.overwrite_if_changed(
os.path.join(src_dir, 'amalgam', 'gen', amalgam_filename),
amalgam_text,
)
filepaths = [
fp if os.path.isabs(fp) else os.path.join(root_dir, fp)
for fp in microkernels
]
if '_' in isa_spec:
isa, arch = isa_spec.split('_')
amalgam_filename = f'{isa}-{arch}.c'
else:
isa = isa_spec
amalgam_filename = f'{isa}.c'
header = ISA_TO_HEADER_MAP.get(isa)
amalgam_text = amalgamate_microkernel_sources(
filepaths, include_header=header
)
xnncommon.overwrite_if_changed(
os.path.join(src_dir, 'amalgam', 'gen', amalgam_filename),
amalgam_text,
)


if __name__ == '__main__':
Expand Down