-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Avoid GCC 7.1 ABI change warning in guix build #22410
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
Conversation
|
Huh... I don't know much about the GCC ABI, could you enlighten me as to why this doesn't apply to us? |
|
My understanding is that this is just a warning not to link objects compiled with pre- and post-7.1 together. EDIT: this seems to confirm that: https://stackoverflow.com/q/52020305/8342274 |
|
We use |
Correct. It doesn't apply to us while building the distribution binaries because we use the same C and C++ compilers for everything including the dependencies. ACK 1edddf5 |
|
Ah! In that case, ACK 5016091 |
|
It's a bit annoying that there doesn't seem to be a way to suppress these warnings with any sort of granularity, and the only option is disabling ABI warnings wholesale. Although I'm wondering if this is some buggy behaviour in GCC? Ideally we could just tell GCC that we don't care about ABI related warnings for any ABI changes that happened before GCC 8.5 (i.e ABI version 13, from G++ 8.2), given that's what we are using to compile all code for the I took a minified test case from the bug in question: #include <stdarg.h>
template <int N> struct A { double p; };
A<0> v;
template <int N> struct B {
typedef A<N> T;
int i, j;
};
int fn1(int a, B<0> b) {
return a + b.i;
}
int main() {
return 0;
}which produces the warning we're seeing: # arm-linux-gnueabihf-g++ --version
# arm-linux-gnueabihf-g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
arm-linux-gnueabihf-g++ abi.cpp -std=c++17
abi.cpp: In function ‘int fn1(int, B<0>)’:
abi.cpp:12:5: note: parameter passing for argument of type ‘B<0>’ changed in GCC 7.1
12 | int fn1(int a, B<0> b) {
| ^~~I assumed with some combination of the Note that if you compile with arm-linux-gnueabihf-g++ abi.cpp -std=c++17 -Wabi
cc1plus: warning: ‘-Wabi’ won’t warn about anything [-Wabi]
cc1plus: note: ‘-Wabi’ warns about differences from the most up-to-date ABI, which is also used by default
cc1plus: note: use e.g. ‘-Wabi=11’ to warn about changes from GCC 7
abi.cpp: In function ‘int fn1(int, B<0>)’:
abi.cpp:12:5: note: parameter passing for argument of type ‘B<0>’ changed in GCC 7.1
12 | int fn1(int a, B<0> b) {
| ^~~If you set arm-linux-gnueabihf-g++ abi.cpp -std=c++17 -fabi-version=12
abi.cpp: In function ‘int fn1(int, B<0>)’:
abi.cpp:12:5: note: parameter passing for argument of type ‘B<0>’ changed in GCC 7.1
12 | int fn1(int a, B<0> b) {
| ^~~If you set arm-linux-gnueabihf-g++ abi.cpp -std=c++17 -Wabi=12
abi.cpp: In function ‘int fn1(int, B<0>)’:
abi.cpp:12:5: note: parameter passing for argument of type ‘B<0>’ changed in GCC 7.1
12 | int fn1(int a, B<0> b) {
| ^~~🤷 |
|
Is it possible that ABI and psABI are two independent settings, and that psABI doesn't have this kind of granular versioning? |
Yea that may be the case. Also, as of GCC 11.1, the g++-11 --help=warnings | grep -i abi
-Wabi Warn about things that will change when compiling with an ABI-compliant compiler.
-Wabi-tag Warn if a subobject has an abi_tag attribute that the complete object type does not have.
-Wabi= Warn about things that change between the current -fabi-version and the specified version.
-Wpsabi This option lacks documentation.Could be good to add one line explaining that this is disabled to suppress uncontrollable warning output, but should be ok to do based on us consistently using GCC 8.5 for the Guix build. |
|
@fanquake Actually, is there a reason for us to even care about the ABI/psABI at all (in guix builds, at least)? We control the entire build environment, so whatever is used, it will be consistent for everything in the build? |
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 1edddf5, after thorough reading related materials, I agree this change can be merged. As I mentioned above, I have been compiling my arm-32bit binaries with -Wno-psabi flag for two years, and no related flaws were observed.
1edddf5 Avoid GCC 7.1 ABI change warning in guix build (Pieter Wuille) Pull request description: The arm-linux-gnueabihf guix build output is littered with warnings like: ``` /gnu/store/7a96hdqdb2qi8a39f09n84xjy2hr23rs-gcc-cross-arm-linux-gnueabihf-8.4.0/include/c++/bits/stl_vector.h:1085:4: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<CRecipient*, std::vector<CRecipient> >' changed in GCC 7.1 ``` These are irrelevant for us. Disable them using `-Wno-psabi`. ACKs for top commit: laanwj: ACK 1edddf5 hebasto: ACK 1edddf5, after thorough reading related materials, I agree this change can be merged. As I mentioned above, I have been compiling my arm-32bit binaries with `-Wno-psabi` flag for two years, and no related flaws were observed. Tree-SHA512: 485c7500547ac5da567ad23847341c18ff832607f5a1002676404cc647e437cf3445b6894ecff5b52929ca52bea946c06bd90eace1997c895e56204e787065e4
The arm-linux-gnueabihf guix build output is littered with warnings like:
These are irrelevant for us. Disable them using
-Wno-psabi.