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] New: Selective static linking of libm.a fails due to unresolved _dl_x86_cpu_features symbol


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

            Bug ID: 21264
           Summary: Selective static linking of libm.a fails due to
                    unresolved _dl_x86_cpu_features symbol
           Product: glibc
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
            Target: x86_64

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.

-- 
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]