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

Stop using fixlinks tool during sysroot installation #371

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
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
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