Am Donnerstag, 25. Juli 2019, 22:43:58 CEST schrieb Brüns, Stefan:
On Donnerstag, 25. Juli 2019 21:39:37 CEST Hans-Peter Jansen wrote:
Am Donnerstag, 25. Juli 2019, 17:26:27 CEST schrieben Sie:
On Jul 25 2019, Hans-Peter Jansen <hpj@urpla.net> wrote:
Without lto, it compiles fine.
But broken nevertheless. LTO just uncovered it.
If you could elaborate in which specific way, I could report this to the asterisk developers.
The two files each have a top level variable "members", which have an implicit "extern" storage class. Any other translation unit ("file") could reference it, and the linker would try to resolve it.
As both both TUs end up in the same binary, the linker has two possibilities for each reference.
Thanks, Stefan, for your feedback.
In this case, probably the best fix is to declare both "members" instances as static.
It's not that easy (at least with my *very* rusty C knowledge), since xpp/ mpptalk.c uses this union from xtalk_raw.c and xtalk_sync.c. I solved it by removing the useless members declaration: Index: b/xpp/mpptalk.c =================================================================== --- a/xpp/mpptalk.c +++ b/xpp/mpptalk.c @@ -237,7 +237,7 @@ union XTALK_PDATA(MPP) { MEMBER(MPP, TWS_PORT_GET_REPLY); MEMBER(MPP, TWS_PWR_GET); MEMBER(MPP, TWS_PWR_GET_REPLY); -} PACKED members; +} PACKED; /* * Statuses Index: b/xpp/xtalk/xtalk_raw.c =================================================================== --- a/xpp/xtalk/xtalk_raw.c +++ b/xpp/xtalk/xtalk_raw.c @@ -48,7 +48,7 @@ CMD_DEF(XTALK, ACK, union XTALK_PDATA(XTALK) { MEMBER(XTALK, ACK); -} PACKED members; +} PACKED; const struct xtalk_protocol xtalk_raw_proto = { .name = "XTALK-RAW", Index: b/xpp/xtalk/xtalk_sync.c =================================================================== --- a/xpp/xtalk/xtalk_sync.c +++ b/xpp/xtalk/xtalk_sync.c @@ -60,7 +60,7 @@ union XTALK_PDATA(XTALK) { MEMBER(XTALK, ACK); MEMBER(XTALK, PROTO_GET); MEMBER(XTALK, PROTO_GET_REPLY); -} PACKED members; +} PACKED; const struct xtalk_protocol xtalk_sync_proto = { .name = "XTALK-SYNC", It compiles with lto enabled at least. What do you think? (I don't have any related hardware, just want asterisk for Tumbleweed..) Cheers, Pete -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org