-fstack-protector not set when precompiling headers

Bug #346126 reported by Kees Cook
2
Affects Status Importance Assigned to Milestone
gcc-4.3 (Ubuntu)
Fix Released
Medium
Matthias Klose

Bug Description

Binary package hint: gcc-4.3

FAIL: gcc.dg/pch/static-3.c -O0 -g assembly comparison
FAIL: gcc.dg/pch/static-3.c -O0 assembly comparison

line #20
< movl $0, -8(%rbp)
> movl $0, -4(%rbp)
line #21
< movl -8(%rbp), %eax
> movl -4(%rbp), %eax
line #22
< movl %eax, -4(%rbp)
> movl %eax, -8(%rbp)
line #26
< movl -4(%rbp), %eax
> movl -8(%rbp), %eax
line #31
< addl %eax, -8(%rbp)
> addl %eax, -4(%rbp)
line #33
< addl $1, -4(%rbp)
> addl $1, -8(%rbp)
line #35
< cmpl $99, -4(%rbp)
> cmpl $99, -8(%rbp)
line #38
< movl -8(%rbp), %eax
> movl -4(%rbp), %eax
line #268
< .sleb128 -20
> .sleb128 -24
line #276
< .sleb128 -24
> .sleb128 -20

When forcing -fstack-protector or -fno-stack-protector, this test passes. In examining what gcc calls (via "-v"), it appears that -fstack-protector is not being passed for the header compilation stage, but is passed when building the final .s, resulting in the above assembly difference (the stack contains 1 extra word: the canary).

This is probably a bug in the spec file patches for stack-protector.

Kees Cook (kees)
Changed in gcc-4.3:
importance: Undecided → Low
milestone: none → later
status: New → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

please recheck

Changed in gcc-4.3 (Ubuntu):
importance: Low → Medium
Revision history for this message
Kees Cook (kees) wrote :

I have confirmed this to fix the pch testsuite errors. Thanks!

Changed in gcc-4.3 (Ubuntu):
assignee: nobody → doko
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.3 - 4.3.3-8ubuntu1

---------------
gcc-4.3 (4.3.3-8ubuntu1) karmic; urgency=low

  * Merge with Debian; remaining changes:
    - Built from upstream tarball, regenerate the control file.

  [Samuel Thibault]
  * Fix gcj build on hurd-i386. Closes: #524671.

  [Arthur Loiret]
  * Update to SVN 20090426 from the gcc-4_3-branch.
    - Fix PR fortran/39791 PR target/39496 PR c++/38228 PR c++/39639,
      PR bootstrap/39739.
  * Always set $(distribution) to "Debian" on mips/mipsel, workarounds FTBFS
    on those archs due to a kernel bug triggered by lsb_release call.
    Closes: #524416.
  * Configure the SPU cross compiler without --enable-multiarch.

  [Matthias Klose]
  * libgcj-doc: Fix documentation title.
  * gappletviewer: Include missing binary.
  * Remove the gcc-4.3-base.postinst. Closes: #524708.
  * Remove conflicts for *-spu packages.
  * Don't build anymore packages built from the gcc-4.4 source.
  * Don't include debug symbols for libstdc++.so.6, if the library is
    built by a newer GCC version.

gcc-4.3 (4.3.3-8) unstable; urgency=low

  [Arthur Loiret]
  * Update to SVN 20090415 from the gcc-4_3-branch.
    - Fix PR target/39634, PR c++/28301, PR c++/39637, PR c++/35146,
      PR c++/39480.
    - Fix PR target/39740. Closes: #523040, #523655.
  * Fix PR middle-end/38360, adapted from the trunk. Closes: #491115.
  * Regenerate gcc/configure in the multiarch patch. Closes: #523869.

  [Matthias Klose]
  * On arm and armel, install the arm_neon.h header. LP: #360819.
  * When hardening options are turned on by default, patch the testsuite
    to handle the hardening defaults (Kees Cook).

gcc-4.3 (4.3.3-7) unstable; urgency=low

  * Update to SVN 20090406 from the gcc-4_3-branch.
    - Fix PR rtl-optimization/39588, PR objc/27377, PR c++/38030,
      PR c++/38850, PR c++/39070, PR fortran/39519.

gcc-4.3 (4.3.3-6) experimental; urgency=low

  [Matthias Klose]
  * Update to SVN 20090329 from the gcc-4_3-branch.
    - Fix PR fortran/39295, PR fortran/39292, PR c++/9634, PR c++/29469,
      PR c++/29607, PR target/39327, PR c++/39425, PR target/39482,
      PR target/39477 (doc).
    - Remove libjava-xulrunner-1.9, integrated upstream.
  * Fix PR target/39431, taken from the trunk.
  * Fix build failure building the ppc spu cross compiler.
  * Fix PR target/39175, taken from the trunk. LP: #342335. Closes: #518462.
  * Update the spu cross compiler from the cell-gcc-4_3-branch 20090314.
  * Add support to build vfp optimized runtime libraries on armel.
  * gcc-4.3-spu: Depend on newlib-spu.
  * Fix sections of -dbg and java packages.
  * gcc-default-ssp.dpatch: Set the default as well, when calling the
    preprocessor. LP: #346126.
  * Remove more autoconf2.59 stuff, let gcc-4.3-source depend on autoconf2.59.
  * Explicitely use autom4te2.59 from the autoconf2.59 package.

  [Arthur Loiret]
  * Run the 64-bit tests with -mabi=64 instead of -m64 on mips/mipsel to
    hopefully fix the massive failure.
  * Use the autoconf2.59 package.

 -- Matthias Klose <email address hidden> Sun, 26 Apr 2009 20:17:31 +0200

Changed in gcc-4.3 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.