On Aug 30, 2013, at 6:36 AM, Lois Foltan <lois.fol...@oracle.com> wrote:
> > On 8/29/2013 10:18 PM, David Holmes wrote: >> On 29/08/2013 10:01 PM, Lois Foltan wrote: >>> >>> On 8/29/2013 7:16 AM, David Holmes wrote: >>>> Hi Lois, >>>> >>>> Is this still needed: >>>> >>>> 142 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH) >>>> >>>> given you no longer use -O0 ? >>> Hi David, >>> Yes, I believe so but this might be a cautionary change on my part. I >>> read the comment to imply that Clang does not support a precompiled >>> header compiled with an optimization level that is different than the >>> one used to compile the actual C++ file, this is why I chose to add >>> unsafe.o. >> >> I read the comment as only applying to a combination of -O0 with -O3. So now >> the comment is inaccurate as it claims all files are compiled with -O0. >> >> 133 # There are some files which don't like precompiled headers >> 134 # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the >> opt build. >> 135 # But Clang doesn't support a precompiled header which was compiled >> with -O3 >> 136 # to be used in a compilation unit which uses '-O0'. We could also >> prepare an >> 137 # extra '-O0' PCH file for the opt build and use it here, but it's >> probably >> 138 # not worth the effort as long as only two files need this special >> handling. >> >> Either the comment or the entry at line 142 need to be changed. (the part >> about 'two files' is already out of date :( ) > > Hi David, > Line #142 is necessary. If clang++ compiles unsafe.o with -O1 and tries to > include the precompiled header that is compiled by default with -Os, (note > that -Os is the current default, not -O3 as the comment indicates) That's because I took the comment verbatim from the Linux makefile. Not good practice, I know. -- Chris > , the following compile time error is generated: > > error: __OPTIMIZE_SIZE__ predefined macro was enabled in PCH file but is > currently disabled > > So, the the comment is incorrect in many ways. I have entered > https://bugs.openjdk.java.net/browse/JDK-8024050, detailing the issues. > > Thanks, > Lois > >> >> David >> ----- >> >>> Lois >>> >>>> Thanks, >>>> David >>>> >>>> On 29/08/2013 3:56 AM, Lois Foltan wrote: >>>>> >>>>> Please review the updated webrev: >>>>> open webrev at >>>>> http://cr.openjdk.java.net/~hseigel/bug_jdk8022407.2/ >>>>> >>>>> Bug: >>>>> bug link at https://bugs.openjdk.java.net/browse/JDK-8022407 >>>>> >>>>> Summary of fix: >>>>> >>>>> The JDK 8 build on MacOS, when built with the Xcode 4.6.2 clang++ >>>>> compiler, exhibited a compiler >>>>> optimization issue when prims/unsafe.cpp was compiled at the >>>>> default -Os level. As a work around >>>>> fix, knock the optimization level down down to -O1. >>>>> >>>>> Tests: MacOS: built fastdebug & product images using clang++ (ran JTREG >>>>> & vm.quick.testlist) >>>>> built using llvm-g++ to verifyprims/unsafe.cpp remained >>>>> compiled at -Os >>>>> >>>>> Thank you, Lois >>>>> >>>>> >>> >