Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ShellB3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ray Garcia
ShellB3
Commits
09625ca7
Commit
09625ca7
authored
4 years ago
by
Joe Garcia
Browse files
Options
Downloads
Patches
Plain Diff
sysroot shared
parent
e4122fd3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ShellB3/sb3bin/thosewhohuntelfs.py
+12
-6
12 additions, 6 deletions
ShellB3/sb3bin/thosewhohuntelfs.py
with
12 additions
and
6 deletions
ShellB3/sb3bin/thosewhohuntelfs.py
+
12
−
6
View file @
09625ca7
...
...
@@ -24,6 +24,7 @@ import platform
import
shutil
LOG
=
logging
.
getLogger
(
__name__
)
sysroot
=
"
/
"
# options go here as attributes
OPTS
=
None
...
...
@@ -162,7 +163,7 @@ def fullrealpath(path,rpaths,loader,executable=None):
return
fullrealpath_single
(
path
,
rpaths
,
os
.
path
.
dirname
(
loader
),
executable
)
if
len
(
rpaths
)
==
0
:
rpaths
=
[
os
.
getcwd
()]
for
p
in
rpaths
+
[
os
.
getenv
(
'
SYSROOT
'
,
'
/
'
)
,
os
.
getcwd
()]:
for
p
in
rpaths
+
[
sysroot
,
os
.
getcwd
()]:
r
=
fullrealpath_single
(
path
,
asUnicode
(
p
),
os
.
path
.
dirname
(
loader
),
executable
)
if
os
.
path
.
exists
(
r
):
return
r
...
...
@@ -441,7 +442,7 @@ def probe(base,forbiddenlibs=''):
forbiddenlibs
.
append
(
f
)
printerr
(
'
Forbidden libs are {}
'
.
format
(
'
,
'
.
join
(
forbiddenlibs
)))
fullbase
=
os
.
path
.
realpath
(
base
)
sysroot
=
os
.
getenv
(
'
SYSROOT
'
,
''
)
use
sysroot
=
sysroot
#
os.getenv('SYSROOT','')
for
path
in
hunt_elfs
(
base
,
elvish
=
elvish
):
if
elvish
:
print
(
path
+
"
=> {}
"
.
format
(
printable_rpath
(
path
))),
...
...
@@ -463,8 +464,8 @@ def probe(base,forbiddenlibs=''):
elif
lib
.
startswith
(
'
/
'
):
li
=
lib
dli
=
li
if
len
(
sysroot
)
>
1
:
li
=
sysroot
+
li
if
len
(
use
sysroot
)
>
1
:
li
=
use
sysroot
+
li
dli
=
li
if
int
(
os
.
getenv
(
"
SDKDARWINVERNUMBER
"
))
>=
15
:
#these SDKs don't store dylibs but "tdb" files
if
li
.
endswith
(
'
.dylib
'
):
...
...
@@ -475,7 +476,7 @@ def probe(base,forbiddenlibs=''):
dli
=
li
if
dli
.
startswith
(
fullbase
):
dli
=
dli
.
replace
(
fullbase
,
'
[ShellB3]:
'
)
if
len
(
sysroot
)
>
1
and
dli
.
startswith
(
sysroot
):
if
len
(
use
sysroot
)
>
1
and
dli
.
startswith
(
use
sysroot
):
def
macVer
(
v
):
vparts
=
v
.
replace
(
'
*
'
,
''
).
split
(
'
.
'
)
vv
=
int
(
vparts
[
0
])
...
...
@@ -487,7 +488,7 @@ def probe(base,forbiddenlibs=''):
if
iv
<=
11
:
return
"
OS X
"
+
v
return
"
macOS
"
+
v
dli
=
dli
.
replace
(
sysroot
,
'
[
'
+
macVer
(
os
.
getenv
(
'
MACOSX_DEPLOYMENT_TARGET
'
))
+
'
]:
'
)
dli
=
dli
.
replace
(
use
sysroot
,
'
[
'
+
macVer
(
os
.
getenv
(
'
MACOSX_DEPLOYMENT_TARGET
'
))
+
'
]:
'
)
if
os
.
access
(
li
,
os
.
R_OK
):
print
(
'
{} => {}
'
.
format
(
lib
,
dli
))
for
l
in
forbiddenlibs
:
...
...
@@ -644,6 +645,8 @@ python thosewhohuntelfs.py . common/lib lib --exclude='.*?build/.*' --dry-run --
help
=
'
comma-separated library prefixes (e.g.
"
libxxx,libyyy
"
) that are absolutely forbidden to be linked to (for legacy or known incompatibility)
'
)
parser
.
add_option
(
'
--rpaths
'
,
dest
=
'
list_rpaths
'
,
default
=
False
,
action
=
"
store_true
"
,
help
=
'
just list rpaths of named files
'
)
parser
.
add_option
(
'
--sysroot
'
,
dest
=
"
sysroot
"
,
default
=
os
.
getenv
(
'
SYSROOT
'
,
'
/
'
),
help
=
"
set the system root, to match up system libraries
"
)
# parser.add_option('-I', '--include-path', dest="includes",
# action="append", help="include path to append to GCCXML call")
...
...
@@ -674,6 +677,9 @@ python thosewhohuntelfs.py . common/lib lib --exclude='.*?build/.*' --dry-run --
OPTS
.
install_name_tool
=
os
.
path
.
abspath
(
OPTS
.
install_name_tool
)
assert
(
os
.
path
.
exists
(
OPTS
.
install_name_tool
))
global
sysroot
sysroot
=
options
.
sysroot
if
not
args
:
parser
.
error
(
'
incorrect arguments, try -h or --help.
'
)
return
9
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment