Bug 10375 - glibc can be built only if -U_FORTIFY_SOURCE is added to CFLAGS
Summary: glibc can be built only if -U_FORTIFY_SOURCE is added to CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.10
: P2 normal
Target Milestone: 2.16
Assignee: Carlos O'Donell
URL:
Keywords:
: 11180 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-07 19:16 UTC by booleandomain
Modified: 2014-07-01 07:51 UTC (History)
9 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Last reconfirmed: 2012-02-29 00:00:00
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description booleandomain 2009-07-07 19:16:55 UTC
I cannot compile glibc-2.10.1 with gcc-4.3.3. Make fails with the following
error message:

x86_64-pc-linux-gnu-gcc ../sysdeps/unix/sysv/linux/syslog.c -c -std=gnu99
-fgnu89-inline -O2 -Wall -Winline
-Wl,--dynamic-linker,/tools/lib64/ld-linux-x86-64.so.2 -Wwrite-strings
-fmerge-all-constants -march=core2 -Wstrict-prototypes   -fexceptions  
-I../include -I/home/booleandomain/tmp/lfs/sources/glibc-build/misc
-I/home/booleandomain/tmp/lfs/sources/glibc-build -I../sysdeps/x86_64/elf
-I../nptl/sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86_64
-I../sysdeps/unix/sysv/linux/wordsize-64 -I../nptl/sysdeps/unix/sysv/linux
-I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux
-I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
-I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv
-I../sysdeps/unix/x86_64 -I../nptl/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/x86_64/fpu -I../nptl/sysdeps/x86_64
-I../sysdeps/x86_64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754
-I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl  -I.. -I../libio -I.
-nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include-fixed -isystem /tools/include
-D_LIBC_REENTRANT -include ../include/libc-symbols.h       -o
/home/booleandomain/tmp/lfs/sources/glibc-build/misc/syslog.o -MD -MP -MF
/home/booleandomain/tmp/lfs/sources/glibc-build/misc/syslog.o.dt -MT
/home/booleandomain/tmp/lfs/sources/glibc-build/misc/syslog.o 
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123: sorry, unimplemented: inlining failed in call to 'syslog':
function body not available
../misc/syslog.c:155: sorry, unimplemented: called from here
make[2]: *** [/home/booleandomain/tmp/lfs/sources/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/home/booleandomain/tmp/lfs/sources/glibc-2.10.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/home/booleandomain/tmp/lfs/sources/glibc-2.10.1'
make: *** [all] Error 2

Glibc was configured as follows: --prefix=/tools --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --with-headers=/tools/include --enable-kernel=2.6.30

The only way I know to fix this is to add -U_FORTIFY_SOURCE to the CFLAGS.
Comment 1 Ulrich Drepper 2009-07-17 06:00:40 UTC

*** This bug has been marked as a duplicate of 333 ***
Comment 2 Jeffrey Yasskin 2012-02-29 09:50:15 UTC
This looks like http://gcc.gnu.org/PR46596.
Comment 3 Carlos O'Donell 2012-02-29 13:58:10 UTC
I can confirm this. My build scripts all have -U_FORTIFY_SOURCE in CFLAGS. I'll have a look at fixing this.
Comment 4 Carlos O'Donell 2012-02-29 13:59:58 UTC
*** Bug 11180 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Johnson 2012-04-24 20:17:59 UTC
Confirmed here as well.
Comment 6 Roland McGrath 2012-05-07 21:42:01 UTC
Note compilers (like Debian/Ubuntu) that predefine _FORTIFY_SOURCE also implicitly set -fstack-protector, which I think is also a problem for building libc.
Comment 7 Jonathan Nieder 2012-05-14 04:55:35 UTC
(In reply to comment #6)
> Note compilers (like Debian/Ubuntu) that predefine _FORTIFY_SOURCE also
> implicitly set -fstack-protector, which I think is also a problem for building
> libc.

To avoid confusion: Debian gcc does not predefine _FORTIFY_SOURCE or
implicitly set -fstack-protector.  Ubuntu gcc does, though.
Comment 8 Roland McGrath 2012-05-16 23:24:35 UTC
Fixed in trunk.
Comment 9 Jackie Rosen 2014-02-16 19:22:43 UTC
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.