public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* Checking is unexpected when cross compiling libstdc++ for RISCV
@ 2023-06-12  3:19 Jerry Lin
  2023-06-12  6:46 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jerry Lin @ 2023-06-12  3:19 UTC (permalink / raw)
  To: libstdc++

[-- Attachment #1: Type: text/plain, Size: 1915 bytes --]

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/riscvgnutoolchain/build/build-gcc-newlib-stage2/./gcc/xgcc -shared-libgcc -B/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/./gcc -nostdinc++ -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/.libs -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-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-elf/sys-include    -c -Os   -mcmodel=medlow  conftest.cpp >&5
configure:75551: $? = 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 reference to `getentropy'`. The expected checking result is `no`.

I wanna ask how can I remove the `-c` option and which option controls it.
Could anyone help me? Thanks!


BR,
Jerry


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Checking is unexpected when cross compiling libstdc++ for RISCV
  2023-06-12  3:19 Checking is unexpected when cross compiling libstdc++ for RISCV Jerry Lin
@ 2023-06-12  6:46 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-06-12  6:46 UTC (permalink / raw)
  To: Jerry Lin; +Cc: libstdc++

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/riscvgnutoolchain/build/build-gcc-newlib-stage2/./gcc/xgcc -shared-libgcc -B/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/./gcc -nostdinc++ -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/.libs -L/local/jerry/llvm-test-suite/Phoenix/working/riscvgnutoolchain/build/build-gcc-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-elf/sys-include    -c -Os   -mcmodel=medlow  conftest.cpp >&5
> configure:75551: $? = 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 reference 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-12  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12  3:19 Checking is unexpected when cross compiling libstdc++ for RISCV Jerry Lin
2023-06-12  6:46 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).