[sudo-workers] trivial configure patch for sudo

Robert Cohen robert.cohen at anu.edu.au
Sun Jul 29 23:03:25 EDT 2007

I recently tried to build sudo 1.6.9p1 on Solaris 9 with gcc 4.1.2
It failed due to an issue that Ive noticed a couple of times with other
programs recently.

The optimiser in gcc 4.1 has become smart enough to optimise away some code
used in the configure script to test for library features. In this case it
was the test for the isblank function.
The problem is due to the fact that the configure tests are functions that
take no inputs and produce no outputs. So can be optimised away.

Heres a trivial patch to configure which fixes the issue on solaris. Of
course the real fix is to push the fix back the the autoconf template and
regenerate the configure script. Also Ive only do the fix for the one
function where it was an issue for me. In theory a similar issue could occur
for virtually any function being tested for.

diff -ur sudo-1.6.9p1-orig/configure sudo-1.6.9p1/configure
--- sudo-1.6.9p1-orig/configure 2007-07-30 12:45:41.703612000 +1000
+++ sudo-1.6.9p1/configure      2007-07-30 12:47:46.099214000 +1000
@@ -16173,11 +16173,9 @@
 /* end confdefs.h.  */
 #include <ctype.h>
-main ()
+main (int argc, char **argv)
-  ;
-  return 0;
+return isblank(argc);
 rm -f conftest.$ac_objext conftest$ac_exeext

Robert Cohen
Systems & Desktop Services
Division of Information
R.G Menzies Building
Building 2
The Australian National University
Canberra ACT 0200 Australia
T: +61 2 6125 8389
F: +61 2 6125 7699
CRICOS Provider #00120C

More information about the sudo-workers mailing list