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/20723] New: Static linking fails on Haswell and Sandy Bridge


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

            Bug ID: 20723
           Summary: Static linking fails on Haswell and Sandy Bridge
           Product: glibc
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: rlcamp.pdx at gmail dot com
  Target Milestone: ---

The math library in the newest glibc in both Ubuntu 16.10 (2.24-3ubuntu1) and
Debian-testing (2.24-3) cannot be statically linked successfully on Haswell or
Sandy Bridge (when compiling with -static and -march=native, -march=haswell, or
-march-sandybridge). The specific errors are "undefined reference to
_ZGVcN4v_cos" and similar at link time. The problem does not occur when not
statically linking, and does not occur when using -march=nehalem or some other
pre-AVX instruction set. The problem does not occur when using musl-libc rather
than glibc.

cc -static -Ofast  -I/usr/local/include -std=gnu99 -Wall -Werror -Wextra -Wvla
-Wpointer-arith -Wshadow -Wuninitialized -Wno-unused-result
-Wno-unused-parameter -march=native -o [binary name omitted] [.o filenames
omitted] -lpthread -lm
[filename omitted].o: In function `[function name omitted]':
[filename omitted].c:(.text+0x2256): undefined reference to `_ZGVcN4v_cos'
[filename omitted].c:(.text+0x2268): undefined reference to `_ZGVcN4v_cos'
[filename omitted].c:(.text+0x2282): undefined reference to `_ZGVcN4v_sin'
[filename omitted].c:(.text+0x22a0): undefined reference to `_ZGVcN4v_sin'
[filename omitted].o: In function `[function name omitted]':
[filename omitted].c:(.text+0x5ff): undefined reference to `_ZGVcN4v_cos'
[filename omitted].c:(.text+0x60e): undefined reference to `_ZGVcN4v_cos'
[filename omitted].c:(.text+0x625): undefined reference to `_ZGVcN4v_sin'
[filename omitted].c:(.text+0x640): undefined reference to `_ZGVcN4v_sin'
collect2: error: ld returned 1 exit status
Makefile:79: recipe for target '[binary name omitted]' failed
make: *** [[binary name omitted]] Error 1

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