Bug 273339 - Build of science/trilinos fails on 14 CURRENT: hidden symbol _ZNSt3__1rsB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_13basic_istreamIT_T0_EES9_RNS_12basic_stringIS6_S7_T1_EE isn't defined
Summary: Build of science/trilinos fails on 14 CURRENT: hidden symbol _ZNSt3__1rsB7v16...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-25 07:06 UTC by Yuri Victorovich
Modified: 2023-10-06 18:13 UTC (History)
3 users (show)

See Also:


Attachments
Fix link error by including <iostream> (783 bytes, patch)
2023-08-30 20:02 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-08-25 07:06:23 UTC

    
Comment 1 Paul Floyd 2023-08-25 08:14:41 UTC
c++filt _ZNSt3__1rsB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_13basic_istreamIT_T0_EES9_RNS_12basic_stringIS6_S7_T1_EE


std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::operator>>[abi:v160006]<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)

basic_istream operator>> on a char
Comment 2 Mark Millard 2023-08-25 09:38:53 UTC
(In reply to Paul Floyd from comment #1)

Just trying to make the overall structure more readable:

std::__1::basic_istream<char, OMITTED>&
std::__1::operator>>[abi:v160006]<char, OMITTED>
    ( std::__1::basic_istream<char, OMITTED>&
    , std::__1::basic_string<char, OMITTED>&
    )

Looks like operator>> from a basic_istream of char to a basic_string of char.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2023-08-30 20:02:11 UTC
Created attachment 244488 [details]
Fix link error by including <iostream>

This should fix the linker error.
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2023-08-31 09:00:33 UTC
(In reply to Dimitry Andric from comment #3)
FWIW, the problem here was that packages/stk/stk_util/stk_util/util/ci_string.hpp declares a bunch of operators on std::istream and std::ostream, and to be able to do that, it includes <iosfwd>, which is a "light-weight" version of <iostream>, that only contains forward declarations.

However, once you get to packages/stk/stk_util/stk_util/util/ci_string.cpp, and you want to _implement_ those operators on std::istream and std::ostream, you actually need the full definitions of the iostream stuff. Hence, you heed to include <iostream> there.

I noticed that meanwhile, upstream seems to have fixed this as a byproduct of a huge commit named "STK: Snapshot 05-02-23 13:00 from Sierra 5.13.3-416-g059a4983". That adds separate includes of <ostream> and <istream> instead, which is weird and superfluous, but should also work.

You might consider importing a more recent version of Trilinos, which should have this fix already. If that is tricky to do, you can apply the temporary patch I provided here.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-10-06 18:13:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1b71aafbb82caa1ffe653a5b128e35d55469587e

commit 1b71aafbb82caa1ffe653a5b128e35d55469587e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-08-30 20:00:53 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-10-06 18:09:12 +0000

    science/trilinos: add missing <iostream> include

    This fixes "hidden symbol
    _ZNSt3__1rsB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_13basic_istreamIT_T0_EES9_RNS_12basic_stringIS6_S7_T1_EE
    isn't defined" errors on recent -CURRENT.

    PR:             273339
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2023Q4

 ...-packages_stk_stk__util_stk__util_util_ci__string.cpp (new) | 10 ++++++++++
 1 file changed, 10 insertions(+)