From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id B27D33858D28 for ; Mon, 12 Jun 2023 06:46:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B27D33858D28 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-ej1-x62a.google.com with SMTP id a640c23a62f3a-976a0a1a92bso723576566b.1 for ; Sun, 11 Jun 2023 23:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686552400; x=1689144400; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GrRtB20KhNAaTI/PoqZsZnFCE+EbgmiTWfaET8Id0oA=; b=lOVXxxVzALqq01b6Cm/XQUtV8kVFs/AtTmQYjf/NXt4j+eo+qkfuV/rJ0q2rPJUh7e WJYSXxcUlXZtfSOu/7eaoq4QKPj0+Ya+ra7irNwxr8KKiuLJ/QFBmiEDHBL99GmdRBNg G0s6/H9XLRdc1+KRIfSWR8Jgs+m/RMz5pIsUAUlBWhUBIBSZdhe/TcP++tefMNTEbnKv 4w2tGKGeNP/YLKYE9a+4T4892rRjUHIb9KAnSKoYIGoCCk7YS4qVYd3a471cQ6f6FM5n Zmz1Iog4e38CTSehrSSTZgL47ZFxF14fRBoHKioHbQ6DmIBEAUn6MYuiZldFXypZVtRP pJYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686552400; x=1689144400; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GrRtB20KhNAaTI/PoqZsZnFCE+EbgmiTWfaET8Id0oA=; b=brh1w8Vfg38VJCrf2aSk8AS6SnXXhp17eBN0PMG/TqT75kvaNVvhyZt2XJYY6EiEQC TvumL8aCNkUNQnC5YEBap+Yerm3Qv2/t+nI91u+DTem15P6HCFYBcOFBhNCw23zZKaM3 3iiwnvbNKWcFP0KXDxYLq1EnwiT8lQ309Usm0zeEzAm897k0uX1wEYbWMnAUIq8OcK1O xn7D0LYsfpJYwJcyZxA35gfxGF9l+ayFuEbqo9Mi2Q/2rvmEteyDX9OUwzEIZ4k+Gf9/ rIaUNcCqSOGy4CVwK/FEMGpIvpQH922XtNlUfKwZoRSlOTcpu5UkSwoPmSxBlTvM02mo Qgbw== X-Gm-Message-State: AC+VfDw0Ik/Mvjg2ua0FnLY2JcVqb2Gg9vS1mysmrqySnPjYw5Zt95hf s9pNxqErjGf8/Km0zJTtGgt08ygIcHKLz+lBk7w= X-Google-Smtp-Source: ACHHUZ4AfVUATPT+rPE3pDQP+5icjhU/DMiCUtPHGIen5HuJtWnkzjsWrjELOmegfoFk0i3QeHy5M799w0vGY9Kgr9c= X-Received: by 2002:a17:906:eec5:b0:969:bac4:8e22 with SMTP id wu5-20020a170906eec500b00969bac48e22mr9108588ejb.26.1686552400175; Sun, 11 Jun 2023 23:46:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 12 Jun 2023 07:46:29 +0100 Message-ID: Subject: Re: Checking is unexpected when cross compiling libstdc++ for RISCV To: Jerry Lin Cc: "libstdc++@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 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: On Mon, 12 Jun 2023 at 04:19, Jerry Lin wrote: > > Hi, there, > > I am using https://github.com/riscv-collab/riscv-gnu-toolchain to build a= RISCV toolchain. I redirected the newlib link in riscv-gnu-toolchain repo = to a local customized version by `--with-newlib-src` configure option. > However, when checking `getentropy` in build-gcc-newlib-stage2 step, the = checking command is not expected. > In config.log we can see the checking command is: > ###################### > configure:75532: checking for getentropy > configure:75551: /local/jerry/llvm-test-suite/Phoenix/working/riscvgnuto= olchain/build/build-gcc-newlib-stage2/./gcc/xgcc -shared-libgcc -B/local/je= rry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newli= b-stage2/./gcc -nostdinc++ -L/local/jerry/llvm-test-suite/Phoenix/working/r= iscvgnutoolchain/build/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc+= +-v3/src -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/b= uild/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/.libs -L/= local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-g= cc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/libsupc++/.libs -B/local/= jerry/llvm-test-suite/Phoenix/lt-release/riscv64-unknown-elf/bin/ -B/local/= jerry/llvm-test-suite/Phoenix/lt-release/riscv64-unknown-elf/lib/ -isystem = /local/jerry/llvm-test-suite/Phoenix/lt-release/riscv64-unknown-elf/include= -isystem /local/jerry/llvm-test-suite/Phoenix/lt-release/riscv64-unknown-e= lf/sys-include -c -Os -mcmodel=3Dmedlow conftest.cpp >&5 > configure:75551: $? =3D 0 > configure:75583: result: yes > ####################### > In fact, I expect the right command is without `-c` option. And the right= compile command without `-c` option should fails with message `undefined r= eference to `getentropy'`. The expected checking result is `no`. > > I wanna ask how can I remove the `-c` option and which option controls it= . Is this a cross-compiler? We do not do link tests for cross-compilers, so I think it's expected that if the function is declared in the header then configure detects it as present. I think it's been suggested that for some cross-compilers with a linker that is known to work we could do link tests, but that would require changes to how libstdc++ is confiured.