This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: /cvs/libc/nscd/connections.c:1008: undefined reference to `__stack_chk_guard'


On Fri, Jul 22, 2005 at 07:22:32AM +0200, Andreas Jaeger wrote:
> 
> Building current CVS glibc with GCC 4.1 CVS fails for me with:
> 
> /opt/gcc/4.1-devel/bin/gcc   -pie -Wl,-O1    -Wl,-dynamic-linker=/usr/src/install-glibc/lib/ld-linux-x86-64.so.2     -B/builds/glibc/4.1+nptl/csu/           -L/builds/glibc/4.1+nptl -L/builds/glibc/4.1+nptl/math -L/builds/glibc/4.1+nptl/elf -L/builds/glibc/4.1+nptl/dlfcn -L/builds/glibc/4.1+nptl/nss -L/builds/glibc/4.1+nptl/nis -L/builds/glibc/4.1+nptl/rt -L/builds/glibc/4.1+nptl/resolv -L/builds/glibc/4.1+nptl/crypt -L/builds/glibc/4.1+nptl/nptl -Wl,-rpath-link=/builds/glibc/4.1+nptl:/builds/glibc/4.1+nptl/math:/builds/glibc/4.1+nptl/elf:/builds/glibc/4.1+nptl/dlfcn:/builds/glibc/4.1+nptl/nss:/builds/glibc/4.1+nptl/nis:/builds/glibc/4.1+nptl/rt:/builds/glibc/4.1+nptl/resolv:/builds/glibc/4.1+nptl/crypt:/builds/glibc/4.1+nptl/nptl   -o /builds/glibc/4.1+nptl/nscd/nscd /builds/glibc/4.1+nptl/nscd/nscd.o /builds/glibc/4.1+nptl/nscd/connections.o /builds/glibc/4.1+nptl/nscd/pwdcache.o /builds/glibc/4.1+nptl/nscd/getpwnam_r.o /builds/glibc/4.1+nptl/nscd/getpwuid_r.o /builds/glibc/4.1+nptl/nscd/grpcache.o /builds/glibc/4.1+nptl/nscd/getgrnam_r.o /builds/glibc/4.1+nptl/nscd/getgrgid_r.o /builds/glibc/4.1+nptl/nscd/hstcache.o /builds/glibc/4.1+nptl/nscd/gethstbyad_r.o /builds/glibc/4.1+nptl/nscd/gethstbynm2_r.o /builds/glibc/4.1+nptl/nscd/dbg_log.o /builds/glibc/4.1+nptl/nscd/nscd_conf.o /builds/glibc/4.1+nptl/nscd/nscd_stat.o /builds/glibc/4.1+nptl/nscd/cache.o /builds/glibc/4.1+nptl/nscd/mem.o /builds/glibc/4.1+nptl/nscd/nscd_setup_thread.o /builds/glibc/4.1+nptl/nscd/xmalloc.o /builds/glibc/4.1+nptl/nscd/xstrdup.o /builds/glibc/4.1+nptl/nscd/aicache.o /builds/glibc/4.1+nptl/nscd/initgrcache.o /builds/glibc/4.1+nptl/nscd/gai.o /builds/glibc/4.1+nptl/rt/librt.so /builds/glibc/4.1+nptl/nptl/libpthread_nonshared.a /builds/glibc/4.1+nptl/nptl/libpthread.so /builds/glibc/4.1+nptl/nis/libnsl.so  /builds/glibc/4.1+nptl/libc_nonshared.a
> /builds/glibc/4.1+nptl/nscd/nscd.o(.text+0x118): In function `nscd_open_socket':
> /cvs/libc/nscd/nscd.c:409: undefined reference to `__stack_chk_guard'
> /builds/glibc/4.1+nptl/nscd/connections.o(.text+0x1f9): In function `restart':
> /cvs/libc/nscd/connections.c:848: undefined reference to `__stack_chk_guard'
> /builds/glibc/4.1+nptl/nscd/connections.o(.text+0x3a8):/cvs/libc/nscd/connections.c:976: undefined reference to `__stack_chk_guard'
> /builds/glibc/4.1+nptl/nscd/connections.o(.text+0x5e4): In function `nscd_run':
> /cvs/libc/nscd/connections.c:1008: undefined reference to `__stack_chk_guard'
> /builds/glibc/4.1+nptl/nscd/connections.o(.text+0x1257): In function `nscd_init':
> /cvs/libc/nscd/connections.c:205: undefined reference to `__stack_chk_guard'
> /builds/glibc/4.1+nptl/nscd/connections.o(.text+0x14f9):/cvs/libc/nscd/connections.c:562: more undefined references to `__stack_chk_guard' follow
> collect2: ld returned 1 exit status
> 
> The problem seems to be that my build environment uses glibc 2.3.5:
> * gcc builds libssp
> * But the above link command does not use libssp, if I add -lssp, the
>   link is successfull
> 
> This looks like some kind of bootstrap problem.  What should be done
> here?

Well, there are 2 options I think:
1) the -fstack-protector check in configure is changed, so that it tests
   for -fstack-protector supported and doesn't need -lssp
   (so in your case nscd wouldn't be stackguard protected until you
   compile with a GCC built against recent glibc)
2) there is an additional configure check if -lssp is needed and
   if it is needed, nscd is also linked against -lssp_nonshared -lssp.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]