This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Properly do the LTO bytecode version check
- From: Richard Biener <rguenther at suse dot de>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Mar 2014 13:49:23 +0100 (CET)
- Subject: Re: [PATCH] Properly do the LTO bytecode version check
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1403041220480 dot 11121 at zhemvz dot fhfr dot qr> <20140304123910 dot GE21053 at lug-owl dot de>
On Tue, 4 Mar 2014, Jan-Benedict Glaw wrote:
> On Tue, 2014-03-04 12:22:12 +0100, Richard Biener <rguenther@suse.de> wrote:
> >
> > We're doing the LTO bytecode version check only for two section
> > types at the moment - specifically _not_ for the first section
> > we read. Which causes us to crash instead of reporting a
> > version mismatch ...
> >
> > Fixed by doing the version check in the most appropriate place.
> >
> > LTO bootstrapped on x86_64-unknown-linux-gnu, applied.
> >
> > Richard.
> >
> > 2014-03-04 Richard Biener <rguenther@suse.de>
> >
> > PR lto/60405
> > * lto-streamer-in.c (lto_read_body): Remove LTO bytecode version
> > check.
> > (lto_input_toplevel_asms): Likewise.
> > * lto-section-in.c (lto_get_section_data): Instead do it here
> > for every section.
>
> Breaks for the Build Robot with g++ (GCC) 4.9.0 20131121 like this:
>
> g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -o lto-section-in.o -MT lto-section-in.o -MMD -MP -MF ./.deps/lto-section-in.TPo ../../../gcc/gcc/lto-section-in.c
> ../../../gcc/gcc/lto-section-in.c: In function âconst char* lto_get_section_data(lto_file_decl_data*, lto_section_type, const char*, size_t*)â:
> ../../../gcc/gcc/lto-section-in.c:177:37: error: cast from type âconst char*â to type âlto_header*â casts away qualifiers [-Werror=cast-qual]
> lto_check_version (((lto_header *)data)->major_version,
> ^
> ../../../gcc/gcc/lto-section-in.c:178:23: error: cast from type âconst char*â to type âlto_header*â casts away qualifiers [-Werror=cast-qual]
> ((lto_header *)data)->minor_version);
> ^
> cc1plus: all warnings being treated as errors
> make[2]: *** [lto-section-in.o] Error 1
>
>
> See eg.
> http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=156703
> --> http://toolchain.lug-owl.de/buildbot/deliver_artifact.php?mode=view&id=1152984
>
> MfG, JBG
Bah - I committed the wrong version ...
Richard.