From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0ED6A3858C54 for ; Wed, 26 Apr 2023 19:06:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0ED6A3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682535991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JevsmzojXFTeljzasi8Toxb/Qcr5jeOE05N2wRL9jTA=; b=gPWMw5PM6zWHdQPJBqYr00t4r3fRhdc5A90ooZE4RUB5bNjRGXd60n5ABcilDBFq7Aaupp pCWUeocZhJbNSJYUH5BoqaMNRnMoBAi84tdOzJ/LGt0sG493ubdeulJLR32FvuM25tJAfz i8reCDoBLWn6TBUBGv0U//4SFzwNN6s= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-38-QZ06dyTwO9qE5ZMG9o8mqQ-1; Wed, 26 Apr 2023 15:06:28 -0400 X-MC-Unique: QZ06dyTwO9qE5ZMG9o8mqQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2621A3C025AD; Wed, 26 Apr 2023 19:06:28 +0000 (UTC) Received: from localhost (unknown [10.42.28.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id E38A510DDC; Wed, 26 Apr 2023 19:06:27 +0000 (UTC) Date: Wed, 26 Apr 2023 20:06:27 +0100 From: Jonathan Wakely To: Andrew Pinski Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] GCC-13/changes: Add note about iostream usage Message-ID: References: <20230426165347.599616-1-apinski@marvell.com> MIME-Version: 1.0 In-Reply-To: <20230426165347.599616-1-apinski@marvell.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 26/04/23 09:53 -0700, Andrew Pinski wrote: >This adds a note about iostream usage so it does not catch others >in surpise like it has already. > >OK? Thanks, I agree we should add something, but have some comments below. >--- > htdocs/gcc-13/changes.html | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html >index 70732ec0..7c83f7c4 100644 >--- a/htdocs/gcc-13/changes.html >+++ b/htdocs/gcc-13/changes.html >@@ -25,6 +25,11 @@ You may also want to check out our > >

Caveats

>
    >+
  • libstdc++ uses constructors inside the library to initialize std::cout/std::cin, etc. >+ instead of having it done in each source which uses iostream header. We should use code font for std::cout, std::cin and iostream, and style it as not just iostream. >+ This requires you to make sure the dynamic loader to load the new libstdc++v3 library >+ (examples of how to do this is to use -Wl,-rpath,... while linking or LD_LIBRARY_PATH >+ while running the program).
  • I think it would be better to link to https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic How about:
  • For C++, construction of the global iostream objects std::cout, std::cin etc. is now done inside the standard library, instead of in every source file that includes the <iostream> header. This change improves the start-up performance of C++ programs, but it means that code compiled with GCC 13.1 will crash if the correct version of libstdc++.so is not used at runtime. See the documentation about using the right libstdc++.so at runtime.