From 4cea9de295fcb982a6d92fc424f3b37781d4d1c5 Mon Sep 17 00:00:00 2001 From: Luis Lozano Date: Wed, 20 Mar 2013 12:32:56 -0700 Subject: Copy gcc libs directory to sysroot after build. Tools like crosperf look for the gcc libraries under the sysroot. Also fixed a mino issue when using --gcc_dir and other *_dir options when the directory given does not exist. BUG=None TEST=Build toolchain and verified the libraries are copied to the correct place. Verified that the *_dir options check for existance of dir given Change-Id: I61599db2843d5bdbbc479164a8f05c722f9f7e75 Reviewed-on: https://gerrit-int.chromium.org/34153 Reviewed-by: Yunlian Jiang Reviewed-by: Caroline Tice Commit-Queue: Luis Lozano Tested-by: Luis Lozano --- build_tc.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build_tc.py') diff --git a/build_tc.py b/build_tc.py index 0c009b3a..02918b68 100755 --- a/build_tc.py +++ b/build_tc.py @@ -151,7 +151,14 @@ class ToolchainPart(object): env_string = " ".join(["%s=\"%s\"" % var for var in env.items()]) command = "emerge =cross-%s/%s-9999" % (self._ctarget, self._name) full_command = "sudo %s %s" % (env_string, command) - return self._ce.ChrootRunCommand(self._chromeos_root, full_command) + rv = self._ce.ChrootRunCommand(self._chromeos_root, full_command) + if rv != 0: + return rv + if self._name == "gcc": + command = ("sudo cp -r /usr/lib/gcc/%s /build/%s/usr/lib/gcc/." % + (self._ctarget, self._board)) + rv = self._ce.ChrootRunCommand(self._chromeos_root, command) + return rv def MoveMaskFile(self): self._new_mask_file = None @@ -253,10 +260,13 @@ def Main(argv): chromeos_root = misc.CanonicalizePath(options.chromeos_root) if options.gcc_dir: gcc_dir = misc.CanonicalizePath(options.gcc_dir) + assert gcc_dir and os.path.isdir(gcc_dir), "gcc_dir does not exist!" if options.binutils_dir: binutils_dir = misc.CanonicalizePath(options.binutils_dir) + assert os.path.isdir(binutils_dir), "binutils_dir does not exist!" if options.gdb_dir: gdb_dir = misc.CanonicalizePath(options.gdb_dir) + assert os.path.isdir(gdb_dir), "gdb_dir does not exist!" if options.unmount_only: options.mount_only = False elif options.mount_only: -- cgit v1.2.3