https://bugs.llvm.org/show_bug.cgi?id=37065

            Bug ID: 37065
           Summary: .symver directive not properly handled with -flto=thin
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangb...@nondot.org
          Reporter: thomasander...@google.com
                CC: llvm-bugs@lists.llvm.org

clang version 7.0.0 (trunk 328716)

Using .symver to bind an imported symbol to a specific version causes problems
with LTO.  The symbol with the version appears to be defined when it shouldn't
be.  This causes a build failure when linking multiple bitcode files that both
want to import the symbol as now the symbol is duplicated.

$ cat test.c
#include <math.h>

__asm__(".symver exp2f, exp2f@GLIBC_2.2.5");
float test(float f) {
  return exp2f(f);
}

$ clang test.c -c -o test.o
$ nm test.o | grep exp2f
                 U exp2f@GLIBC_2.2.5

$ clang test.c -c -o test.o -flto=thin
$ llvm-nm-5.0 test.o | grep exp2f
                 U exp2f
                 U exp2f
---------------- T exp2f@GLIBC_2.2.5

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to