Bug 1926932 - Koji and rawhide machine build fails differently
Summary: Koji and rawhide machine build fails differently
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-09 17:26 UTC by Milan Crha
Modified: 2022-12-13 15:17 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-12-13 15:17:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
zipped build log (23.86 KB, application/octet-stream)
2021-02-09 17:53 UTC, Milan Crha
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 99066 0 P2 NEW [8/9/10/11 Regression] non-weak definition emitted for explicit instantiation declaration 2021-02-11 09:09:03 UTC

Description Milan Crha 2021-02-09 17:26:40 UTC
Trying too build the .src.rpm [1] locally in an up to date rawhide machine results in an error:

{standard input}: Assembler messages:
{standard input}:3224969: Warning: end of file not at end of a line; newline inserted
{standard input}:3225497: Error: unknown pseudo-op: `.u'
g++: fatal error: Terminated signal terminated program cc1plus
compilation terminated.

The machine has installed:
gcc-11.0.0-0.18.fc34.x86_64
gcc-c++-11.0.0-0.18.fc34.x86_64

The same build in koji (I get the same result in the rawhide COPR as in koji, thus I suppose it's the same thing and I wanted to use COPR for easier debugging and the like) fails (full logs in [1]):

/usr/bin/ld: src/syncevo/.libs/libsyncevolution_la-IdentityProvider.o (symbol from plugin): in function `SyncEvo::IdentityProvider::getRegistry[abi:cxx11]()':
(.text+0x0): multiple definition of `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos'; src/syncevo/.libs/libsyncevolution_la-EDSClient.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: src/syncevo/.libs/libsyncevolution_la-ConfigFilter.o (symbol from plugin): in function `SyncEvo::FullProps::hasProperties(SyncEvo::FullProps::PropCheckMode) const':
(.text+0x0): multiple definition of `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos'; src/syncevo/.libs/libsyncevolution_la-EDSClient.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: src/syncevo/.libs/libsyncevolution_la-ConfigNode.o (symbol from plugin): in function `SyncEvo::ConfigNode::writeProperties(SyncEvo::ConfigProps const&)':
(.text+0x0): multiple definition of `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos'; src/syncevo/.libs/libsyncevolution_la-EDSClient.o (symbol from plugin):(.text+0x0): first defined here
.......

and the root.log says there are used:

gcc-11.0.0-0.18.fc34.x86_64
gcc-c++-11.0.0-0.18.fc34.x86_64

thus exactly the same versions as my rawhide machine.

I do not understand the difference in the failure. I build the package locally with `fedpkg local` (because it's the easiest way for me).

I do not understand either of the errors, thus any help with the way to debug it is welcome. The one from koji I thought is related to [2], but I'm not sure how to fix that, as my naive change to not use `const` for a local variable in ConfigFilter.cpp [3] didn't work (and didn't make any difference). Still, that won't explain the difference in the build between Koji and the rawhide machine.

[1] https://download.copr.fedorainfracloud.org/results/mcrha/syncevo2/fedora-rawhide-x86_64/01955677-syncevolution/
[2] https://stackoverflow.com/questions/28761549/c-linker-complains-multiple-definition-of-char-but-not-stdstring
[3] https://download.copr.fedorainfracloud.org/results/mcrha/syncevo2/fedora-rawhide-x86_64/01955914-syncevolution/

Comment 1 Jakub Jelinek 2021-02-09 17:32:41 UTC
The assembler messages you are citing are totally uninteresting, that is just because you are using -pipe and when the compiler crashes or is killed, the assembler sees incompletely assembly.
So, what is really interesting is see what messages the compiler emitted.

Comment 2 Milan Crha 2021-02-09 17:53:36 UTC
Created attachment 1755997 [details]
zipped build log

It looked like the only interesting thing in the log. I attached the full build log, if it'll be helpful.

Comment 3 Milan Crha 2021-02-09 18:05:25 UTC
Okay, running `make -j1` gives the error about the duplicated symbol definition.

I compared the sources (the old and the new version) and the main change was to use std::shared_ptr instead of boost::shared_ptr, aka a move from boost to std classes/templates where applicable. I do not see any other significant change, but I admit I'm not that good in C++ to be sure what is a significant change and what is not.

Do you have any advice on this error, please?

Comment 4 Jakub Jelinek 2021-02-10 18:17:55 UTC
So, seems this has nothing to do with LTO, and is related to the
extern template class std::basic_string<char>;
extern template class std::vector<std::string>;
extern template class std::list<std::string>;
lines in src/syncevo/util.h , removing them makes the problem go away.
cvise reduced testcase that reproduces the problem is:
namespace std {
inline namespace __cxx11 {}
template <typename> class allocator;
template <class> struct char_traits;
inline namespace __cxx11 {
template <typename a, typename = char_traits<a>, typename = allocator<a>>
struct basic_string {
  static const unsigned long npos = 1;
};
}
template <typename a, typename b, typename c>
const unsigned long basic_string<a, b, c>::npos;
template <typename, typename d> struct e { template <bool> d f() const; };
template <typename a, typename d> template <bool> d e<a, d>::f() const {
  basic_string<char>::npos;
}
}
extern template class std::basic_string<char>;

- put this into header, include in two different TUs and link together, one gets a link error.

Comment 5 Milan Crha 2021-02-11 08:56:12 UTC
Thank you for finding the cause. I'll pass it to the upstream developer.

Do you think it's a code issue to declare such things in the header or it's a compiler issue?

I just checked and these lines (apart of may other) had been added in the src/syncevo/util.h in the 1.99.2 pre-release.

Comment 6 Ben Cotton 2021-08-10 12:51:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 7 Ben Cotton 2022-11-29 16:51:48 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Ben Cotton 2022-12-13 15:17:37 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.