Skip to content

Commit

Permalink
Stop using fixlinks tool during sysroot installation
Browse files Browse the repository at this point in the history
CheriBSD has not installed broken absolute symlinks for many years, we
can retire this tool now.
  • Loading branch information
arichardson committed Jul 31, 2023
1 parent 6d85f66 commit 2a0c1c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 71 deletions.
59 changes: 0 additions & 59 deletions pycheribuild/files/fixlinks.c

This file was deleted.

13 changes: 1 addition & 12 deletions pycheribuild/projects/cross/cheribsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from ...config.target_info import AutoVarInit, CrossCompileTarget
from ...config.target_info import CompilerType as FreeBSDToolchainKind
from ...processutils import latest_system_clang_tool, print_command
from ...utils import OSInfo, ThreadJoiner, cached_property, classproperty, include_local_file, is_jenkins_build
from ...utils import OSInfo, ThreadJoiner, cached_property, classproperty, is_jenkins_build


def _arch_suffixed_custom_install_dir(prefix: str) -> "ComputedDefaultValue[Path]":
Expand Down Expand Up @@ -2017,14 +2017,6 @@ def __init__(self, *args, **kwargs) -> None:
self.bsdtar_cmd = "bsdtar"
self.install_dir = self.target_info.sdk_root_dir

def fix_symlinks(self) -> None:
# copied from the build_sdk.sh script
# TODO: we could do this in python as well, but this method works
# FIXME: should no longer be needed
fixlinks_src = include_local_file("files/fixlinks.c")
self.run_cmd("cc", "-x", "c", "-", "-o", self.install_dir / "bin/fixlinks", input=fixlinks_src)
self.run_cmd(self.install_dir / "bin/fixlinks", cwd=self.cross_sysroot_path / "usr/lib")

def check_system_dependencies(self) -> None:
super().check_system_dependencies()
self.check_required_system_tool("bsdtar", cheribuild_target="bsdtar", apt="libarchive-tools")
Expand Down Expand Up @@ -2106,9 +2098,6 @@ def create_sysroot(self) -> None:
if not (self.cross_sysroot_path / "lib/libc.so.7").is_file():
self.fatal(self.cross_sysroot_path, "is missing the libc library, install seems to have failed!")

# fix symbolic links in the sysroot:
self.info("Fixing absolute paths in symbolic links inside lib directory...")
self.fix_symlinks()
# create an archive to make it easier to copy the sysroot to another machine
self.delete_file(self.sysroot_archive, print_verbose_only=True)
self.run_cmd("tar", "-caf", self.sysroot_archive, self.cross_sysroot_path.name,
Expand Down

0 comments on commit 2a0c1c9

Please sign in to comment.