Seema Alevoor wrote: > I have updated the webrev ( http://cr.opensolaris.org/~seema/6670736 ). > This fix also includes a change in the compiler optimization level to -xO4 > (same as that of CoolStack). > > Regarding the change for -mt:
APR already uses -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT, which is supposed to work for Sun cc or gcc; this setting is inherited by apr-util and httpd. It seems that starting with Solaris 10 or thereabouts, the Solaris Multithreaded Programming Guide started pushing Sun Studio and the "-mt" flag. In an older version of the same manual it describes the settings that apr uses (http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/MTP/p44.html#COMPILE-94611). So, is "-mt" really required? If -mt is really required, I believe that: * It is a bug in APR that "-mt" isn't automatically added to CFLAGS when the Sun compiler is used (as long as the APR configure option --disable-threads wasn't specified). httpd picks up flags from APR by default so fixing it in APR covers that, as well as apr-util and other project/third-party code. * Both prefork and worker MPMs must support threaded code (in prefork, this is only when third-party modules create threads) so both need -mt. (But if APR has the right flags both are okay.) I'd expect to see a patch to APR, however crude, to force -mt into CFLAGS when the Sun compiler is used. I don't yet know how fixes to bugs in upstream are tracked, but a patch to the tarball seems more obvious than working around the problem in the project makefile. Apologies for sticking my nose into this without yet knowing how this is all put together ;)