Bug 10314 - nscd fails to link when configuring with --disable-hidden-plt
Summary: nscd fails to link when configuring with --disable-hidden-plt
Status: RESOLVED WONTFIX
Alias: None
Product: glibc
Classification: Unclassified
Component: nscd (show other bugs)
Version: 2.10
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-23 09:21 UTC by URA Hiroshi
Modified: 2014-07-01 07:57 UTC (History)
1 user (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description URA Hiroshi 2009-06-23 09:21:56 UTC
I tried building glibc-2.10.1 with disable-hidden-plt configure option, nscd
failed to link due to the following error:

 make[2]: Entering directory `/home/ura/glibc/glibc-2.10.1/nscd'
 connections.c: In function nscd_run_worker:
 connections.c:1724: warning: no return statement in function returning non-void
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/connections.o: In
function `nscd_init':
 /home/ura/glibc/glibc-2.10.1/nscd/connections.c:528: warning: warning:
inotify_init1 is not implemented and will always fail
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/getpwnam_r.o: In
function `__getpwnam_r':
 /home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: undefined reference
to `__nss_next2'
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/getpwuid_r.o: In
function `__getpwuid_r':
 /home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: undefined reference
to `__nss_next2'
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/getgrnam_r.o: In
function `__getgrnam_r':
 /home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: undefined reference
to `__nss_next2'
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/getgrgid_r.o: In
function `__getgrgid_r':
 /home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: undefined reference
to `__nss_next2'
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/gethstbyad_r.o: In
function `__gethostbyaddr2_r':
 /home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: undefined reference
to `__nss_next2'
 /home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/gethstbynm3_r.o:/home/ura/glibc/glibc-2.10.1/nscd/../nss/getXXbyYY_r.c:268: more undefined references to `__nss_next2' follow
 collect2: ld returned 1 exit status
make[2]: *** [/home/ura/glibc/glibc-2.10.1/build-i686-linuxnptl/nscd/nscd] Error 1
 make[2]: Leaving directory `/home/ura/glibc/glibc-2.10.1/nscd'
 make[1]: *** [nscd/others] Error 2
 make[1]: Leaving directory `/home/ura/glibc/glibc-2.10.1'
 make: *** [all] Error 2
Comment 1 Ulrich Drepper 2009-06-23 15:12:51 UTC
Then don't use the option.  This is why the Makefile rules are what they are.
Comment 2 URA Hiroshi 2009-08-25 07:21:15 UTC
I see, but I need glibc with --disable-hidden-plt.

I found the cause of this link error. The cause is the "atrribute_hidden" in
the declaration of "__nss_next2()" occurres. The link successes by appling
the following patch.


--- nss/nsswitch.h.orig	2009-08-19 16:59:31.000000000 +0900
+++ nss/nsswitch.h	2009-08-19 17:03:43.000000000 +0900
@@ -127,7 +127,7 @@
    natural end.  */
 extern int __nss_next2 (service_user **ni, const char *fct_name,
 			const char *fct2_name, void **fctp, int status,
-			int all_values) attribute_hidden;
+			int all_values);
 libc_hidden_proto (__nss_next2)
 extern int __nss_next (service_user **ni, const char *fct_name, void **fctp,
 		       int status, int all_values);
(In reply to comment #1)
> Then don't use the option.  This is why the Makefile rules are what they are.

(In reply to comment #1)
> Then don't use the option.  This is why the Makefile rules are what they are.