Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
smol
Commits
a2e2e8f5
Commit
a2e2e8f5
authored
May 17, 2019
by
PoroCYon
Committed by
PoroCYon
May 18, 2019
Browse files
try to fix gcc printing localized search dir keys
parent
987bbab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/smolparse.py
View file @
a2e2e8f5
...
@@ -71,15 +71,30 @@ def get_needed_syms(readelf_bin, inpfiles):
...
@@ -71,15 +71,30 @@ def get_needed_syms(readelf_bin, inpfiles):
return
syms
#, needgot
return
syms
#, needgot
def
format_cc_path_line
(
entry
):
category
,
path
=
entry
.
split
(
': '
,
1
)
path
=
path
.
lstrip
(
'='
)
return
(
category
,
list
(
set
(
os
.
path
.
realpath
(
p
)
\
for
p
in
path
.
split
(
':'
)
if
os
.
path
.
isdir
(
p
))))
def
get_cc_paths
(
cc_bin
):
def
get_cc_paths
(
cc_bin
):
bak
=
os
.
environ
.
copy
()
os
.
environ
[
'LANG'
]
=
"C"
# DON'T output localized search dirs!
output
=
subprocess
.
check_output
([
cc_bin
,
'-print-search-dirs'
],
output
=
subprocess
.
check_output
([
cc_bin
,
'-print-search-dirs'
],
stderr
=
subprocess
.
DEVNULL
)
stderr
=
subprocess
.
DEVNULL
)
paths
=
{}
os
.
environ
=
bak
for
entry
in
output
.
decode
(
'utf-8'
).
splitlines
():
category
,
path
=
entry
.
split
(
': '
,
1
)
outputpairs
=
list
(
map
(
format_cc_path_line
,
path
=
path
.
lstrip
(
'='
)
output
.
decode
(
'utf-8'
).
splitlines
()))
paths
[
category
]
=
list
(
set
(
os
.
path
.
realpath
(
p
)
\
for
category
,
path
in
outputpairs
:
paths
[
category
]
=
path
for
p
in
path
.
split
(
':'
)
if
os
.
path
.
isdir
(
p
)))
if
'libraries'
not
in
paths
:
# probably localized... sigh
# monkeypatch, assuming order...
paths
=
{}
paths
[
'install'
]
=
outputpairs
[
0
][
1
]
paths
[
'programs'
]
=
outputpairs
[
1
][
1
]
paths
[
'libraries'
]
=
outputpairs
[
2
][
1
]
return
paths
return
paths
def
is_valid_elf
(
f
):
def
is_valid_elf
(
f
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment