Closed Bug 455468 Opened 16 years ago Closed 5 years ago

configure: error: These compiler flags are invalid: -O0\ -ggdb

Categories

(SeaMonkey :: Build Config, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mmokrejs, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080722 SeaMonkey/1.1.11 Build Identifier: hg TRUNK Hi, it used to work before but now I get with hg TRUNK from comm-central: $ ./configure --disable-optimize --enable-debug='-O0 -ggdb' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-pango ... configuring in mozilla running /bin/sh ./configure --disable-optimize '--enable-debug=-O0\ -ggdb' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-pango --enable-application=../suite --disable-official-branding --cache-file=.././config.cache --srcdir=. loading cache .././config.cache checking host system type... i686-pc-linux-gnu ... checking for libhildonmime... checking for libosso... checking for valid debug flags... no configure: error: These compiler flags are invalid: -O0\ -ggdb configure: error: ./configure failed for mozilla $ Reproducible: Always Steps to Reproduce: 1. 2. 3.
Assignee: nobody → build-config
Component: General → Build Config
QA Contact: general → build-config
Can you take a look at the config.log file and paste the command line which was used to compile? What autoconf version do you have installed? With "it used to work before" you mean it worked with CVS trunk?
Yes, I mean cvs trunk. I think configure always escaped the spaces but there was never this "check", I think it is just a false alarm. mozilla/config.log: configure:17112: checking for valid debug flags configure:17123: gcc -c -fno-strict-aliasing -pthread -O0\ -ggdb conftest.c 1>&5 cc1: error: invalid option argument '-O0\' configure: failed program was: #line 17116 "configure" #include "confdefs.h" #include <stdio.h> int main() { printf("Hello World\n"); ; return 0; }
For the former behaviour plese refer to bug #284767 and bug #314976.
And what autoconf version do you have installed?
(In reply to comment #1) > What autoconf version do you have installed? $ cat .mozconfig mk_add_options AUTOCONF=autoconf-2.13 mk_add_options enable-application=suite $
The problem seems to be in how we forward configure options to the mozilla configure, but I'm not sure what to do about it.
The top-level comm-central/configure.in has the following hacks: MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'` MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'` Maybe the comm-central/mozilla/configure.in needs the same the upper code some cleanup?
Blocks: 452468
No longer blocks: 452468
Version: unspecified → Trunk
This fixes the stupid check. $ cd comm-central/mozilla $ autoconf-2.13 $ cd .. $ ./configure --disable-optimize '--enable-debug=-g3 -O0 -ggdb' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-pango
If somebody would like to hunt for the upstream cause (please note the single apostrophes being placed around the '--enable-debug=-g3\ -O0\ -ggdb' as well): $ ./configure --disable-optimize --enable-debug='-g3 -O0 -ggdb' ... configuring in mozilla running /bin/sh ./configure --disable-optimize '--enable-debug=-g3\ -O0\ -ggdb' ... configuring in nsprpub running /bin/sh ./configure --disable-optimize '--enable-debug=-g3\\ -O0\\ -ggdb' ... configuring in directory/c-sdk running /bin/sh ./configure --disable-optimize '--enable-debug=-g3\ -O0\ -ggdb'
The patch is a good step ahead but due to a bug in gcc I cannot get forward anyway. Somebody should fix the escaping first. $ make ... gcc -DMOZ_SUITE=1 -DSUITE_USING_XPFE_DM=1 -DOSTYPE=\"Linux2.6.24\" -DOSARCH=Linux -I. -I. -I../dist/include -I../dist/include -I/home/mmokrejs/proj/comm-central/mozilla/dist/include/nspr -I/home/mmokrejs/proj/comm-central/mozilla/dist/sdk/include -fPIC -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -Wno-long-long -pedantic -fno-strict-aliasing -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_mmokrejs -DTRACING -g3\ -O0\ -ggdb -include ../mozilla-config.h -DMOZILLA_CLIENT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -o elf-dynstr-gc elf-dynstr-gc.c -lpthread -Wl,-rpath-link,/home/mmokrejs/proj/comm-central/mozilla/dist/bin -Wl,-rpath-link,/lib -lgobject-2.0 -lglib-2.0 cc1: error: unrecognised debug output level "3 -O0 -ggdb" gmake[4]: *** [elf-dynstr-gc] Error 1 gmake[4]: Leaving directory `/home/mmokrejs/proj/comm-central/mozilla/config' And when I tried manually some command: $ gcc -g3\ -O0 mozilla/view/src/nsScrollPortView.cpp cc1plus: error: unrecognised debug output level "3 -O0" $ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-cld --enable-java-awt=gtk --with-arch=i686 --enable-languages=c,c++,java,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.1-r1 p1.1' Thread model: posix gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1) $
The gcc-4.[2-3] bug filed at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37654 , not an issue with 3.3.6.
Assignee: build-config → nobody
QA Contact: build-config → build-config
Hoe does that look with current versions? Still an issue?
Does not happen for me anymore, somehow. The only weird this is where did the -DDEBUG_mmokrejs CFLAGS came from. ;) $ cat comm-central/src/.mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../seamonkey-compiled mk_add_options AUTOCONF=autoconf-2.13 ac_add_options --disable-optimize --enable-debug=-ggdb --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi $ Uhm, I use only --enable-debug=-ggdb, but while trying $ make -f client.mk build Adding client.mk options from /home/mmokrejs/proj/comm-central/src/.mozconfig: MOZ_OBJDIR=$(TOPSRCDIR)/../seamonkey-compiled AUTOCONF=autoconf-2.13 make[1]: Entering directory `/home/mmokrejs/proj/comm-central/src' cd /home/mmokrejs/proj/comm-central/src/../seamonkey-compiled /home/mmokrejs/proj/comm-central/src/configure Adding configure options from /home/mmokrejs/proj/comm-central/src/.mozconfig: --disable-optimize --enable-debug=-ggdb -O0 --enable-debug-modules=all --enable-debugger-info-modules [cut] configuring in mozilla running /bin/sh /home/mmokrejs/proj/comm-central/src/mozilla/configure --disable-optimize '--enable-debug=-ggdb -O0' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-application=../suite --disable-official-branding --with-branding=../suite/branding/nightly --cache-file=.././config.cache --srcdir=/home/mmokrejs/proj/comm-central/src/mozilla Adding configure options from /home/mmokrejs/proj/comm-central/src/.mozconfig: --disable-optimize --enable-debug=-ggdb -O0 --enable-debug-modules=all [cut] I did not let this test to finish the compilation but it seems it is already fixed in mozilla sources. For completeness, the tree I built recently with just "--enable-debug=-ggdb" (not only a argument so space to quote) was with this version: about:buildconfig Source Built from http://hg.mozilla.org/releases/mozilla-1.9.1/rev/0274a35f0e16 Build platform target i686-pc-linux-gnu Build tools Compiler Version Compiler flags gcc gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.2, pie-10.1.5) -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -Wno-long-long -pedantic -fno-strict-aliasing -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_mmokrejs -DTRACING -ggdb c++ gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.2, pie-10.1.5) -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_mmokrejs -DTRACING -ggdb Configure arguments --disable-optimize --enable-debug=-ggdb --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --disable-optimize --enable-debug=-ggdb --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-application=../suite --disable-official-branding --with-branding=../suite/branding/nightly --cache-file=.././config.cache --srcdir=/home/mmokrejs/proj/comm-central/src/mozilla
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Ehm, it does persist in some parts of the tree, but does not get propagated to gcc: [cut] creating ./config.status creating config/autoconf.mk creating config/doxygen.cfg creating build/wince/shunt/include/windows.h creating build/wince/shunt/include/ymath.h creating build/wince/shunt/include/stdlib.h creating gfx/cairo/cairo/src/cairo-features.h creating netwerk/necko-config.h netwerk/necko-config.h is unchanged creating xpcom/xpcom-config.h xpcom/xpcom-config.h is unchanged creating xpcom/xpcom-private.h xpcom/xpcom-private.h is unchanged gfx/cairo/cairo/src/cairo-features.h is unchanged configuring in nsprpub running /bin/sh /home/mmokrejs/proj/comm-central/src/mozilla/nsprpub/configure --disable-optimize '--enable-debug=-ggdb -O0' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --disable-optimize '--enable-debug=-ggdb\ -O0' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-application=../suite --disable-official-branding --with-branding=../suite/branding/nightly --with-dist-prefix=/home/mmokrejs/proj/comm-central/seamonkey-compiled/mozilla/dist --with-mozilla --cache-file=../.././config.cache --srcdir=/home/mmokrejs/proj/comm-central/src/mozilla/nsprpub [cut] c++ -o jsarray.o -c -I./../../dist/include/system_wrappers_js -include /home/mmokrejs/proj/comm-central/src/mozilla/js/src/config/gcc_hidden.h -DFEATURE_NANOJIT -DJS_TRACER -DOSTYPE=\"Linux2.6.29\" -DOSARCH=Linux -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -I/home/mmokrejs/proj/comm-central/src/mozilla/js/src -I. -I./../../dist/include -I./../../dist/include/js -I/home/mmokrejs/proj/comm-central/seamonkey-compiled/mozilla/dist/include/nspr -I/sdk/include -I/home/mmokrejs/proj/comm-central/src/mozilla/js/src -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_mmokrejs -DTRACING -ggdb -O0 -DMOZILLA_CLIENT -include ./mozilla-config.h -Wp,-MD,.deps/jsarray.pp /home/mmokrejs/proj/comm-central/src/mozilla/js/src/jsarray.cpp
I'm not sure if --enable-debug takes options at all, --enable-optimize does though, and that what this bug was filed for. I suspect we still run into it there, as I don't know of any change to those things. And --enable-debug automatically sets a flag called DEBUG_$username where $username is whatever the user name of your login on your machine is - this is used for "personal" debug messages you can use while developing code.
(In reply to comment #15) > I'm not sure if --enable-debug takes options at all, --enable-optimize does > though, and that what this bug was filed for. Really? I don't see myself talking about --enable-optimize ... ;) > I suspect we still run into it Could be, so far the compilation process runs (gcc-4.3.3, anyway gcc devs rejected the bugreport). If I remember right to yield objects with full debug info one had to in the past in addition to --enable-debug set also --disable-optimize, otherwise it pulled in -O2 -g0 or similar. It is in some closed bug report I had in the very past. Anyway, --enable-debug does accept arguments, whether intentionally or not I do not know. It can be seen here: /home/mmokrejs/proj/comm-central/src/configure Adding configure options from /home/mmokrejs/proj/comm-central/src/.mozconfig: --disable-optimize --enable-debug=-ggdb -O0 > there, as I don't know of any change to those things. And --enable-debug > automatically sets a flag called DEBUG_$username where $username is whatever > the user name of your login on your machine is - this is used for "personal" > debug messages you can use while developing code. Thanks for clarification, this is somewhat relatively new feature I haven't seen with seamonkey-1.x sources in the past.
(In reply to comment #16) > (In reply to comment #15) > > I'm not sure if --enable-debug takes options at all, --enable-optimize does > > though, and that what this bug was filed for. > > Really? I don't see myself talking about --enable-optimize ... ;) Er, right, sorry. I didn't think we ever did anything useful with that. > If I remember right to yield objects with full debug info one had to in the > past in addition to --enable-debug set also --disable-optimize, otherwise it > pulled in -O2 -g0 or similar. It is in some closed bug report I had in the very > past. Well, it doesn't make much sense to want --disable-optimize and still give it any -O option, as all --enable-optimize (the default) does, is to enable whatever optimization is the default, and --disable-optimize disables optimization, you shouldn't need any -O in that case. > --enable-debug=-ggdb -O0 As said above, IIRC, -O0 is superfluous, and I think -ggdb is probably default in any case, so also no need to specify, --enable-debug should be enough. > > there, as I don't know of any change to those things. And --enable-debug > > automatically sets a flag called DEBUG_$username where $username is whatever > > the user name of your login on your machine is - this is used for "personal" > > debug messages you can use while developing code. > > Thanks for clarification, this is somewhat relatively new feature I haven't > seen with seamonkey-1.x sources in the past. IIRC, we've had that in Mozilla code for years now for debug builds, maybe you just never noticed ;-)
(In reply to comment #17) > (In reply to comment #16) > > (In reply to comment #15) > > > If I remember right to yield objects with full debug info one had to in the > > past in addition to --enable-debug set also --disable-optimize, otherwise it > > pulled in -O2 -g0 or similar. It is in some closed bug report I had in the > > very past. > > Well, it doesn't make much sense to want --disable-optimize and still give it > any -O option, as all --enable-optimize (the default) does, is to enable > whatever optimization is the default, and --disable-optimize disables > optimization, you shouldn't need any -O in that case. I wouldn't be so sure about defaults, whether in mozilla Makefiles or in gcc-specs. I think gcc by default has -O1 and that is probably platform specific and configurable when gcc was compiled by sysadmin. Anyway, my point was that it seems to me logical that --enable-debug should automagically turn off --enable-optimize, that's what did not happen at least in the past and was explained in Bug #232748#c7 > > > --enable-debug=-ggdb -O0 > > As said above, IIRC, -O0 is superfluous, and I think -ggdb is probably default > in any case, so also no need to specify, --enable-debug should be enough. If I would have extra CPU time, I would re-try. --enable-debug used NOT to be enough. One had to add --disable-optimize to get real debug info into the objects. NOT sure is install(1) called during install process strips the object as well and whether that is the thing triggered also by --enable-debug. Hmm, I think I found the old bug report. It was reverse situation: I wanted fully optimized binary and for that I had to set --disable-debug .:( Bug #232748. Anyway, this bug was about the backlashes and single quotes around.
(In reply to comment #15) > I'm not sure if --enable-debug takes options at all It does since a patch in Bug #284767#c15 went in. Do not know whether the observations of Wan-Teh Chang about difference meanings of the --enable-debug are still valid (comments #10 to #12).
Please reopen. It happened to me again. It does not happen when I use client.mk (maybe because in mozconfig I pass in only a single value) but when I run configure directly. If this is unsupported approach please tell me, document it and prevent users from doing so. ;-) $ unset CVSROOT $ python client.py checkout $ make -f client.mk build [went fine through] $ ./configure --disable-optimize --enable-debug='-g3 -O0 -ggdb' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-pango Adding configure options from ./.mozconfig: --disable-optimize --enable-debug=-ggdb -O0 --enable-debug-modules=all [cut] updating cache ./config.cache creating ./config.status creating config/autoconf.mk configuring in mozilla running /bin/sh ./configure --disable-optimize '--enable-debug=-ggdb -O0' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --disable-optimize '--enable-debug=-g3\ -O0\ -ggdb' --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi --enable-pango --enable-application=../suite --disable-official-branding --with-branding=../suite/branding/nightly --cache-file=.././config.cache --srcdir=. loading cache .././config.cache [cut] checking for libhildonmime... checking for libosso... checking for liblocation gpsbt... checking for valid debug flags... no configure: error: These compiler flags are invalid: -g3\ -O0\ -ggdb configure: error: ./configure failed for mozilla mokrejs@vrapenec$ make /usr/bin/gmake -C mozilla default gmake[1]: Entering directory `/home/mmokrejs/proj/comm-central/src/mozilla' gmake[1]: *** No rule to make target `default'. Stop. gmake[1]: Leaving directory `/home/mmokrejs/proj/comm-central/src/mozilla' make: *** [default] Error 2 $ cat ../.mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-sm mk_add_options AUTOCONF=autoconf-2.13 ac_add_options --disable-optimize --enable-debug=-ggdb --enable-debug-modules=all --enable-debugger-info-modules --enable-detect-webshell-leaks --enable-svg --enable-svg-renderer-libart --enable-image-decoders=all --with-qtdir=/usr/qt/3 --enable-application=suite --disable-freetype2 --enable-jprof --enable-default-toolkit=cairo-gtk2 --enable-xft --disable-gssapi $ My previous and more or less still current build was Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3pre) Gecko/20090801 SeaMonkey/2.0b2pre
Resolution: WORKSFORME → FIXED
As I said before in comment #15 - "I suspect we still run into it there, as I don't know of any change to those things." Thanks for proving that, it's better to know it's there than to believe it would have been fixed when it hasn't ;-)
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → NEW
Ever confirmed: true

The build files have changed countless time since 2010 and we are now more or less using the mozilla ones in 2.57. If you encounter an error with 2.53 and up please open a new bug.

Status: NEW → RESOLVED
Closed: 15 years ago5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: