Skip to content
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

Compile the P4 compiler tools in host configuration #3148

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

chrisdolan
Copy link
Contributor

There's no reason I'm aware of to compile the compilers for the target architecture.

As a side benefit, this may improve the build system's cache hit rate slightly because these tools don't need to be recompiled for Tsan/Asan/Msan/etc let alone x86 vs. ARM vs. etc.

Signed-off-by: Chris Dolan chrisdolan@google.com

There's no reason I'm aware of to compile the compilers for the target architecture.

As a side benefit, this may improve the build system's cache hit rate slightly because these tools don't need to be recompiled for Tsan/Asan/Msan/etc let alone x86 vs. ARM vs. etc.

Signed-off-by: Chris Dolan <chrisdolan@google.com>
Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know nothing about Bazel but I see no problem approving this

@chrisdolan
Copy link
Contributor Author

@mbudiu-vmw I'm happy to explain it further if it helps. But yes, it's pretty trivial. I tested on our copy with Clang's undefined-behavior sanitizer configured for the build -- without this change, the compiler itself is compiled with UBsan (incorrectly) and crashes but with this change the compiler is compiled optimized and runs normally.

Copy link
Member

@smolkaj smolkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Chris!

@mihaibudiu mihaibudiu merged commit bb9f28c into p4lang:main Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants