[OpenAFS-devel] Build fails with gcc 9.1.1

Chaskiel Grundman cgrundman@gmail.com
Mon, 29 Jul 2019 13:35:11 -0400


--00000000000009aaa9058ed5518f
Content-Type: text/plain; charset="UTF-8"

This may be due to bugs in gcc or the linker. The nest of reports is
inconclusive (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490
https://sourceware.org/bugzilla/show_bug.cgi?id=23411
https://www.bountysource.com/issues/60348964-multiple-prevailing-defs-for-unused-variable-in-lto-mode
)

It's likely that part of the problem is that some component didn't decide
that the two different copies of liboafs_ubik.la were the same file and did
not need to be processed independently:
(adding -v after gcc to the actual libtool command)

 /usr/lib/gcc/x86_64-linux-gnu/8/collect2 -plugin
/usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccoT0MYW.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -flto --build-id --eh-frame-hdr -m
elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o pt_util
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/8/crtbeginS.o -L/usr0/openafs/lib
-L/usr/lib/gcc/x86_64-linux-gnu/8
-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-linux-gnu/8/../../.. pt_util.o ptutils.o ptubik.o
utils.o map.o >>>>../../src/ptserver/.libs/liboafs_prot.a
/usr0/openafs/src/ubik/.libs/liboafs_ubik.a
../../src/ubik/.libs/liboafs_ubik.a<<<<
/usr0/openafs/src/auth/.libs/liboafs_auth.a  ...

This patch seems to work around it. It should be safe on all platforms,
since part of what libtool DOES is track and insert indirect dependencies.

diff --git a/src/tptserver/Makefile.in b/src/tptserver/Makefile.in
index cbde711e2..b277a7599 100644
--- a/src/tptserver/Makefile.in
+++ b/src/tptserver/Makefile.in
@@ -24,7 +24,6 @@ INCLS=${TOP_INCDIR}/ubik.h \
        ptint.h

 LIBS_common= \
-       $(top_builddir)/src/ubik/liboafs_ubik.la \
        $(top_builddir)/src/sys/liboafs_sys.la \
        $(top_builddir)/src/rx/liboafs_rx.la \
        $(top_builddir)/src/rxstat/liboafs_rxstat.la \
@@ -36,6 +35,7 @@ LIBS_common= \

 LIBS_server= \
        $(top_builddir)/src/audit/liboafs_audit.la \
+       $(top_builddir)/src/ubik/liboafs_ubik.la \
        $(LIBS_common)

 LIBS_client= \

--00000000000009aaa9058ed5518f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">This may be due to bugs in gcc or the linker. The nest of =
reports is inconclusive (<a href=3D"https://gcc.gnu.org/bugzilla/show_bug.c=
gi?id=3D86490">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D86490</a>=C2=
=A0<a href=3D"https://sourceware.org/bugzilla/show_bug.cgi?id=3D23411">http=
s://sourceware.org/bugzilla/show_bug.cgi?id=3D23411</a>=C2=A0<a href=3D"htt=
ps://www.bountysource.com/issues/60348964-multiple-prevailing-defs-for-unus=
ed-variable-in-lto-mode">https://www.bountysource.com/issues/60348964-multi=
ple-prevailing-defs-for-unused-variable-in-lto-mode</a>)<div><br></div><div=
>It&#39;s likely that part of the problem is that some component didn&#39;t=
 decide that the two different copies of <a href=3D"http://liboafs_ubik.la"=
>liboafs_ubik.la</a> were the same file and did not need to be processed in=
dependently:</div><div>(adding -v after gcc to the actual libtool command)<=
/div><div><br></div><div>=C2=A0/usr/lib/gcc/x86_64-linux-gnu/8/collect2 -pl=
ugin /usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so -plugin-opt=3D/usr/li=
b/gcc/x86_64-linux-gnu/8/lto-wrapper -plugin-opt=3D-fresolution=3D/tmp/ccoT=
0MYW.res -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-through=3D=
-lgcc_s -plugin-opt=3D-pass-through=3D-lpthread -plugin-opt=3D-pass-through=
=3D-lc -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-through=3D-l=
gcc_s -flto --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=3Dgnu --as=
-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o=
 pt_util /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o =
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/lib/g=
cc/x86_64-linux-gnu/8/crtbeginS.o -L/usr0/openafs/lib -L/usr/lib/gcc/x86_64=
-linux-gnu/8 -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L=
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu -L/=
lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86=
_64-linux-gnu/8/../../.. pt_util.o ptutils.o ptubik.o utils.o map.o &gt;&gt=
;&gt;&gt;../../src/ptserver/.libs/liboafs_prot.a /usr0/openafs/src/ubik/.li=
bs/liboafs_ubik.a ../../src/ubik/.libs/liboafs_ubik.a&lt;&lt;&lt;&lt; /usr0=
/openafs/src/auth/.libs/liboafs_auth.a=C2=A0 ...<br></div><div><br></div><d=
iv>This patch seems to work around it. It should be safe on all platforms, =
since part of what libtool DOES is track and insert indirect dependencies.<=
/div><div><br></div><div>diff --git a/src/tptserver/Makefile.in b/src/tptse=
rver/Makefile.in<br>index cbde711e2..b277a7599 100644<br>--- a/src/tptserve=
r/Makefile.in<br>+++ b/src/tptserver/Makefile.in<br>@@ -24,7 +24,6 @@ INCLS=
=3D${TOP_INCDIR}/ubik.h \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ptint.h<br>=C2=A0<=
br>=C2=A0LIBS_common=3D \<br>- =C2=A0 =C2=A0 =C2=A0 $(top_builddir)/src/ubi=
k/<a href=3D"http://liboafs_ubik.la">liboafs_ubik.la</a> \<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 $(top_builddir)/src/sys/<a href=3D"http://liboafs_sys.la">li=
boafs_sys.la</a> \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(top_builddir)/src/rx/<a=
 href=3D"http://liboafs_rx.la">liboafs_rx.la</a> \<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 $(top_builddir)/src/rxstat/<a href=3D"http://liboafs_rxstat.la">libo=
afs_rxstat.la</a> \<br>@@ -36,6 +35,7 @@ LIBS_common=3D \<br>=C2=A0<br>=C2=
=A0LIBS_server=3D \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(top_builddir)/src/audi=
t/<a href=3D"http://liboafs_audit.la">liboafs_audit.la</a> \<br>+ =C2=A0 =
=C2=A0 =C2=A0 $(top_builddir)/src/ubik/<a href=3D"http://liboafs_ubik.la">l=
iboafs_ubik.la</a> \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(LIBS_common)<br>=C2=
=A0<br>=C2=A0LIBS_client=3D \<br></div><div><br></div></div>

--00000000000009aaa9058ed5518f--