Bug #5461
closed#pragma align before the declaration
100%
Description
When building in usr/src/uts/sun4u/unix with gcc 4.8.2, the following error appears:
../../common/vm/vm_pagelist.c:77:9: error: '#pragma align' must appear before the declaration of vm_cpu_data0, ignoring [-Werror]
#pragma align MAX_PRAGMA_ALIGN(vm_cpu_data0)
^
cc1: all warnings being treated as errors
The Studio compiler accepts the code with no complaints, but gcc objects to the placement of the pragma. The solution is to use the aligned attribute for the gcc compiler only. I've attached my patch file.
Files
Related issues
Updated by Rich Lowe over 7 years ago
I'm 99% sure that the real problem is the (unnecessary) declaration in the vm_dep.h's for both platforms.
The reason this is "post-facto" is the extern declaration, which is unnecessary and generally detrimental.
Updated by Gary Mills over 7 years ago
- Status changed from New to Feedback
I expect that you are right, but your suggestion is testable, at least on the x86 platform. I can only do a build on the SPARC platform, which is only part of the test. Maybe somebody else can assist us.
Updated by Rich Lowe over 7 years ago
If it works on SPARC, I can certainly try on x86 for you. I'm confident it'll work on both (more confident about x86, honestly).
Updated by Igor Kozhukhov over 7 years ago
i'd like to help with test on SPARC with gcc44 build
Updated by Andrew Stormont about 7 years ago
The code builds fine with these changes (the removal of vm_cpu_data0 from vm_dep.h). I haven't tested the build yet but I will do later today.
Updated by Andrew Stormont about 7 years ago
- Related to Bug #3373: gcc >= 4.5 concerns about offsetof() added
Updated by Andrew Stormont about 7 years ago
- Related to deleted (Bug #3373: gcc >= 4.5 concerns about offsetof())
Updated by Andrew Stormont about 7 years ago
- Related to Bug #3062: illumos should build/work with GCC 4.6 or newer added
Updated by Gary Mills about 7 years ago
This certainly seems like a better solution than mine. Please proceed.
Updated by Electric Monk over 6 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
git commit 71b4af9b981b0fc179b6c0bab0186b84a2bc2d9c
commit 71b4af9b981b0fc179b6c0bab0186b84a2bc2d9c Author: Richard Lowe <richlowe@richlowe.net> Date: 2016-01-31T18:40:17.000Z 5461 #pragma align before the declaration Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Dan McDonald <danmcd@omniti.com>