[ovs-dev] [PATCH] m4: Fix 32bit build with 64bit version of libunwind-dev installed.

Ilya Maximets i.maximets at ovn.org
Tue Oct 1 16:46:10 UTC 2019


On 01.10.2019 19:17, Ben Pfaff wrote:
> On Tue, Oct 01, 2019 at 02:22:20PM +0300, Ilya Maximets wrote:
>> 32 and 64 bit versions of libunwind-dev package can not be installed
>> at the same time at least in Debian and Ubuntu.  AC_CHECK_LIB macro
>> doesn't know if we have '-m32' in OVS_CFLAGS, so we need to
>> additionally check for actual compiling possibility before enabling
>> the feature.  Otherwise 'make' will fail due to inability to
>> build with 64bit libunwind headers:
>>
>>      https://travis-ci.org/openvswitch/ovs/jobs/590580374
>>
>>      /usr/include/libunwind.h:23:28: fatal error:
>>          libunwind-x86.h: No such file or directory
>>
>> CC: William Tu <u9012063 at gmail.com>
>> Fixes: e2ed6fbeb18c ("fatal-signal: Catch SIGSEGV and print backtrace.")
>> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
> 
> I think there's some confusion here on the use of options.  CFLAGS is
> for the user, OVS_CFLAGS is for the OVS configure script to use itself.
> .cirrus.yml and .travis/linux-build.sh are setting OVS_CFLAGS, but they
> should not because they are the "user", not the configure script.  If
> they set CFLAGS, instead, I believe that there would be no problem here.
> 
> See commit 95626395a3db ("build: Respect CFLAGS and LDFLAGS passed to
> make") and the documentation it references.

That's an interesting point.
However, 'configure' script makes decision about building with libunwind
and it needs to know  if we're going to build 32 or 64 bit binary to
enable or disable the feature. Setting CFLAGS for configure script breaks
it in a following way:

$ CFLAGS='-m32' ./configure
...
checking for gcc... gcc
checking whether the C compiler works... no

I see passing it via OVS_CFLAGS as the only way for automatic detection.
Another option is to introduce '--disable-unwind' option for configure
so, the end user will be responsible for compatibility checking.

Any thoughts?

Best regards, Ilya Maximets.


More information about the dev mailing list