[Bug lto/84995] Documentation gcc-ar and gcc-ranlib vs {libdir}/bfd-plugins

dilyan.palauzov at aegee dot org gcc-bugzilla@gcc.gnu.org
Wed Mar 21 18:47:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84995

--- Comment #2 from Дилян Палаузов <dilyan.palauzov at aegee dot org> ---
gcc-ar always uses the latest plugin:

$ cat t.c
  #include <stdio.h>
  int main() {
    printf("Z\n");
  }

$ x86_64-pc-linux-gnu-gcc-6.4.1  -flto t.c -C -o t.o
$ strace gcc-ar rc t.a t.o   prints:
stat("/usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../x86_64-pc-linux-gnu/bin/liblto_plugin.so",
0x7fff52b52030) = -1 ENOENT (No such file or directory)
stat("/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.1/liblto_plugin.so",
{st_mode=S_IFREG|0755, st_size=95328, ...}) = 0
access("/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.1/liblto_plugin.so",
R_OK) = 0

$ strace gcc-nm t.a    prints:

stat("/usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../x86_64-pc-linux-gnu/bin/liblto_plugin.so",
0x7ffd682c9970) = -1 ENOENT (N
o such file or directory)
stat("/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.1/liblto_plugin.so",
{st_mode=S_IFREG|0755, st_size=95328, ...}) = 0
access("/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.1/liblto_plugin.so",
R_OK) = 0

it seems that the last installed liblto_plugin.so version is used, even if old
gcc did the object file.


More information about the Gcc-bugs mailing list