Avoid GCC 7.1 ABI change warning in guix build #22410

pull sipa wants to merge 1 commits into bitcoin:master from sipa:202107_nopsabi changing 1 files +4 −0
  1. sipa commented at 5:44 PM on July 6, 2021: member

    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.

  2. Avoid GCC 7.1 ABI change warning in guix build 1edddf5de4
  3. sipa added the label Build system on Jul 6, 2021
  4. sipa added the label Needs Guix build on Jul 6, 2021
  5. dongcarl commented at 9:00 PM on July 6, 2021: member

    Huh... I don't know much about the GCC ABI, could you enlighten me as to why this doesn't apply to us?

  6. sipa commented at 9:19 PM on July 6, 2021: member

    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

  7. hebasto commented at 6:47 AM on July 7, 2021: member

    We use -Wno-psabi in CI, and I use it for my arm binaries.

  8. laanwj commented at 10:56 AM on July 7, 2021: member

    My understanding is that this is just a warning not to link objects compiled with pre- and post-7.1 together.

    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 1edddf5de41b053049ce0b0bdbc39c2fbb743c40

  9. dongcarl commented at 8:38 PM on July 7, 2021: member

    Ah! In that case, ACK 5016091dd8b827c74fe28212be43d3b22014c5b6

  10. fanquake commented at 4:25 AM on July 8, 2021: member

    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 arm-linux-gnueabihf target.

    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 -Wabi=X or -fabi-(compat)-version=X options you'd be able to suppress the warning output, but I can't find a combination that works.

    Note that if you compile with -Wabi (these warnings are emitted regardless), GCC tells you that it wont warn about anything, unless you've set a -fabi-version= to something other than the default (0 or 13 in our case), but still warns:

    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 -fabi-verison=12 (G++ 8.0), GCC no longer tells you that it won't warn, but it still emits the warnings about changes in GCC 7.1:

    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 -Wabi=12, same deal:

    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) {
          |     ^~~
    

    🤷

  11. sipa commented at 5:13 AM on July 8, 2021: member

    Is it possible that ABI and psABI are two independent settings, and that psABI doesn't have this kind of granular versioning?

  12. fanquake commented at 5:34 AM on July 8, 2021: member

    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 -Wpsabi remain undocumented:

    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.

  13. DrahtBot commented at 10:53 AM on July 9, 2021: member

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds

    File commit 4129134e844f78a89f8515cf30dad4b6074703c7<br>(master) commit 8b8a1c1a631dd61ac730c429ee2c6325d4828667<br>(master and this pull)
    SHA256SUMS.part c5cf1c6985c1c430... 10c7ffa6a8d02b2c...
    SKIPATTEST.TAG e3b0c44298fc1c14... e3b0c44298fc1c14...
    *-aarch64-linux-gnu-debug.tar.gz d564c8ce3c2132bb... ae58d84633dfd83f...
    *-aarch64-linux-gnu.tar.gz 8c2cc0b1046d6518... 5cd07216104ede82...
    *-arm-linux-gnueabihf-debug.tar.gz 9b2d147ec30ecd15... 4e04f5ab064e6400...
    *-arm-linux-gnueabihf.tar.gz bd8da7121fdf38b2... b257ac7d332cdcb4...
    *-osx-unsigned.dmg 4dd21a03916bd42e... 7927bca8c961befd...
    *-osx-unsigned.tar.gz ff3602163bce9934... 527823a21670b092...
    *-osx64.tar.gz 50b1b0f6f8b8eb16... cf0167df8084409d...
    *-powerpc64-linux-gnu-debug.tar.gz aad00c9521d46187... 4b3f2a1334f43f03...
    *-powerpc64-linux-gnu.tar.gz 1a326af20ced546f... 924b9e8177399e54...
    *-powerpc64le-linux-gnu-debug.tar.gz 237b9ee0ddb60e47... 1a9195d951ec5500...
    *-powerpc64le-linux-gnu.tar.gz 98de1dec19a8b6f9... 8bf7c8b4ee4c562f...
    *-riscv64-linux-gnu-debug.tar.gz 6e0e781bbd611ad7... aeb86308d26aac0e...
    *-riscv64-linux-gnu.tar.gz 96cff3df87b6f625... aa2eb36c0de9b259...
    *-win-unsigned.tar.gz 59721ac4abcebb51... 8fdd06eac5ed69ef...
    *-win64-debug.zip d6f919dd523c407d... 71dd7202b6d6368d...
    *-win64-setup-unsigned.exe 96dc1c8f917b086c... 995b3872a2a04e22...
    *-win64.zip e0e5925b0a898b9c... e01f0e011bf6759d...
    *-x86_64-linux-gnu-debug.tar.gz 3912bb99acf83778... f713fa0afd305d07...
    *-x86_64-linux-gnu.tar.gz eb0edfa33b57ecb7... ed73d0d8325a2c5b...
    *.tar.gz 5b1ee87a8833130e... 125cd3ed40b833f3...
    guix_build.log cc1551ca0837126d... 6930f99ceed8d6c5...
    guix_build.log.diff b6b21359bcbd7c10...
  14. DrahtBot removed the label Needs Guix build on Jul 9, 2021
  15. sipa commented at 4:01 PM on July 9, 2021: member

    @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?

  16. hebasto approved
  17. hebasto commented at 7:29 PM on July 17, 2021: member

    ACK 1edddf5de41b053049ce0b0bdbc39c2fbb743c40, 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.

  18. fanquake merged this on Jul 18, 2021
  19. fanquake closed this on Jul 18, 2021

  20. sidhujag referenced this in commit b06ffbe990 on Jul 23, 2021
  21. gwillen referenced this in commit cc0e38ccb2 on Jun 1, 2022
  22. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me