-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial gcc toolchain configuration for the lowRISC compiler. #1
Conversation
Things to discuss:
|
) | ||
if architecture == 'rv32imc': | ||
# TODO(cfrantz): why do I have to do this? Seems the lowRISC gcc | ||
# doesn't support `-mfpu`, `-mfloat-abi` or `-mlittle-endian`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-mlittle-endian
should work (at least it should if we update gcc). AFAICT the other flags are arm specific and aren't defined for other targets. The flag definitions should probably be moved into arch-specific code.
constraints/cpu/BUILD
Outdated
constraint_value( | ||
# Based on the current riscv64 consrtaint in platforms, I wonder | ||
# if this should be `riscv32` or `rv32imc`. | ||
name = "rv32imc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaning towards keeping rv32imc
. It looks like the generic arm
target is slated for removal and there are a bunch of more specific 32-bit arm targets. riscv64
is probably geared towards the non-embedded use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on bazelbuild/platforms#30, riscv32
is the appropriate high-level cpu descriptor. In fact, the change has already been applied by Google's copybara automation to Google internal copy of the platforms
repo.
To be consistent with bazelbuild/platforms#30, I've renamed the cpu to |
I think we should commit this change as-is to move the bazel work foward. I have opened https://github.com/silvergasp/bazel-embedded/issues/37 with upstream to try to get feedback on the proper approach to integrating compiler/feature flags into a "user-serviceable" part of the bazel-embedded repo. Until we have that understanding, its fine to live with the |
SGTM. Feel free to commit this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of format nits. I'm going to assume Michael's LGTM is good enough. =)
"defs.bzl", | ||
""" | ||
SYSTEM_INCLUDE_COMMAND_LINE = {} | ||
SYSTEM_INCLUDE_PATHS= {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after the = sign? =P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. These two formatting errors also exist in the file I copied this from (gcc_arm_none_repository.bzl
)
""" | ||
filegroup( | ||
name = "all", | ||
srcs = glob(["**/*"],exclude=["**/*.html","**/*.pdf"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after the , too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Configure lowrisc_toolchain_rv32imc for use by the OpenTitan project. Signed-off-by: Chris Frantz <cfrantz@google.com>
1. Deliver per-device flags to the GccEmbeddedFeatures function. 2. Turn off some per-feature compiler/linker flags. Need to find a better way to do this. Signed-off-by: Chris Frantz <cfrantz@google.com>
This naming is consistent with bazel's `platforms` which names high-level cpu architectures but not architecture details or cpu features. Signed-off-by: Chris Frantz <cfrantz@google.com>
) Initial toolchain definition for riscv32 1. Configure lowrisc_toolchain_rv32imc for use by the OpenTitan project. 2. Deliver per-device flags to the GccEmbeddedFeatures function. 3. Turn off some per-feature compiler/linker flags. Need to find a better way to do this. Signed-off-by: Chris Frantz <cfrantz@google.com>
) Initial toolchain definition for riscv32 1. Configure lowrisc_toolchain_rv32imc for use by the OpenTitan project. 2. Deliver per-device flags to the GccEmbeddedFeatures function. 3. Turn off some per-feature compiler/linker flags. Need to find a better way to do this. Signed-off-by: Chris Frantz <cfrantz@google.com>
Configure lowrisc_toolchain_rv32imc for use by the OpenTitan project.