I agree with Jeff's concern that we should add "-mt" in apr rather than in apache.
Sriram, Regarding your concern that some customer may not want to compile their application/module with -mt. * All apache modules which prefork mpm loads are compiled with "-mt" so it won't have any effect if customers plugin is compiled with "-mt". * Also if apache modules which prefork mpm loads is compiled with "-mt", it is rather better idea to compile users application with "-mt". Also since apache modules are compiled with "-mt", we should probably compile prefork mpm with "-mt" too. Regards, Basant. On Mon, Aug 11, 2008 at 08:14:48AM -0700, Sriram Natarajan wrote: > Jeff - You have some valid points. If you notice the some of the > comments history in this bug - 6670736 - this point was indeed > discussed. But, some one pointed out why we could have '-mt' set within > our project Makefile to avoid any misinterpretation. Also, please note > that in our environment, we are compiling APR with threaded support. So > that , we can reuse the APR both for pre-fork and worker version of > httpd. However, it is very possible that there might be other customers > who don't want to build APR with threading support - for various reasons. > > - sriram > > Jeff Trawick wrote: > > 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 ;) > > > > _______________________________________________ > > > > > > webstack-discuss mailing list > > webstack-discuss at opensolaris.org > > http://mail.opensolaris.org/mailman/listinfo/webstack-discuss > > > _______________________________________________ > > > webstack-discuss mailing list > webstack-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/webstack-discuss