This is the mail archive of the glibc-bugs@sourceware.org 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]

[Bug math/21264] Selective static linking of libm.a fails due to unresolved _dl_x86_cpu_features symbol


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

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |carlos at redhat dot com
         Resolution|---                         |INVALID

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Florian Weimer from comment #0)
> Example from the downstream bug report:
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> 
> int main(int argc, char **argv)
> {
>         printf("string:%s\n",argv[1]);
> 	float input=strtof(argv[1],NULL);
> 	printf("input:%f\n",input);
>         float result;
>         result = sin(input);
>         printf("%f\n",result);
> 	return 0;
> }
> 
> GCC command line (note that libm is linked statically, but libc is linked
> dynamically):
> 
> gcc test.c -Wl,-Bstatic -lm -Wl,-Bdynamic -lc 
> 
> Actual results:
> 
> Linker error message:
> 
> /usr/lib64/libm-2.25.90.a(s_sin.o): In function `__cos_ifunc':
> (.text+0x4d22): undefined reference to `_dl_x86_cpu_features'
> /usr/lib64/libm-2.25.90.a(s_sin.o): In function `__sin_ifunc':
> (.text+0x4d52): undefined reference to `_dl_x86_cpu_features'
> 
> I'm not sure if it is reasonable for our users to expect this to work, but
> so far we did not actively prevent that from happening.

This would mix old / new libm.a with old / new libc.so.6 / ld.so and that's not
supported.

Either you link statically or you link dynamically. The entire runtime has to
come together to form the basis of the implementation.

The exceptions are things like NSS modules which have some special caveats
here.

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

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