bugGNU GRUB - Bugs: bug #35484, Build fails when CFLAGS=-O2 in the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #35484: Build fails when CFLAGS=-O2 in the environment

Submitter:  Grégoire Sutre <gsutre>
Submitted:  Wed 08 Feb 2012 04:46:08 PM UTC
   
 
Category:  Compilation Severity:  Ordinary
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  Bazaar - trunk
Release:  Reproducibility:  Every Time
Planned Release:  None

Wed 08 Feb 2012 11:08:19 PM UTC, comment #3: 

Yes, the build completes successfully with the patch (and with CFLAGS=-O2).

Regarding your previous comment, this was with a recent compiler on Debian GNU/Linux.

$ gcc --version
gcc (Debian 4.6.2-11) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I forgot to mention it.

Grégoire Sutre <gsutre>
Group Member
Wed 08 Feb 2012 08:35:11 PM UTC, comment #2: 

Attached patch may help

(file #25030)

Vladimir Serbinenko <phcoder>
Group administrator
Wed 08 Feb 2012 08:21:16 PM UTC, comment #1: 

You need to disable werror when using an old compiler.

Vladimir Serbinenko <phcoder>
Group administrator
Wed 08 Feb 2012 04:46:08 PM UTC, original submission:  

With a fresh grub trunk export, the following commands lead to a build error:

$ export CFLAGS=-O2
$ (./autogen.sh && ./configure && make) > /tmp/build.log 2>&1
$ tail -10 /tmp/build.log
make[3]: Entering directory `/tmp/GREG/grub/grub-core'
gcc -DHAVE_CONFIG_H -I. -I..   -Wall -W -I../include -I../include  -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -DGRUB_TARGET_CPU_I386=1 -m32 -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -DGRUB_FILE=\"gnulib/regex.c\" -I. -I. -I.. -I.. -I../include -I../include  -I../grub-core/lib/posix_wrap -I../grub-core/gnulib -I../grub-core/gnulib                -Os -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines  -mrtd -mregparm=3       -fno-builtin -fno-builtin -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter              -O2 -MT gnulib/libgnulib_a-regex.o -MD -MP -MF gnulib/.deps-core/libgnulib_a-regex.Tpo -c -o gnulib/libgnulib_a-regex.o `test -f 'gnulib/regex.c' || echo './'`gnulib/regex.c
In file included from gnulib/regex.c:62:0:
gnulib/regcomp.c: In function 're_compile_fastmap_iter.isra.14':
../include/grub/misc.h:218:5: error: 'wc' may be used uninitialized in this function [-Werror=uninitialized]
gnulib/regcomp.c:327:16: note: 'wc' was declared here
cc1: all warnings being treated as errors

make[3]: * [gnulib/libgnulib_a-regex.o] Error 1
make[3]: Leaving directory `/tmp/GREG/grub/grub-core'
make[2]: * [all] Error 2
make[2]: Leaving directory `/tmp/GREG/grub/grub-core'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/tmp/GREG/grub'
make: * [all] Error 2

Is having CFLAGS=-O2 in the environment unsupported?

Grégoire Sutre <gsutre>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #25030:  1.diff added by phcoder (21KiB - text/x-diff)
file #25026:  build.log added by gsutre (189KiB - text/x-log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by gsutre (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-09 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2012-02-08 phcoder Attached File- Added 1.diff, #25030
    2012-02-08 gsutre Attached File- Added build.log, #25026

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code