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

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

Reply via email to