| Summary: | monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc. | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | syntheticpp |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | buildroot, syntheticpp, yann.morin.1998 |
| Priority: | P5 | ||
| Version: | 2014.08 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
defconfig
generated .config |
||
Logging in via ssh is delayed, looks like it runs into a timeout. (strace shows that a select() on the client IP is paused) Normally, static linking with glibc is not possible, just because of this issue: all that has to deal with names (usernames, groups, hostnames...) need dynamic linking, becasue glibc uses libnss, which dlopen()s the backend libraries, such as libnss_files.so. How did you manage to have a statically-linked monit when using a glibc toolchain? Care to share your .config, please? Regards, Yann E. MORIN. >
> How did you manage to have a statically-linked monit when using a
> glibc toolchain? Care to share your .config, please?
>
It's the configuration of 2014.08 no changes by me.
>
> GCC warns while linking:
> y.tab.c:(.text+0x379c): warning: Using 'getpwuid' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
This warning also shows up in the build which works (eglibc 2.18)
> It's the configuration of 2014.08 no changes by me.
Sorry, this does not make sense:
- there is no default configuration in Buildroot;
- the default C library is uClibc, not glibc/eglibc.
So, yes, you did some configuration.
Please provide your .config file.
Regards,
Yann E. MORIN.
Created attachment 5588 [details]
defconfig
Created attachment 5594 [details]
generated .config
Indeed, the build warns about the use os the NSS functions in statically linked applications. However, this is only a warning, and not a build failure. monit should not build a static application to start with. Changing the subject to reflect the real issue. Regards, Yann E. MORIN. When the C library is glibc/eglibc, we copy those files to the target:
LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.*
Can you confirm those files are present in your target?
Regarding the delay to login: what is your authentication method? Maybe there are a few other libnss files tht should be copied over...
Regards,
Yann E. MORIN.
I have a patch I'm currently testing... Regards, Yann E. MORIN. (In reply to comment #9) > When the C library is glibc/eglibc, we copy those files to the target: > LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.* > > Can you confirm those files are present in your target? Yes, they are. > > Regarding the delay to login: what is your authentication method? Maybe there > are a few other libnss files tht should be copied over... In meantime I saw it also with the other build, so not related to this bug here. > > Regards, > Yann E. MORIN. Hello!
We believe this isuue has now been fixed with this changeset:
http://git.buildroot.org/buildroot/commit/?id=03f388619a4dfa2835774702a54504b56e2e00e0
I'm closing the issue now. If you believe this does not fix your
problem, be sure to re-open this issue for further investigations.
Thank you for the report! :-)
Regards,
Yann E. MORIN.
|
monit exits in src/env.c: struct passwd *pw; /* Get password struct */ if ( ! (pw= getpwuid(geteuid())) ) { LogError("%s: You don't exist. Go away.\n", prog); exit(1); } Only happens with glibc and eglibc 2.19 (tested with GCC 4.9.1), 2.18 is fine. GCC warns while linking: y.tab.c:(.text+0x379c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking Somehow libnss related?