-snip- #include <stdio.h> main() { printf ("Hello World!\n"); } -snip- $ gcc -save-temps -fstack-protector -fPIE hello.c -o hello $ ./hello $ Hello World! $ gcc -save-temps -fstack-protector-all -fPIE helloall.c -o helloall $ ./helloall $ Segmentation fault helloall.s segfaults, hello.s runs fine. if -fstack-protector isn't to be supported on arm, it gcc should ignore the option like done on mips/mipsel. Package source: gcc-4.3 GCC version: 4.3.1 Base Debian version: 4.3 Configured with: -v --with-pkgversion='Debian 4.3.0-3' --with-bugurl='file:///usr/share/doc/gcc-4.3/README.Bugs' --enable-languages=c,c++,fortran,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-libffi --enable-mpfr --disable-libssp --disable-sjlj-exceptions --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi Target: arm-linux-gnueabi Configured with: ../src/configure linux gnueabi Thread model: posix gcc version 4.3.1 20080401 (prerelease) (Debian 4.3.0-3)
Created attachment 15489 [details] working arm assembly produced from hello world
Created attachment 15490 [details] segfaulting arm assemble of hello world
This is also reproducible with codesourcery 2008q1 Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /scratch/sandra/lite/src/gcc-4.2/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion=Sourcery G++ Lite 2008q1-126 --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/libc --enable-poison-system-directories --with-build-time-tools=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/sandra/lite/linux/install/arm-none-linux-gnueabi/bin Thread model: posix gcc version 4.2.3 (Sourcery G++ Lite 2008q1-126)
I've posted a candidate fix: http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01641.html
*** Bug 36480 has been marked as a duplicate of this bug. ***
Subject: Bug 35965 Author: dougkwan Date: Wed Feb 25 07:18:01 2009 New Revision: 144424 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144424 Log: 2009-02-24 Julian Brown <julian@codesourcery.com> PR target/35965 * config/arm/arm.c (require_pic_register): Only set cfun->machine->pic_reg once per function. Patch commited by Doug Kwan <dougkwan@google.com> Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c
This is fixed in trunk and will be picked up by 4.4. However, this is broken at least in 4.3.1 and probably in all 4.3 releases.
From comment #7 this appears to be only a problem with the 4.3 branch.
Not a regression. Fixed for 4.4.0.