Open Bug 321318 Opened 19 years ago Updated 2 years ago

SOL_CFLAGS and OPTIMIZER flags conflict in freebl

Categories

(NSS :: Libraries, defect, P2)

3.11
Sun
Solaris

Tracking

(Not tracked)

People

(Reporter: julien.pierre, Unassigned)

Details

The freebl Makefile includes a SOL_CFLAGS variable which is set to a very specific set of compiler flags.

Sometimes, that variable overrides the optimizer level with -xO5 .
The default is set to -xO4 by the OPTIMIZER coreconf macro .

Unfortunately, OPTIMIZER is not unset, so both -xO4 and -xO5 are passed to the compiler, as in the command below !


mkdir SunOS5.10_64_OPT.OBJ/SunOS_ABI64_FPU
gmake FREEBL_CHILD_BUILD=1 USE_ABI64_FPU=1 \
 OBJDIR=SunOS5.10_64_OPT.OBJ/SunOS_ABI64_FPU libs
gmake[1]: Entering directory `/export/home2/madbrain/nss/tip/mozilla/security/nss/lib/freebl'
cc -o SunOS5.10_64_OPT.OBJ/SunOS_ABI64_FPU/freeblver.o -c -xO4 -KPIC -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT -DSOLARIS2_10 -D_SVID_GETTOD -D__MATHERR_ERRNO_DONTCARE -fns -fsimple=2 -fsingle -xalias_level=basic -xbuiltin=%all -xcache=64/32/4:1024/64/4 -xchip=ultra3 -xdepend
-xlibmil -xmemalign=8s -xO5 -xarch=v9a -DXP_UNIX -DSHLIB_SUFFIX=\"so\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"_3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -DNSS_USE_64 -DMP_NO_MP_WORD -DMP_USE_UINT_DIGIT -DMP_ASSEMBLY_MULTIPLY -DMP_USING_MONT_MULF -DMP_MONT_USE_MP_MUL -DMP_API_COMPATIBLE -I/usr/dt/include -I/usr/openwin/include -I../../../../dist/SunOS5.10_64_OPT.OBJ/include  -I../../../../dist/public/nss -I../../../../dist/private/nss -Impi -Iecl  freeblver.c

The duplication of -xO4 and -xO5 needs to be corrected. I'm surprised the compiler accepts both. I have determined that it uses the last argument passed, so it is -xO5 as intended.

Also, the flags passed in SOL_CFLAGS are clearly optimizer flags, and they only should be passed in the debug build, not in the optimized build. So they should be in an ifdef BUILD_OPT block . See the precedent for Windows that sets -Ox only for BUILD_OTP in the freebl Makefile.
Of course, I meant to write that SOL_CFLAGS contains optimizer flags, and they should only be passed in the optimized build, not in the debug build.
QA Contact: jason.m.reid → libraries
Priority: -- → P2
Target Milestone: --- → 3.11.2
Retargetting all P2s to 3.11.3 .
Target Milestone: 3.11.2 → 3.11.3
Target Milestone: 3.11.3 → 3.11.8
Assignee: neil.williams → nobody
Target Milestone: 3.11.8 → ---
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.