[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mklibs patch: fix invalid library search path



On 2013年01月11日 02:45, Joe Seymour wrote:
>> If mklibs is called with both --root and --sysroot specified, and> for a library found in rpath, mklibs searches this library in
>> <sysroot>/<root>/<rpath> which is an invalid path.  Since <root>
>> already points to an absolute directory on host, we should not
>> add <sysroot> prefix to it.  Here is a mklibs patch for this issue.
>>
>> Lei
>>
>>
>> * Fix invalid search path for rpath libraries
>>
>> diff --git a/src/mklibs b/src/mklibs
>> index ef15147..71ef4da 100755
>> --- a/src/mklibs
>> +++ b/src/mklibs
>> @@ -233,6 +233,9 @@ def find_lib(lib):
>>      for path in lib_path:
>>          if os.access(sysroot + path + "/" + lib, os.F_OK):
>>              return sysroot + path + "/" + lib
>> +    for path in lib_rpath:
>> +        if os.access(path + "/" + lib, os.F_OK):
>> +            return path + "/" + lib
>>
>>      return ""
>>
>> @@ -447,8 +450,6 @@ for obj in objects.values():
>>          else:
>>              print "warning: " + obj + " may need rpath, but --root not specified"
>>
>> -lib_path.extend(lib_rpath)
>> -
>>  passnr = 1
>>  available_libs = []
>>  previous_pass_unresolved = set()
> 
> Perhaps I've missed something... There are other uses of lib_path in mklibs not
> adjusted by this patch. Those will no longer see any rpaths, so you've
> changed the set of paths handled at various points, is that intentional?

No, it was my overlook.  Your patch looks more reasonable.

Thanks.
Lei


Reply to: