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 detection is too strict #5993

Closed
rossburton opened this issue Oct 3, 2019 · 2 comments
Closed

Cross detection is too strict #5993

rossburton opened this issue Oct 3, 2019 · 2 comments

Comments

@rossburton
Copy link
Contributor

rossburton commented Oct 3, 2019

msetup.py:

        if env.is_cross_build():
            mlog.log('Build type:', mlog.bold('cross build'))
        else:
            mlog.log('Build type:', mlog.bold('native build'))

environment.py:

    def is_cross_build(self) -> bool:
        return not self.machines.matches_build_machine(MachineChoice.HOST)

That logic says that if the build and host machines match then we're not cross compiling, but that's incorrect. If I add some logging to is_cross_build():

| The Meson build system
| Version: 0.51.2
| Source dir: /data/poky-tmp/master/work/corei7-64-poky-linux/systemd/1_243+AUTOINC+efb536d0cb-r0/git
| Build dir: /data/poky-tmp/master/work/corei7-64-poky-linux/systemd/1_243+AUTOINC+efb536d0cb-r0/build
| is_cross_build True
| Build type: cross build
| Project name: systemd
| Project version: 243
| is_cross_build True
| C compiler for the build machine: gcc (gcc 8.3.0 "gcc (Debian 8.3.0-6) 8.3.0")
| C compiler for the host machine: x86_64-poky-linux-gcc -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/data/poky-tmp/master/work/corei7-64-poky-linux/systemd/1_243+AUTOINC+efb536d0cb-r0/recipe-sysroot (gcc 9.2.0 "x86_64-poky-linux-gcc (GCC) 9.2.0")
| is_cross_build False

Once Meson has determined the compilers and it notices that the host machine and the build machine are both x86-64, it doesn't think we're cross building anymore.

0.50.x doesn't have this problem as it just looks for the presence of a cross file to determine whether to be cross or not. But 0.51.x doesn't do that, it simply compares the machines. #4010 by @Ericson2314 appears to be a sort of attempt to sort this out, but it's still broken.

Note that this isn't just a wrong message: once the build isn't cross anymore it stays that way, and builds will break.

@rossburton rossburton changed the title Early cross detection is too strict Cross detection is too strict Oct 4, 2019
@TheQwertiest
Copy link
Contributor

Related(duplicate?): #5724

@rossburton
Copy link
Contributor Author

Yes.

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

No branches or pull requests

2 participants