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

dnsdist: Fix compilation on OpenBSD/amd64 #9346

Merged
merged 1 commit into from Jul 28, 2020

Conversation

omoerbeek
Copy link
Member

@omoerbeek omoerbeek commented Jul 20, 2020

Due to some yet undiagnosed interaction of the standard and boost include
files, we hit a syntax error when compiling the boost uuid code on
OpenBSD. This is fixed by using -std=gnu++11. This only happens
when compiling dnsdist.cc. In other places compiling uuid-utils.hh
with -std=c++11 does not trigger an error.

The erorr is:

In file included from dnsdist.cc:39:
In file included from ./uuid-utils.hh:24:
In file included from /usr/local/include/boost/uuid/uuid.hpp:203:
In file included from /usr/local/include/boost/uuid/detail/uuid_x86.ipp:22:
In file included from /usr/lib/clang/8.0.1/include/emmintrin.h:27:
In file included from /usr/lib/clang/8.0.1/include/xmmintrin.h:27:
/usr/lib/clang/8.0.1/include/mmintrin.h:81:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);

Looking at the preprocessed source the __attribute__((__vector_size__(16))) was lost in the declaration of __v4si

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
  • checked that this code was merged to master

@omoerbeek
Copy link
Member Author

omoerbeek commented Jul 21, 2020

Found the offending line in /usr/include/readline/rlstdc.h:

#ifndef __attribute__
#  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
#    define __attribute__(x)
#  endif
#endif

This kills vector ops... better diff than above forthcoming

@omoerbeek omoerbeek force-pushed the dnsdist-openbsd-clang-std branch 2 times, most recently from d3fc4d3 to 72ef37a Compare Jul 21, 2020
The readline lib on OpenBSD redefines __attribute__ to empty if __STRICT_ANSI__...
@omoerbeek omoerbeek force-pushed the dnsdist-openbsd-clang-std branch from 72ef37a to 59c4dea Compare Jul 21, 2020
@omoerbeek omoerbeek requested a review from rgacogne Jul 27, 2020
@rgacogne rgacogne merged commit 3b6a1bc into PowerDNS:master Jul 28, 2020
28 of 29 checks passed
@omoerbeek omoerbeek deleted the dnsdist-openbsd-clang-std branch Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants