Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
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
pub
frama-c
Commits
e047e11e
Commit
e047e11e
authored
2 years ago
by
Virgile Prevosto
Committed by
Andre Maroneze
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[machdep] Support passing several arch flags to the compiler
parent
419dd697
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
share/machdeps/make_machdep/make_machdep.py
+10
-4
10 additions, 4 deletions
share/machdeps/make_machdep/make_machdep.py
with
10 additions
and
4 deletions
share/machdeps/make_machdep/make_machdep.py
+
10
−
4
View file @
e047e11e
...
@@ -67,27 +67,33 @@ parser.add_argument("--compiler", default="cc", help="which compiler to use; def
...
@@ -67,27 +67,33 @@ parser.add_argument("--compiler", default="cc", help="which compiler to use; def
parser
.
add_argument
(
parser
.
add_argument
(
"
--compiler-version
"
,
"
--compiler-version
"
,
default
=
"
--version
"
,
default
=
"
--version
"
,
help
=
"
option to pass to the compiler to obtain its version; default is --version
"
help
=
"
option to pass to the compiler to obtain its version; default is --version
"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"
--cpp-arch-flags
"
,
"
--cpp-arch-flags
"
,
nargs
=
"
+
"
,
nargs
=
"
+
"
,
default
=
[]
,
action
=
"
extend
"
,
help
=
"
architecture-specific flags needed for preprocessing, e.g.
'
-m32
'"
,
help
=
"
architecture-specific flags needed for preprocessing, e.g.
'
-m32
'"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"
--compiler-flags
"
,
"
--compiler-flags
"
,
nargs
=
"
+
"
,
nargs
=
"
+
"
,
default
=
[
"
-c
"
],
action
=
"
extend
"
,
type
=
str
,
help
=
"
flags to be given to the compiler (other than those set by --cpp-arch-flags); default is
'
-c
'"
,
help
=
"
flags to be given to the compiler (other than those set by --cpp-arch-flags); default is
'
-c
'"
,
)
)
parser
.
add_argument
(
"
--check
"
,
action
=
"
store_true
"
)
parser
.
add_argument
(
"
--check
"
,
action
=
"
store_true
"
)
args
,
other_args
=
parser
.
parse_known_args
()
args
,
other_args
=
parser
.
parse_known_args
()
if
not
args
.
compiler_flags
:
args
.
compiler_flags
=
[
"
-c
"
]
def
print_machdep
(
machdep
):
def
print_machdep
(
machdep
):
json
.
dump
(
machdep
,
args
.
dest_file
,
indent
=
4
,
sort_keys
=
True
)
json
.
dump
(
machdep
,
args
.
dest_file
,
indent
=
4
,
sort_keys
=
True
)
def
check_machdep
(
machdep
):
def
check_machdep
(
machdep
):
try
:
try
:
from
jsonschema
import
validate
,
ValidationError
from
jsonschema
import
validate
,
ValidationError
...
@@ -232,7 +238,7 @@ version_output = subprocess.run(
...
@@ -232,7 +238,7 @@ version_output = subprocess.run(
version
=
version_output
.
stdout
.
splitlines
()[
0
]
version
=
version_output
.
stdout
.
splitlines
()[
0
]
machdep
[
"
compiler
"
]
=
args
.
compiler
machdep
[
"
compiler
"
]
=
args
.
compiler
machdep
[
"
cpp_arch_flags
"
]
=
'
'
.
join
(
args
.
cpp_arch_flags
)
machdep
[
"
cpp_arch_flags
"
]
=
"
"
.
join
(
args
.
cpp_arch_flags
)
machdep
[
"
version
"
]
=
version
machdep
[
"
version
"
]
=
version
missing_fields
=
[
f
for
[
f
,
v
]
in
machdep
.
items
()
if
v
is
None
]
missing_fields
=
[
f
for
[
f
,
v
]
in
machdep
.
items
()
if
v
is
None
]
...
...
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