[SERVER-32649] got "used vector type where scalar is required" when using GCC 7 Created: 10/Jan/18 Updated: 30/Oct/23 Resolved: 16/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.3, 3.7.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Calvin Sze | Assignee: | Mark Benvenuto |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | Linux | ||||
| Backport Requested: |
v3.6
|
||||
| Sprint: | Platforms 2018-01-29 | ||||
| Participants: | |||||
| Description |
|
When compiling Mongo core components on a Power9 with GCC 7 (Advance Toolchain 11.02) The reason of this is that gcc used -DHAVE_X86INTRIN_H which was generated by if conf.CheckCHeader('x86intrin.h'): ===================================================================================== Thanks |
| Comments |
| Comment by Githook User [ 18/Jan/18 ] | ||||||||
|
Author: {'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}Message: (cherry picked from commit f971dee540b9c9f7d6a92e278900e8bb00014f92) | ||||||||
| Comment by Mark Benvenuto [ 16/Jan/18 ] | ||||||||
|
I was always going to fix the issue. I just wanted to understand how it was hit, and which versions of the product to backport it to. We make the fixes in master typically, and then backport to older releases as needed. I will backport this fix to 3.6. Our process is similar to how GCC works. I tracked down how x86intrin.h was introduced, and noticed that wschmidt backported the change to the gcc 7 branch used in the IBM Advance Toolchain. GCC Master: IBM GCC 7 Branch: | ||||||||
| Comment by Githook User [ 16/Jan/18 ] | ||||||||
|
Author: {'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto', 'username': 'markbenvenuto'}Message: | ||||||||
| Comment by Peter Bergner [ 12/Jan/18 ] | ||||||||
|
So applying the With that fix manually applied, then building again, without the --disable-warnins-as-errors, I see the following warning which causes an error: src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_conf.h:75:27: note: the ABI of passing aggregates with 16-byte alignment has changed in GCC 5 This I cannot work around, so next, I built using the --disable-warnings-as-errors and I see this failure: /opt/at11.0/lib/gcc/powerpc64le-linux-gnu/7.2.1/include/mmintrin.h:52:2: warning: #warning "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this warning." [-Wcpp] | ||||||||
| Comment by Peter Bergner [ 12/Jan/18 ] | ||||||||
|
Mark Benvenuto wrote: Yes, I inherited that from Calvin. > The other issue is a known issue: Looking at my source, I don't seem to have that. I'll try updating my source, and I suspect I won't need my ucontext change given the fix for the above. Thanks for pointing me to it! | ||||||||
| Comment by Calvin Sze [ 11/Jan/18 ] | ||||||||
|
Yes, I compiled with --disable-warnings-as-errors, since I encountered the same issue as, https://jira.mongodb.org/browse/SERVER-30711 | ||||||||
| Comment by Mark Benvenuto [ 11/Jan/18 ] | ||||||||
|
Are you compiling with "--disable-warnings-as-errors"? The other issue is a known issue: When I tried this locally, we did not pick up "x86intrin.h" because of the warning:
| ||||||||
| Comment by Peter Bergner [ 11/Jan/18 ] | ||||||||
|
Ok, I have verified the fix above does allow both the AT10 and AT11 builds to succeed. | ||||||||
| Comment by Peter Bergner [ 11/Jan/18 ] | ||||||||
|
Ok, using AT11 to build mongodb git sources, I need an additional patch to fix a problem wrt ucontext usage in mongodb caused by a recent glibc change. That glibc change is described here: https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27struct_ucontext.27 With the following patch, I get a successful build. I do want to rerun the AT10 build to make sure the ucontext change doesn't affect that build. diff --git a/src/third_party/gperftools-2.5/src/stacktrace_powerpc-linux-inl.h b/src/third_party/gperftools-2.5/src/stacktrace_powerpc-linux-inl.h // PowerPC64 Little Endian follows BE wrt. backchain, condition register, -if conf.CheckCHeader('x86intrin.h'): | ||||||||
| Comment by Calvin Sze [ 11/Jan/18 ] | ||||||||
|
Hi Mark, I tried both 3.4.4 and 3.6.1 Mongodb, both have this issue. | ||||||||
| Comment by Mark Benvenuto [ 11/Jan/18 ] | ||||||||
|
What version of MongoDB are you building? After I make the fix, I want to make sure I backport it the right release. | ||||||||
| Comment by Peter Bergner [ 11/Jan/18 ] | ||||||||
|
Slight typo (missing ')') on the patch which I'm testing now. diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript -if conf.CheckCHeader('x86intrin.h'): | ||||||||
| Comment by Peter Bergner [ 11/Jan/18 ] | ||||||||
|
Please note that this is NOT an AT 11 issue. Current GCC trunk (soon to be GCC 8) will also have the x86intrin.h file added as Bill mentions, so future distro compilers will also hit this issue. This is noticed in AT 11, because the x86 intrinsic compat support was back ported to AT 11. That said, I had a look at SConscript, and maybe we can solve this problem with the following patch? — src/third_party/wiredtiger/SConscript.orig 2018-01-10 19:35:50.532058937 -0600 -if conf.CheckCHeader('x86intrin.h'): | ||||||||
| Comment by Bill Schmidt [ 10/Jan/18 ] | ||||||||
|
The most recent version of AT 11.0 added this file as an aid to help people port x86 vector intrinsics to Power VSX intrinsics. It should only be used when building an application if neither generic code nor Power-specific code is available. It contains a #warning (soon to be changed to an #error) that including the file should only be done under control of a specific -D define. Using an #error would have caught this problem sooner. Usual configury practice is to test whether a function provided by an include file succeeds. Would this be possible? | ||||||||
| Comment by Mark Benvenuto [ 10/Jan/18 ] | ||||||||
|
What version of MongoDB are you compiling? Are you cross-compiling? The header file should only exist on x86 and so scons should not have defined that flag. I cannot find it in AT 11.0 for instance on my RHEL 7 PPC64LE box. |