]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use -std=gnu17 in build-many-glibcs.py when configuring GMP
authorJoseph Myers <josmyers@redhat.com>
Tue, 27 May 2025 15:56:56 +0000 (15:56 +0000)
committerJoseph Myers <josmyers@redhat.com>
Tue, 27 May 2025 15:56:56 +0000 (15:56 +0000)
This works around incompatibility of GMP 6.3.0 with GCC 15 (defaulting
to C23) following an approach suggested by Florian.

Tested with build-many-glibcs.py (host-libraries build only).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
scripts/build-many-glibcs.py

index 28258e372c0cd79859d2d8082e43b609a5c81aeb..fa3e75defe41400fcaab2ae31aa5ede54b659dfa 100755 (executable)
@@ -742,7 +742,13 @@ class Context(object):
         logsdir = os.path.join(self.logsdir, 'host-libraries')
         self.remove_recreate_dirs(installdir, builddir, logsdir)
         cmdlist = CommandList('host-libraries', self.keep)
-        self.build_host_library(cmdlist, 'gmp')
+        # This CFLAGS setting works around GMP 6.3.0's configure
+        # script being incompatible with compilers defaulting to C23
+        # and should be removed when this script is updated to use a
+        # release of GMP from after that configure test was fixed in
+        # Jan 2025.
+        self.build_host_library(cmdlist, 'gmp',
+                                ['CFLAGS=-Wall -O2 -std=gnu17'])
         self.build_host_library(cmdlist, 'mpfr',
                                 ['--with-gmp=%s' % installdir])
         self.build_host_library(cmdlist, 'mpc',