Bug 1160875

Summary: libtirpc fails with -fno-common
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: Thomas Blume <thomas.blume>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: alynx.zhou, martin.liska, petr.vorel
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1160244    

Description Martin Liška 2020-01-14 09:48:50 UTC
The package fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:M/libtirpc/standard/x86_64

Please take a look at the META issue for the instructions.
Comment 1 Martin Liška 2020-02-04 11:31:27 UTC
May I please ping this issue?
Comment 2 Thomas Blume 2020-02-05 11:31:57 UTC
(In reply to Martin Liška from comment #1)
> May I please ping this issue?

Unfortunately, declaring the problematic variables as extern doesn't work here, maybe because they are supposed to be internal.
Therefore I've added the patch below, which makes the package compile:

-->
diff --git a/src/rpc_com.h b/src/rpc_com.h
index 10bec79..ec21f8d 100644
--- a/src/rpc_com.h
+++ b/src/rpc_com.h
@@ -61,8 +61,8 @@ void __xprt_unregister_unlocked(SVCXPRT *);
 void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *);
 
 
-SVCXPRT **__svc_xports;
-int __svc_maxrec;
+SVCXPRT **__svc_xports __attribute__ ((common));
+int __svc_maxrec __attribute__ ((common));
 
 #ifdef __cplusplus
 }
-- 
2.16.4
--<

Would that be ok?
I have testpackages at:

https://build.opensuse.org/package/show/home:tsaupe:branches:Base:System:libtirpc-bsc1160875/libtirpc
Comment 3 Martin Liška 2020-02-05 11:36:41 UTC
Yes, that will work.
Comment 4 Petr Vorel 2020-02-05 14:19:37 UTC
Upstream fix works, verified with gcc-10 from devel:gcc and also on Debian gcc-10, so I'm going to backport it

http://git.linux-nfs.org/?p=steved/libtirpc.git;a=commitdiff;h=daed7eedba73907730241c5262a5c16c7abedb6f;hp=342aa6c11d8dd2cb7cf5c2db5c38e8ccabbb1b24
Comment 5 Petr Vorel 2020-02-05 14:28:02 UTC
Fix: https://build.opensuse.org/request/show/770306
I tested it, but can you please also verify it?
Comment 6 Martin Liška 2020-02-05 14:33:39 UTC
(In reply to Petr Vorel from comment #5)
> Fix: https://build.opensuse.org/request/show/770306
> I tested it, but can you please also verify it?

Yes, this seems fine to me. Thanks for working on that.
Comment 7 Thomas Blume 2020-02-05 15:02:58 UTC
(In reply to Martin Liška from comment #6)
> (In reply to Petr Vorel from comment #5)
> > Fix: https://build.opensuse.org/request/show/770306
> > I tested it, but can you please also verify it?
> 
> Yes, this seems fine to me. Thanks for working on that.

Indeed, I've missed the upstream patch, thanks Petr.
Comment 8 Petr Vorel 2020-02-05 21:37:38 UTC
Thanks for confirmation, forwarded to factory as https://build.opensuse.org/request/show/770402
Comment 9 Martin Liška 2020-03-02 11:56:37 UTC
Fixed in devel project.