Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build static GNU toolchain #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luismarques
Copy link
Collaborator

No description provided.

@jwnrt
Copy link
Contributor

jwnrt commented Jan 11, 2024

I coincidentally just tried the same thing locally!

I think the binaries still dynamically link to libc:

[jw bin]$ ldd riscv32-unknown-elf-gcc
	linux-vdso.so.1 (0x00007fff99ac0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f75a8e00000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f75a91b7000)

@luismarques
Copy link
Collaborator Author

I think the binaries still dynamically link to libc:

[jw bin]$ ldd riscv32-unknown-elf-gcc
	linux-vdso.so.1 (0x00007fff99ac0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f75a8e00000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f75a91b7000)

Are you sure you tried for the right archive? I do see static executables.

(I downloaded the rv32imcb-toolchains.zip with a sha256 of 3a4ce3967dbdb3758fa02b0934298ec98fe92af729ebeefe8c0caccf63e5c5a7).

@jwnrt
Copy link
Contributor

jwnrt commented Jan 11, 2024

Ok, perhaps I'm wrong. This is the diff I used:

--- a/lowrisc-toolchain-gcc-rv32imcb.config
+++ b/lowrisc-toolchain-gcc-rv32imcb.config
@@ -34,6 +34,8 @@ CT_TOOLCHAIN_BUGURL="[email protected]"
 CT_DOWNLOAD_AGENT_CURL=y
 
 CT_CC_GCC_STATIC_LIBSTDCXX=y
+CT_STATIC_TOOLCHAIN=y
+CT_GDB_CROSS_STATIC=y
 # CT_CC_GCC_LDBL_128 is not set
 CT_CC_LANG_CXX=y
 CT_GCC_V_9=y

And the executable I checked was at gcc/.build/riscv32-unknown-elf/buildtools/bin/riscv32-unknown-elf-gcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants