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

cross-compile problems in generators #58

Open
teverman opened this issue Nov 10, 2016 · 4 comments
Open

cross-compile problems in generators #58

teverman opened this issue Nov 10, 2016 · 4 comments
Assignees

Comments

@teverman
Copy link
Contributor

Cross-compiling for PPC on x86, pi_gen_fe_defines can't execute because it's compiled for the target environment instead of the build host.

../generators/pi_gen_fe_defines: line 117: /generators/.libs/lt-pi_gen_fe_defines: cannot execute binary file: Exec format error

@antoninbas antoninbas added the bug label Nov 10, 2016
@antoninbas antoninbas self-assigned this Nov 10, 2016
@antoninbas
Copy link
Member

This binary is run as part of the make to compile examples only. As a result the solution is probably to do one of the following:

  1. exclude them from the build when we are cross-compiling (pretty sure we can detect that in configure.ac)
  2. remove them from the automake build and use a separate Makefile for people to compile the examples if they wish (this Makefile will assume that the PI binaries are installed on the system doing the compilation)
  3. compile the examples as part of the "make check" instead. This would make sense I think because "make check" cannot be run when cross-compiling.
    Right now I'm hesitating between 2) and 3). I may go with 3) now for the sake of time, with 2) potentially being a better long term solution.

@teverman
Copy link
Contributor Author

Thanks Antonin.

I think we owe you a sorting out of PI from our perspective of:

  1. What parts we need in common for all platforms, which need to be
    cross-compiled.
  2. What additional parts we need for running in a "full P4" environment,
    i.e. the soft switch or a Tofino platform. Some of these probably don't
    need cross-compiling. For example, when we cross-compile a platform,
    with-bmv2 is off, but when I compile in a mininet VM, with-bmv2 is on.
  3. Things the controller needs that aren't in 1 or 2, if any.
  4. Anything left that we don't need.

I should be in a better position to do this in a few days.

Tom

On Thu, Nov 10, 2016 at 9:16 AM, Antonin Bas notifications@github.com
wrote:

This binary is run as part of the make to compile examples only. As a
result the solution is probably to do one of the following:

  1. exclude them from the build when we are cross-compiling (pretty sure we
    can detect that in configure.ac)
  2. remove them from the automake build and use a separate Makefile for
    people to compile the examples if they wish (this Makefile will assume that
    the PI binaries are installed on the system doing the compilation)
  3. compile the examples as part of the "make check" instead. This would
    make sense I think because "make check" cannot be run when cross-compiling.
    Right now I'm hesitating between 2) and 3). I may go with 3) now for the
    sake of time, with 2) potentially being a better long term solution.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#58 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQmy08lvy1naIhlWJc114tSoHM9qPasKks5q81FegaJpZM4Ku5XQ
.

@antoninbas
Copy link
Member

That would be nice to have, but then again it's not very hard for me to have a rough idea of what falls into each category.
For this specific issue you raised, this binary is only used to compile examples, so it's pretty safe for me to disable it.

antoninbas added a commit that referenced this issue Nov 10, 2016
This snippets were compiled unconditionally which was a problem for
cross-compilation scenarios (see #58).
antoninbas added a commit that referenced this issue Nov 11, 2016
* Only compile example snippets for make check

This snippets were compiled unconditionally which was a problem for
cross-compilation scenarios (see #58).

* Remove deprecated comment in Makefile
@antoninbas
Copy link
Member

Went for 3) for not. Leaving this open in case I want to do 2) later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants