Skip to content

Commit

Permalink
disk-image-minimal: Don't expect lib128(g) to have a full set of libr…
Browse files Browse the repository at this point in the history
…aries

Both are minimal sets needed for SPEC CPU2006. Technically we should
still require libc, libc++ and related supporting libraries if the
directories are populated, but that's more invasive, and users aren't
expected to have lib128(g) at all, so if it's a bit liberal then it's
not really an issue.
  • Loading branch information
jrtc27 committed Jan 26, 2024
1 parent 29d93a0 commit 5a64dd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pycheribuild/projects/disk_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@ def add_unlisted_files_to_metalog(self):
if (self.rootfs_dir / libcompat_dir).is_symlink():
self.mtree.add_symlink(src_symlink=self.rootfs_dir / libcompat_dir, path_in_image=libcompat_dir)
elif (fullpath / "libc.so").exists():
self.add_required_libraries(["usr/" + libcompat_dir])
ignore_required = libcompat_dir in ("lib128", "lib128g")
self.add_required_libraries(["usr/" + libcompat_dir], ignore_required=ignore_required)

if self.include_cheribsdtest:
for test_binary in (self.rootfs_dir / "bin").glob("cheribsdtest-*"):
Expand Down Expand Up @@ -1037,7 +1038,7 @@ def add_unlisted_files_to_metalog(self):
self.verbose_print("Boot files:\n\t", "\n\t".join(map(str, sorted(extra_files))))
self.verbose_print("Not adding unlisted files to METALOG since we are building a minimal image")

def add_required_libraries(self, libdirs: "list[str]"):
def add_required_libraries(self, libdirs: "list[str]", ignore_required: bool = False):
optional_libs = []
required_libs = [
"libc.so.7",
Expand Down Expand Up @@ -1106,7 +1107,7 @@ def add_required_libraries(self, libdirs: "list[str]"):
prefix = libdirs[0] + "/"
else:
prefix = "{" + ",".join(libdirs) + "}/"
if required:
if required and not ignore_required:
self.fatal("Could not find required library '", prefix + library_basename, "' in rootfs ",
self.rootfs_dir, sep="")
else:
Expand Down

0 comments on commit 5a64dd7

Please sign in to comment.