public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions
@ 2010-10-15 17:44 viriketo at gmail dot com
  2010-10-15 21:27 ` [Bug nscd/12125] " viriketo at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: viriketo at gmail dot com @ 2010-10-15 17:44 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

           Summary: Problems linking nscd under certain gcc conditions
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nscd
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: viriketo@gmail.com


The 'nscd' makefile reads:
ifeq (yes,$(have-ssp))
nscd-cflags += -fstack-protector
endif
...
ifeq (yesyes,$(have-fpie)$(build-shared))
relro-LDFLAGS += -Wl,-z,now

$(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
    $(+link-pie)
endif



And the link-pie defined in 'Makeconfig' says to use "-nostdlib" in the gcc
linking call.

The check for the stack protector does not use "-nostdlib", so a simple
"-fstack-protector" succeeds. Here is the gcc spec part:
*link_ssp:
%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}

*link_command:
... %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)} ...

So, the trouble appears when glibc is:
- build as shared
- -fpie found
- -fstack-protector found

Because it tries to link nscd with -nostdlib but without supplying
-lssp_noshared -lssp

This problem happens in glibc 2.12.1 and glibc 2.11 at least.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
@ 2010-10-15 21:27 ` viriketo at gmail dot com
  2010-10-15 23:18 ` viriketo at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: viriketo at gmail dot com @ 2010-10-15 21:27 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

--- Comment #1 from Lluís <viriketo at gmail dot com> 2010-10-15 21:27:28 UTC ---
Created attachment 5064
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5064
Proposal for the fix

Here is a patch over glibc 2.12.1, of what I came up with to overcome the stack
protector libraries linking problem.
The best would be to look at the gcc specs to get what libraries the stack
protector will enable, through some configure settings, I imagine. But by now
this fits my situation.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
  2010-10-15 21:27 ` [Bug nscd/12125] " viriketo at gmail dot com
@ 2010-10-15 23:18 ` viriketo at gmail dot com
  2010-10-26  3:11 ` drepper.fsp at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: viriketo at gmail dot com @ 2010-10-15 23:18 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

--- Comment #2 from Lluís <viriketo at gmail dot com> 2010-10-15 23:18:13 UTC ---
Created attachment 5065
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5065
For static linking with libssp

Due to the usua gcc/glibc/gcc bootstrap procedure, it may be of interest of the
user to link to libssp statically. Then, the patch can go like this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
  2010-10-15 21:27 ` [Bug nscd/12125] " viriketo at gmail dot com
  2010-10-15 23:18 ` viriketo at gmail dot com
@ 2010-10-26  3:11 ` drepper.fsp at gmail dot com
  2010-10-26  7:18 ` viriketo at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2010-10-26  3:11 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

--- Comment #3 from Ulrich Drepper <drepper.fsp at gmail dot com> 2010-10-26 03:11:44 UTC ---
What are you talking about?  Linux platforms shouldn't (mustn't?) need libssp.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
                   ` (2 preceding siblings ...)
  2010-10-26  3:11 ` drepper.fsp at gmail dot com
@ 2010-10-26  7:18 ` viriketo at gmail dot com
  2010-10-26 18:55 ` viriketo at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: viriketo at gmail dot com @ 2010-10-26  7:18 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

--- Comment #4 from Lluís <viriketo at gmail dot com> 2010-10-26 07:18:11 UTC ---
Sorry, I am not aware of what should have libssp and what not.

Do you mean that Linux systems should not have libssp installed, from gcc?
Should we install gcc with "--disable-libssp"? Otherwise it gets installed.

I understand that the 'glibc' configure system tries "-fstack-protector", and
if it is available, it builds nscd with it. This is how it behaves here, and
this is what I understand from the Makefiles.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
                   ` (3 preceding siblings ...)
  2010-10-26  7:18 ` viriketo at gmail dot com
@ 2010-10-26 18:55 ` viriketo at gmail dot com
  2010-10-27  2:38 ` pasky at suse dot cz
  2014-06-30  7:49 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: viriketo at gmail dot com @ 2010-10-26 18:55 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

--- Comment #5 from Lluís Batlle <viriketo at gmail dot com> 2010-10-26 18:54:52 UTC ---
I investigated a bit, and I understood why my gcc built libssp. It did not find
the glibc headers, as I don't have it in the place it looked for them:
/usr/include.

I adapted my gcc 'configure' script, and then this problem disappears.

As for me, you can close the report if you want.

Thank you.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
                   ` (4 preceding siblings ...)
  2010-10-26 18:55 ` viriketo at gmail dot com
@ 2010-10-27  2:38 ` pasky at suse dot cz
  2014-06-30  7:49 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: pasky at suse dot cz @ 2010-10-27  2:38 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12125

Petr Baudis <pasky at suse dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |pasky at suse dot cz
         Resolution|                            |INVALID

--- Comment #6 from Petr Baudis <pasky at suse dot cz> 2010-10-27 02:38:14 UTC ---
I'm closing it then. :)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug nscd/12125] Problems linking nscd under certain gcc conditions
  2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
                   ` (5 preceding siblings ...)
  2010-10-27  2:38 ` pasky at suse dot cz
@ 2014-06-30  7:49 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-30  7:49 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12125

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-30  7:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15 17:44 [Bug nscd/12125] New: Problems linking nscd under certain gcc conditions viriketo at gmail dot com
2010-10-15 21:27 ` [Bug nscd/12125] " viriketo at gmail dot com
2010-10-15 23:18 ` viriketo at gmail dot com
2010-10-26  3:11 ` drepper.fsp at gmail dot com
2010-10-26  7:18 ` viriketo at gmail dot com
2010-10-26 18:55 ` viriketo at gmail dot com
2010-10-27  2:38 ` pasky at suse dot cz
2014-06-30  7:49 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).