-
Notifications
You must be signed in to change notification settings - Fork 446
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
Strange build dependencies from Tofino backend #5013
Comments
If I'd wager a guess it might be because of the Tofino IR sources: https://github.com/p4lang/p4c/blob/main/backends/tofino/CMakeLists.txt#L219 which need to be compile with the ir-generated blob. |
But looks like these are not entirely frontend... |
Yeah I also think they could be cleaned up. There includes are quite messy and there are some circular dependencies. |
The way the code is set up, it builds IR Visitor infrastructure as part of the frontend, supporting all IR types that are declared in any backend that is enabled in the build as part of the frontend. That ends up pulling a few backend files (those related to the IR types) into the frontend, and is required due C++ ODR requirements (otherwise you would get undefined behavior by linking code that doesn't agree on the vtable layout for classes like IR::Node). To not include this backend code, you need to use |
But are files like |
No, but disentangling them is likely to require splitting some source files to only include the minimum to get things to build while not including other things that pull in more dependencies. |
Building e.g. a
frontend
target actually builds Tofino backend, which does not look correct to me.The text was updated successfully, but these errors were encountered: