Jeff Trawick wrote: > Seema Alevoor wrote: >> >> >> On 02/26/09 06:27, Jeff Trawick wrote: >>> Seema Alevoor wrote: >>>> >>>> Jeff Trawick wrote: >>>>> Seema Alevoor wrote: >>>>>> >>>>>> >>>>>> On 02/24/09 21:22, Jeff Trawick wrote: >>>>>>> Seema Alevoor wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 02/24/09 06:29, Jeff Trawick wrote: >>>>>>>>> Seema Alevoor wrote: >>>>>>>>>> Please review the webrev at >>>>>>>>>> http://cr.opensolaris.org/~seema/6782613/ >>>>>>>>>> >>>>>>>>>> Main changes: >>>>>>>>>> * --cflags includes CFLAGS and EXTRA_CFLAGS >>>>>>>>>> * --link-ld and --link-libtool options includes --ldflags >>>>>>>>>> option value. >>>>>>>>>> >>>>>>>>> These all sound like APR fixes, and not issues with our >>>>>>>>> integration. Is that right? What was broken? I just see the >>>>>>>>> -m32/-m64 issue in the CR. >>>>>>>>> >>>>>>>> Evaluation has details about why --ldflags change was necessary. >>>>>>>> >>>>>>>>> I understand that --cflags without the user-specified CFLAGS >>>>>>>>> broke with 64-bit builds, and I've posted to dev at apr asking >>>>>>>>> about the history (it is a hindrance people have put up with >>>>>>>>> for too long). >>>>>>> >>>>>>> According to a highly esteemed APR colleague, the usual solution >>>>>>> for 64-bit builds, and ABI issues in general, is to include such >>>>>>> flags in CC. CFLAGS may include flags not appropriate to pass on >>>>>>> to applications. I've tweaked my personal Apache/APR build >>>>>>> scripts to move "-m64" from CFLAGS to CC, and can avoid the ugly >>>>>>> "apxs -Wl,-m64 -Wc,-m64 ..." hack, and apr-1-config output looks >>>>>>> good too. >>>>>>> >>>>>>> For our build we own all these settings and can determine >>>>>>> whether we only include items in CFLAGS that can be passed on to >>>>>>> applications so the choice isn't absolutely critical, but it >>>>>>> would be great to follow the normal path. >>>>>>> >>>>>> For our builds, common flags are defined in the master makefile >>>>>> and they are all >>>>>> part of CFLAGS variable. >>>>> >>>>> Okay, so we clearly have to do something out of the ordinary. >>>>> >>>>> I'd rather see us edit the --cc value in apr-1-config to match a >>>>> recommended APR build than extend the meaning of >>>>> --cflags/--cppflags in both apr-1-config and apu-1-config. >>>>> >>>> When we use libtool to compile a module, it will use build time >>>> CFLAGS. Shouldn't the user be exposed to same set of flags while >>>> using apr-1-config/apu-1-config ? >>> The apr-1-config flags seem safer, since as we bump up optimization >>> on our code (verified by our testing) we don't affect the >>> optimization of the user's code, possibly breaking it or rendering >>> it difficult to debug. >>> >>> I don't know this with absolute certainty, but in general I trust >>> that what's good for APR on other platforms is good for OpenSolaris >>> too. >>> >>> I did eyeball the compile difference between apxs (which uses >>> libtool) vs. building the command using apr-1-config and didn't >>> notice anything harmful. >>> >>> >> So, you are suggesting that we change >> 1. the --cc option to include the essential build time CFLAGS >> 2. retain apr-1-config's CFLAGS as EXTRA_CFLAGS (back out the >> --cflags and --cppflags changes) >> 3. no change to libtool flags , >> right ? > > right > > This should bring us in alignment with a normal APR build. > > For CC, the only essential build time flag missing AFAICT is -m64. It > is in CFLAGS for us because our build setup doesn't follow the > recommended APR mechanism -- setting CC to "cc -m64" for 64-bit builds. > oops, I wasn't ready to press the "Send" button...
Just to be sure about everything, I'll work on a few testcases for using different outputs of the build to build a third-party app, try them with two different APR builds (CC="cc -m64" vs. CFLAGS="-m64"), report on the negative aspects of each one, and see where the "-m64" ends up in both situations. (understanding that we won't actually change our build to use CC="cc -m64" but are considering editing the build files to act like it) >>>> Or are you suggesting that we change the libtool flags, too ? >>>>>