It should work ok for the "main" case since this function is used for
both cases.  In practice, the compiler executables do not reference
the libraries; the executables are built first and then used to
compile the libraries.

For testing, I built the patched compiler with BUILD_COMPILER=GNU and
then used that compiler to do a separate build with
BUILD_COMPILER=OSP.  For both compilers I did testing after deleting
the build area to make sure that the original problem was fixed.

On Thu, Oct 21, 2010 at 10:53 PM, Sun Chan <sun.c...@gmail.com> wrote:
> so only main of the compiler should have RPATH set, not the .so's.
> Now, how does your fix deal with the case when the build is "main"?
> Sun
>
> On Thu, Oct 21, 2010 at 8:43 PM, David Coakley <dcoak...@gmail.com> wrote:
>> The run_build flag is set by the '--run-build' command-line option and
>> allows the compiler to run from the build directory.  It's used during
>> the compiler build so that the libraries can be built before the
>> compiler is installed.
>>
>> See osprey/linux/gcommondefs for the use of the option and the
>> top-level Makefile.in to see where BUILD_COMPILER=SELF is set for the
>> LIB_ARGS and LIB2_ARGS.
>>
>> On Thu, Oct 21, 2010 at 7:56 PM, Sun Chan <sun.c...@gmail.com> wrote:
>>> can you give some detail how run_build is set? I agree with you on
>>> principle the fix.
>>> Sun
>>>
>>> On Thu, Oct 21, 2010 at 7:49 PM, David Coakley <dcoak...@gmail.com> wrote:
>>>> In the Open64 driver, there is code to add a linker '-rpath' option
>>>> for libraries that are included with the compiler (see
>>>> postprocess_ld_args() in the driver).  The intended effect of this
>>>> code is that programs compiled by Open64 can be run without setting
>>>> LD_LIBRARY_PATH as long as the compiler installation directory still
>>>> exists.  The embedded RPATH in the executable acts as a default
>>>> location to find the shared objects.
>>>>
>>>> We ran into a small problem: for shared objects that are part of the
>>>> compiler build, the RPATH is also set.  This could cause the runtime
>>>> linker to look in the compiler build directory for an
>>>> indirectly-included shared object (e.g. libacml_mv.so is included by
>>>> libmv.so).  If the build directory no longer existed, the library
>>>> would not be found.
>>>>
>>>> One way to fix the problem is just to skip the code that adds '-rpath'
>>>> when we are building the compiler's libraries.  I include a patch
>>>> below that does that.
>>>>
>>>> Can a gatekeeper review the patch?  Thanks,
>>>>
>>>> -David Coakley / AMD Open Source Compiler Engineering
>>>>
>>>>
>>>>
>>>> ===================================================================
>>>> --- osprey/driver/phases.c      (revision 3379)
>>>> +++ osprey/driver/phases.c      (working copy)
>>>> @@ -2315,6 +2315,13 @@
>>>>     }
>>>>
>>>>     /*
>>>> +     * When building the compiler's libraries, do not append any rpath
>>>> +     * options since these would reference the build directory.
>>>> +     */
>>>> +    if (run_build)
>>>> +        return;
>>>> +
>>>> +    /*
>>>>      * For some reason, our cross linker won't find libraries in some
>>>>      * directories unless it's told about them with -rpath-link.
>>>>      * Here, we scan all -L flags and pass them as -rpath-link flags,
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Nokia and AT&T present the 2010 Calling All Innovators-North America 
>>>> contest
>>>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>>>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in 
>>>> marketing
>>>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>>>> http://p.sf.net/sfu/nokia-dev2dev
>>>> _______________________________________________
>>>> Open64-devel mailing list
>>>> Open64-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/open64-devel
>>>>
>>>
>>
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to