From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id AEFBB385841A for ; Tue, 30 Aug 2022 18:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEFBB385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x536.google.com with SMTP id z41so8011219ede.0 for ; Tue, 30 Aug 2022 11:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc; bh=GfTHA+XmOQr6Irj1xESD534wU6U5j14/fCq/Q80iO+Y=; b=CnYFlaRsuqwkZGxp+BKYAKatsjTrC4/1Bb2yDk42uMv2jCmSPj24rExlRA4kz0Sj+/ qiw0DNtfDzDFHGp9WBkptK6p+hjGRS6ceD3R+ZFbX2CcgirW/xvyv2yfK0zlgleoaBYk CwH8kxhBmMco7twnCdXjTAW1s3MRJPJQyGnu1uZ3GDTfgo+B67HxWby8RL64hozlrFLd k7RyAfa2+Wc6DZMYBlAPPpxw1ygmG+A2k5MY3efDwdRPd6s5Vxgm3jk5G218w4q1NrXL hdCFDALKkvyhjIcrNlPfGSudBWWzv1NnwQzdD9yPIXkq2jWHqrN+IixOuV/2LEm5uGtA pMeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=GfTHA+XmOQr6Irj1xESD534wU6U5j14/fCq/Q80iO+Y=; b=vBEAuQQVTIEuXeM38NTm/v7Ioeht7zi2rvl1d4kqhtnqWkbJAQC3DZbF+7ZXgKGK57 qPn5gjyu9e54GVDtKiNMRpQilQbGWy3jZzQA6bmIW77xAnf9TrNT5sFtrgz5YFo2jSNe K05mcMChH/HrcIGWbNgJ4ND6zMOUR5kqvtKXUVmPYgnfqrxPusgEVFe0mPPXeMCZMFG7 yGelDwOjhuK8Q0+yUbQPnDn1AOkSbVgdt5yTksm0o5et2qwi9Ask+5W2zNhYvuJ+G9kN 074bxWs+i1HqIMq9dXcwjhT/1RFL85Uu35bDjhaH7NtcMEU0nWIGyDsljhc3rB4w37hp 1QAQ== X-Gm-Message-State: ACgBeo3bBXNqZPrLNh+RsMArBP587G9kDSh8KqxrhSSt6GpgHaksYBJM edxnx8gYoD82CCgSPvn1FNU= X-Google-Smtp-Source: AA6agR5sIAZF6B+AVzgE3j7OaGHmdqQS5ZX3RKNmLiC0OWGxly+uHFgJ6QSvC1LzA2hfRs46+S1XRg== X-Received: by 2002:a05:6402:27cf:b0:448:706c:184b with SMTP id c15-20020a05640227cf00b00448706c184bmr9034530ede.1.1661885210402; Tue, 30 Aug 2022 11:46:50 -0700 (PDT) Received: from [192.168.0.152] (ip1f10f159.dynamic.kabel-deutschland.de. [31.16.241.89]) by smtp.gmail.com with ESMTPSA id vp10-20020a17090712ca00b0072b1bc9b37fsm6141599ejb.22.2022.08.30.11.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 11:46:49 -0700 (PDT) Message-ID: <7d0bd41ee0e5fd9de922e35fe4d1312488635ce8.camel@gmail.com> Subject: Re: Relation between gcc version and libstdc++ version From: Anton =?ISO-8859-1?Q?W=F6llert?= To: Jonathan Wakely Cc: "gcc-help@gcc.gnu.org" Date: Tue, 30 Aug 2022 20:46:48 +0200 In-Reply-To: References: <4161b707473552ce74c41c8867c2cc6d77ff4e05.camel@gmail.com> <0951c3b4584404fab95dd7d92af8b6f301b758c7.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: Thanks for your comments, sorry for posting on the wrong mailing list. I'll just restate my initial question here on gcc-help again: I was trying to build a cross-compilation toolchain for a specific target using a newer GCC version, than the one that the binaries were build on the target. The C part seems to work well, but the C++ part doesn't. It seems that the G++ ships it's own libstdc++ include headers. If this libstdc++ is newer than the one one the target, I get undefined references (because there are some newer implementation details and things like that). Is it possible to tell G++/GCC to use the libstdc++.so from the target and also to use the C++ headers (like iostream) from the target? If not, is there any reason this is hard-coded? With clang it looks like you can specify "any" libstdc++ version you want, although I haven't tested it yet. On Tue, 2022-08-30 at 18:21 +0100, Jonathan Wakely wrote: > This doesn't belong on this mailing list though, please use the gcc- > help list instead. > > This list is for discussion of GCC development, not help using it. > > > > > C++ in general > > > tries to be very good in backward compatibility. > > > This essentially means that you can't use newer compilers with > > > more > > > features/bugfixes to compile software for older targets. > > > > > > No it doesn't. Using new compilers on older machines works fine. > > You just need to do it right. > > So what is the right way to compile software with a newer version of gcc for a target, that has an older version of gcc? I can't find any hints about that in documentation. Should I ship the newer libstdc++.so with the application to the target and set LD_LIBRARY_PATH? Then I probably also have to add other libraries, right? Kind regards, Anton