Trouble with apbuild dependencies
Scott Pakin <[email protected]> Tue, 10 Mar 2009 20:56:42 -0600
| Newsgroups | gmane.comp.autopackage.devel |
|---|---|
| Message-ID | <[email protected]> |
makepackage is complaining that my apbuild-built package still has
dependencies on glibc 2.3:
Generating payload and package file...
Checking ELF binaries for highest GLIBC versions used ... done with warnings
WARNING: Symbols from glibc 2.3 (or newer) were found. Consider using apbuild to allow users of older distros to run this binary.
If you are statically linking any libraries, make sure they are compiled with apbuild too.
I tracked the problem down to the use of the realpath() function call
in one of my files. Consider the attached reproducer, dep23.c.
When I compile dep23.c with apgcc, a dependency on glibc 2.3 remains:
$ apgcc -o dep23 dep23.c
$ objdump -p dep23 | grep GLIBC
0x0d696913 0x00 03 GLIBC_2.3
0x0d696910 0x00 02 GLIBC_2.0
Commenting out the printf() line or otherwise eliminating the
realpath() invocation removes the dependency on glibc 2.3:
$ apgcc -o dep23 dep23.c
$ objdump -p dep23 | grep GLIBC
0x0d696910 0x00 02 GLIBC_2.0
I stepped through apgcc, and it looks like apgcc is deferring to gcc's
"-Wl,--as-needed" flag so the problem may be with gcc (or ld) instead
of apgcc. I tried forcing $capabilities{as_needed}=0 to give apgcc a
chance to fix things, but that didn't help.
Any idea why realpath() induces a dependency on glibc 2.3 and what I
can do to eliminate that dependency?
Thanks,
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected]
For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected]
dep23.c
(text/x-csrc, 213 B)
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
char resolved_path[PATH_MAX+1];
printf("Absolute path = %s\n", realpath(argv[1], resolved_path));
return 0;
}