Open Bug 232748 Opened 22 years ago Updated 3 years ago

Remove default opt&debug flags when user has supplied other opt&debug flags.

Categories

(NSPR :: NSPR, defect)

DEC
OSF/1
defect

Tracking

(Not tracked)

People

(Reporter: mmokrejs, Unassigned)

Details

User-Agent: Build Identifier: Mozilla - cvs 20040131 At least on Tru64Unix 5.1A I cannot get an optimized binary, at the compiler receives from make: cxx ...-O3 -g0 ....-g cxx: Info: File not optimized; use -g3 if both optimization and debug wanted. I had to edit generated ./nsprpub/config.status ./directory/c-sdk/config.status files and remove trailing "-O -Olimit 4000 -g" from @CFLAGS@, @CXXFLAGS@. I suggest improving configure to add -O limit and -g only case user hasn't specified them in yet. I configured as: PATH="/software/@sys/usr/freetype-2.1.4rc1/bin:$PATH" CPPFLAGS="-I/software/@sys/usr/freetype-2.1.4rc1/include $CPPFLAGS" CFLAGS="-O3 -arch ev56 -g0 -pthread" CXXFLAGS="-O3 -arch ev56 -g0" ./configure --enable-crypto --with-libIDL-prefix=/software/@sys/usr --prefix=/afs/.gsf.de/alpha_dux51/usr/mozilla/mozilla-1.6+-20040131 --enable-optimize --enable-calendar --with-extensions=all Reproducible: Always Steps to Reproduce: 1. 2. 3.
Assignee: general → cls
Component: Browser-General → Build Config
To get an optimized build, you need to use --disable-debug as well as --enable-optimize. That should workaround the error that you're seeing. The appending of the -Olimit flags comes from the legacy NSPR build system which had all of those values hardcoded and there was no way to add any additional flags short of editing the makefiles or specifying them when running make.
Assignee: cls → wchang0222
Severity: normal → minor
Status: UNCONFIRMED → NEW
Component: Build Config → NSPR
Ever confirmed: true
OS: other → OSF/1
Product: Browser → NSPR
QA Contact: general → wchang0222
Hardware: Other → DEC
Summary: Cannot make optimized bianry. Remove -Olimit and -g when user has supplied other opt&debug flags. → Remove default opt&debug flags when user has supplied other opt&debug flags.
Version: Trunk → 4.3
But many package maintainers don't know that trick! For example, on Gentoo linux no-one expects that and mozilla get's compiled with default flags only(-mcpu=i686 -O2). Please remove the --disable-debug requirement! It's expected to be disabled already by using the --enable-optimize. Acceptable is -O -g which turn on minimal debug and minimal optimization but they do NOT take effect if they already appear on commandline.
--enable-optimize="foo" set in .mozconfig fails to pass values down to nspr build process. For example on AIX --enable-optimize="-O2 -qmaxmem=-1" one expects these values to be passed down and nspr gets built with only "-O". Maybe I'm missing something here. Let me know if there's a way to control nspr build configuration from .mozconfig or where I should set the optimize flags.
David, can you test the patch I wrote for under bugreport https://bugzilla.mozilla.org/show_bug.cgi?id=268292 if it helps your environment flags to be passed properly through configure and Makefile's?
(In reply to comment #2) > Please remove the --disable-debug requirement! It's expected to be disabled > already by using the --enable-optimize. No, it's not. 7 years ago, you would have had a valid argument. Now, that sort of arbitrary change would cause more confusion than it would resolve. See also http://www.mozilla.org/build/configure-build.html . David, can you attach a build log and your nsprpub/config/autoconf.mk ? A glance at nsprpub/configure.in shows that the --enable-optimize=foo call should still get processed by NSPR.
But that html page still doesn't say that you one has to use at once either --enable-debug --disable-optimize or vice versa. I believe it's widely expected that --enable-debug disables optimization, for example. I'd be fine if it's documented in configure's output. See bug #284767. I still kick for the patch mentioned in comment #4, which makes it possible to get real debug symbols into the code. Accept at least something so I can re-test and we move ahead. At least part of both patches, under #28476 and #268292. Thanks.
(In reply to comment #6) > But that html page still doesn't say that you one has to use at once either > --enable-debug --disable-optimize or vice versa. No, it doesn't explicitly say that. However, if you read the definitions of the various options in the Optimizations section, it would be very clear what each option does and what you should expect from those options. > I believe it's widely expected that --enable-debug disables optimization, for > example. No, it's not when it comes to the Mozilla build system (which is admittedly different than nearly everything else). --enable-debug & --enable-optimize are 2 orthogonal defines. If one disabled the other, then we would only need a single define.
QA Contact: wtchang → nspr
Severity: minor → S4

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: wtc → nobody
You need to log in before you can comment on or make changes to this bug.