def CopyLibGccLibrary(cls): # Find the correct path for libgcc libgcc_filename = "libgcc_s.so" libgcc_filename_main = libgcc_filename + ".1" # check for gcc-config cmd = 'whereis gcc-config | cut -d " " -f 2' res = Tools.Run(cmd) if res: # Try gcc-config cmd = "gcc-config -L | cut -d ':' -f 1" res = Tools.Run(cmd) if res: # Use path from gcc-config libgcc_path = res[0] + "/" + libgcc_filename_main Tools.SafeCopy(libgcc_path, var.llib64) os.chdir(var.llib64) os.symlink(libgcc_filename_main, libgcc_filename) return # Doing a 'whereis <name of libgcc library>' will not work because it seems # that it finds libraries in /lib, /lib64, /usr/lib, /usr/lib64, but not in # /usr/lib/gcc/ (x86_64-pc-linux-gnu/5.4.0, etc) # When a better approach is found, we can plug it in here directly and return # in the event that it succeeds. If it fails, we just continue execution # until the end of the function. # If we've reached this point, we have failed to copy the gcc library. Tools.Fail("Unable to retrieve the gcc library path!")
def CopyLibGccLibrary(cls): """Copy the 'libgcc' library so that when libpthreads loads it during runtime.""" # https://github.com/zfsonlinux/zfs/issues/4749. # Find the correct path for libgcc libgccFilename = "libgcc_s.so" libgccFilenameMain = libgccFilename + ".1" # check for gcc-config gccConfigPath = Tools.GetProgramPath("gcc-config") if gccConfigPath: # Try gcc-config cmd = "gcc-config -L | cut -d ':' -f 1" res = Tools.Run(cmd) if res: # Use path from gcc-config libgccPath = res[0] + "/" + libgccFilenameMain Tools.SafeCopy(libgccPath, var.GetTempLib64Dir()) os.chdir(var.GetTempLib64Dir()) os.symlink(libgccFilenameMain, libgccFilename) return # Doing a 'whereis <name of libgcc library>' will not work because it seems # that it finds libraries in /lib, /lib64, /usr/lib, /usr/lib64, but not in # /usr/lib/gcc/ (x86_64-pc-linux-gnu/5.4.0, etc) # When a better approach is found, we can plug it in here directly and return # in the event that it succeeds. If it fails, we just continue execution # until the end of the function. # If we've reached this point, we have failed to copy the gcc library. Tools.Fail("Unable to retrieve the gcc library path!")
def CopyLibGccLibrary(cls): cmd = "gcc-config -L | cut -d ':' -f 1" res = Tools.Run(cmd) if len(res) < 1: Tools.Fail("Unable to retrieve gcc library path!") libgcc_filename = "libgcc_s.so" libgcc_filename_main = libgcc_filename + ".1" libgcc_path = res[0] + "/" + libgcc_filename_main Tools.SafeCopy(libgcc_path, var.llib64) os.chdir(var.llib64) os.symlink(libgcc_filename_main, libgcc_filename)