meson options - build vs target machine cpuflags question

Dan Gora dg at adax.com
Fri Mar 11 01:00:48 CET 2022


On Thu, Mar 10, 2022 at 8:39 PM Sanford, Robert <rsanford at akamai.com> wrote:
>
> Hi Dan,
> Thanks for the response. It is a lot of work and patience to get a change accepted. I admire all the guys who do it on a regular basis.
>
> My problem turns out to be twofold: 1) Build machine has a CPU flag that the target does not have, and I was building "native".
> 2) Since I was building native, I was enabling RDSEED instructions even though the CPU doesn't support them. Fortunately, getentropy(3) works in our env.
>
> I found the answer, by digging into the meson.build files, especially in config/ and config/x86/, and the resulting files created in the build dir.
> Passing -Dplatform=haswell to meson did almost nothing AFAICS, still "native".
> When I switch to -Dmachine=haswell, it has the desired effect on both build.ninja (generating -march=haswell for gcc)
> and rte_build_config.h (disabling RDSEED).

yeah I recall that the meson makefiles had a couple of changes that
needed to be done.  The patch worked by compiling the code with the
RDSEED instructions regardless of whether or not the build platform
supported them, but then checking the CPU flags at run time to see if
it could be accessed or not.  But that should work too, you just can't
access RDSEED on platforms which support it, but whatever..
getentropy() will work.

thanks
dan


More information about the users mailing list