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/19058] New: [x86_64] Link fail with -fopenmp and -flto


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

            Bug ID: 19058
           Summary: [x86_64] Link fail with -fopenmp and -flto
           Product: glibc
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: andrew.n.senkevich at gmail dot com
  Target Milestone: ---

-bash-4.2$ cat test.c
#include <math.h>
#define size 4096
double x[size];
double y[size];

__attribute__((noinline))
int foo()
{
  int i;

#pragma omp simd
  for (i = 0; i < size; i++)
    {
      x[i] = log(y[i]);
    }

  return (int) x[0];
}

int main()
{
  int i = 0;

  for (i = 0; i < size; i++)
    {
      y[i] = sin(i);
    }

  return (foo());
}

-bash-4.2$ gcc test.c -I/GLIBC_2.22_install/include/ -
L/GLIBC_2.22_install/lib/ -O1 -fopenmp -ffast-math -lm -flto
-flto-partition=max -save-temps
/tmp/ccLnEA3M.ltrans1.ltrans.o: In function `foo':
<artificial>:(.text+0xf): undefined reference to `_ZGVbN2v___log_finite'
collect2: error: ld returned 1 exit status

Asm aliases _ZGV*N*v___log_finite = _ZGV*N*v_log are not enough for build with
-flto because alias and call can be placed in different LTO units:

-bash-4.2$ grep _ZGVbN2v___log_finite *ltrans*
ccRWvqdW.ltrans0.s:     _ZGVbN2v___log_finite = _ZGVbN2v_log
ccRWvqdW.ltrans1.s:     call    _ZGVbN2v___log_finite

GCC version >= 4.9.0
Discussion about these aliases addition:
https://sourceware.org/ml/libc-alpha/2015-06/msg00213.html

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