Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720818 - meson.eclass: recent commits break cross-compiling
Summary: meson.eclass: recent commits break cross-compiling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-03 14:55 UTC by David Michael
Modified: 2020-05-03 17:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross file (meson.armv7a-gentoo-linux-gnueabihf.arm.ini,1.63 KB, text/plain)
2020-05-03 15:07 UTC, David Michael
Details
native file (meson.x86_64-pc-linux-gnu.arm.ini,971 bytes, text/plain)
2020-05-03 15:08 UTC, David Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-05-03 14:55:57 UTC
Since https://github.com/gentoo/gentoo/commit/ef894cec8dee3758cfde620b87d10b2774419cdf , running meson configured for cross-compiling will use CFLAGS on the native host compiler, which prevents it from running.

Reproducible: Always

Steps to Reproduce:
1. emerge -v xorg-proto  # with a cross-compiling profile using -mcpu etc.
Actual Results:  
The Meson build system
Version: 0.52.1
Source dir: /var/tmp/portage/x11-libs/libxkbcommon-0.10.0/work/libxkbcommon-0.10.0
Build dir: /var/tmp/portage/x11-libs/libxkbcommon-0.10.0/work/libxkbcommon-0.10.0-.arm
Build type: cross build
Project name: libxkbcommon
Project version: 0.10.0
Appending CFLAGS from environment: '-O2 -pipe -ggdb -flto=jobserver -march=armv7ve+simd -mtune=cortex-a17 -mfpu=neon-vfpv4 -ftree-vectorize'
Appending LDFLAGS from environment: ['-Wl,-O1', '-Wl,--as-needed']

meson.build:1:0: ERROR: Compiler x86_64-pc-linux-gnu-gcc can not compile programs.

Expected Results:  
It should build and install properly like it did a day ago.

Here is a meson-log.txt:

Build started at 2020-05-03T10:52:18.798934
Main binary: /usr/bin/python3.6
Build Options: -Dprefix=/usr -Dlibdir=lib -Dlocalstatedir=/var/lib -Dsysconfdir=/etc -Dbuildtype=plain -Dwrap_mode=nodownload -Dbuild.pkg_config_path=/usr/share/pkgconfig -Dpkg_config_path=/usr/share/pkgconfig '--cross-file /var/tmp/portage/x11-base/xorg-proto-2019.2/temp/meson.armv7a-gentoo-linux-gnueabihf.arm.ini' '--native-file /var/tmp/portage/x11-base/xorg-proto-2019.2/temp/meson.x86_64-pc-linux-gnu.arm.ini'
Python system: Linux
The Meson build system
Version: 0.52.1
Source dir: /var/tmp/portage/x11-base/xorg-proto-2019.2/work/xorgproto-2019.2
Build dir: /var/tmp/portage/x11-base/xorg-proto-2019.2/work/xorg-proto-2019.2-build
Build type: cross build
Project name: xorgproto
Project version: 2019.2
Appending CFLAGS from environment: '-O2 -pipe -ggdb -flto=jobserver -march=armv7ve+simd -mtune=cortex-a17 -mfpu=neon-vfpv4 -ftree-vectorize'
Appending LDFLAGS from environment: ['-Wl,-O1', '-Wl,--as-needed']
No CPPFLAGS in the environment, not changing global flags.
Sanity testing C compiler: x86_64-pc-linux-gnu-gcc
Is cross compiler: False.
Sanity check compiler command line: x86_64-pc-linux-gnu-gcc /var/tmp/portage/x11-base/xorg-proto-2019.2/work/xorg-proto-2019.2-build/meson-private/sanitycheckc.c -o /var/tmp/portage/x11-base/xorg-proto-2019.2/work/xorg-proto-2019.2-build/meson-private/sanitycheckc.exe -O2 -pipe -ggdb -flto=jobserver -march=armv7ve+simd -mtune=cortex-a17 -mfpu=neon-vfpv4 -ftree-vectorize -pipe -D_FILE_OFFSET_BITS=64 -Wl,-O1 -Wl,--as-needed
Sanity check compile stdout:

-----
Sanity check compile stderr:
x86_64-pc-linux-gnu-gcc: error: unrecognized command line option ‘-mfpu=neon-vfpv4’

-----

meson.build:21:0: ERROR: Compiler x86_64-pc-linux-gnu-gcc can not compile programs.
Comment 1 David Michael 2020-05-03 15:07:26 UTC
Created attachment 635844 [details]
cross file
Comment 2 David Michael 2020-05-03 15:08:14 UTC
Created attachment 635846 [details]
native file
Comment 3 Larry the Git Cow gentoo-dev 2020-05-03 15:19:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c8d90f4ac9df93020014604a39cdca6b8356cce

commit 2c8d90f4ac9df93020014604a39cdca6b8356cce
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-05-03 15:18:12 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-05-03 15:18:12 +0000

    meson.eclass: only default BUILD_FLAGS to FLAGS if not cross-compiling
    
    Bug: https://bugs.gentoo.org/720818
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2020-05-03 15:31:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e82b49474c55d7a0d277d3d522fd490c151f7b8

commit 8e82b49474c55d7a0d277d3d522fd490c151f7b8
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-05-03 15:30:17 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-05-03 15:31:05 +0000

    meson.eclass: unset FLAGS before calling meson setup
    
    Bug: https://bugs.gentoo.org/720818
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 3 +++
 1 file changed, 3 insertions(+)
Comment 5 Larry the Git Cow gentoo-dev 2020-05-03 17:28:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d797a28c901c6262835b3a1d29ad8e192e9c1ecd

commit d797a28c901c6262835b3a1d29ad8e192e9c1ecd
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-05-03 17:25:56 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-05-03 17:25:56 +0000

    meson.eclass: use export -n instead of unset
    
    This ensures the variables are still availble if the configure function is
    called more than once, as would happen for a multilib build.
    
    Bug: https://bugs.gentoo.org/720818
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)