Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8354941

Build failure with glibc 2.42 due to uabs() name collision

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 25
    • 8, 11, 17, 21, 24, 25
    • hotspot
    • b23
    • generic
    • generic

        When attempting to build OpenJDK with GCC 15 and glibc 2.42 (the GCC/glibc versions for F43 to be released in Fall 2025) the build fails with something like this:

        ++ /usr/bin/tee -a /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/build/newboot/hotspot/variant-server/libjvm/objs/precompiled/precompiled.hpp.gch.log
        ++ /usr/bin/tee -a /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/build/newboot/hotspot/variant-server/libjvm/objs/precompiled/precompiled.hpp.gch.log
        In file included from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/nmt/memTag.hpp:28,
                         from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/memory/allocation.hpp:29,
                         from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/classfile/classLoaderData.hpp:28,
                         from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/precompiled/precompiled.hpp:34:
        /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/utilities/globalDefinitions.hpp:1166:28: error: ‘unsigned int uabs(int)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
         1166 | static inline unsigned int uabs(int n) { return uabs((unsigned int)n); }
              | ^~~~
        In file included from /usr/include/c++/15/cstdlib:83,
                         from /usr/include/c++/15/stdlib.h:36,
                         from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/utilities/globalDefinitions_gcc.hpp:42,
                         from /builddir/build/BUILD/java-latest-openjdk-portable-24.0.1.0.9-build/java-24-openjdk-24.0.1.0.9-1.rolling.fc43.x86_64/jdk-24.0.1+9/src/hotspot/share/utilities/globalDefinitions.hpp:35:
        /usr/include/stdlib.h:989:21: note: previous declaration of ‘unsigned int uabs(int)’
          989 | extern unsigned int uabs (int __x) __THROW __attribute__ ((__const__)) __wur;
              | ^~~~
        + exitcode=1

        The reason for this seems to be a name clash of uabs() when stdlib.h is being included. GCC defines a version of it and so does HotSpot.

              sgehwolf Severin Gehwolf
              sgehwolf Severin Gehwolf
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: