rpath $ORIGIN doc

This commit is contained in:
Michael Davidsaver
2019-06-24 10:35:25 -07:00
parent f5194b2274
commit 87d5ca1619
2 changed files with 11 additions and 3 deletions

View File

@@ -172,7 +172,7 @@ GCC_PIPE = NO
# Must be either YES, NO, or ORIGIN. If you set this to NO you must also provide a
# way for Base executables to find their shared libraries when they are
# run at build-time, e.g. set the LD_LIBRARY_PATH environment variable.
# ORIGIN is Linux specific.
# ORIGIN is a feature of the ELF executable format used by Linux, freebsd, and solaris.
LINKER_USE_RPATH = YES
# Only used when LINKER_USE_RPATH=ORIGIN

View File

@@ -10,9 +10,17 @@ from argparse import ArgumentParser
if os.environ.get('EPICS_DEBUG_RPATH','')=='YES':
sys.stderr.write('%s'%sys.argv)
P = ArgumentParser()
P = ArgumentParser(description='''Compute and output -rpath entries for each of the given paths.
Paths under --root will be computed as relative to --final .''',
epilog='''
eg. A library to be placed in /build/lib and linked against libraries in
'/build/lib', '/build/module/lib', and '/other/lib' would pass:
"makeRPath.py -F /build/lib -R /build /build/lib /build/module/lib /other/lib"
which prints "-Wl,-rpath,$ORIGIN/. -Wl,-rpath,$ORIGIN/../module/lib -Wl,-rpath,/other/lib"
''')
P.add_argument('-F','--final',default=os.getcwd(), help='Final install location for ELF file')
P.add_argument('-R','--root',default='/')
P.add_argument('-R','--root',default='/', help='Root of relocatable tree.')
P.add_argument('-O', '--origin', default='$ORIGIN')
P.add_argument('path', nargs='*')
args = P.parse_args()