http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60690

            Bug ID: 60690
           Summary: Chromium build error with LTO
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

Created attachment 32467
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32467&action=edit
testcase

markus@x4 tmp % cat simple_idct.i
static int __attribute__ ((used)) wm1010;
void fn1 ()
{
  __asm__(" \nmovq 0, %%mm3 \nmovq wm1010(%%rip), %%mm4 "
          "\nmovq %%mm0, 0 \nmovq %%mm0,0 \nmovq %%mm0,0  "
          " \nmovq %%mm0,0  \n2: "
          "\nmovq 0, %%mm0 \nmovq 0, %%mm1 \nmovq 0, "
          "%%mm2 \nmovq 0, %%mm3  \nmovq %%mm0, %%mm4 "
          "\npsrad $20, %%mm2 \npsrad $20, %%mm5 \nmovq %%mm6, "
          "%%mm2 \npsrad $20, %%mm5 \nmovq %%mm6, %%mm4 "
          "\npsrad $20, %%mm0 \npsrad $20, %%mm2 \npackssdw "
          "%%mm7, %%mm7 \nmovd %%mm7,0 \npackssdw %%mm0, "
          "%%mm2 \npsrad $20, %%mm5 \nmovq %%mm6, %%mm4 "
          "\nmovd %%mm6,0 \nmovd %%mm4,0 \nmovd %%mm4, %%eax  "
          "\norl %%eax, %%eax \njz 0 "
          "\nmovq 0, %%mm4 \npmaddwd %%mm0, %%mm5 "
          "\npsrad $11, %%mm7 \npsrad $11, %%mm4 "
          "\n# .p2align \n6: movq 0, %%mm1 "
          " \npsrad $20, %%mm6  \npsrad $20, %%mm2 \n9: \n"
          :);
}

markus@x4 tmp % gcc -flto -O2 -fPIC -shared dsputil_init.i simple_idct.i
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccQnT34K.ltrans1.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against 'wm1010' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status

(dsputil_init.i is just a unit to trigger LTO partitioning)

markus@x4 tmp % gcc -O2 -fPIC -shared dsputil_init.i simple_idct.i
markus@x4 tmp % gcc -flto -flto-partition=none -O2 -fPIC -shared dsputil_init.i
simple_idct.i
markus@x4 tmp %

Reply via email to