sophgo / zsbl Goto Github PK
View Code? Open in Web Editor NEWSOPHGO RISC-V Zero Stage BootLoader
License: GNU General Public License v2.0
SOPHGO RISC-V Zero Stage BootLoader
License: GNU General Public License v2.0
Hi, when using the distro toolchain on my pioneer, I get build failures that are due to the stack protector symbols being unresolved (the compiler enables -fstack-protector
by default). For example,
ld -r -o libzsbl.a --whole-archive common/built-in.a arch/riscv/src/built-in.a drivers/built-in.a lib/built-in.a plat/built-in.a test/built-in.a --no-whole-archive
/usr/lib/gcc/riscv64-unknown-linux-musl/14/../../../../riscv64-unknown-linux-musl/bin/ld: drivers/sd/mmc.o: in function `mmc_send_cmd':
/home/mjo/src/zsbl.git/build/../drivers/sd/mmc.c:40:(.text.mmc_send_cmd+0x8): undefined reference to `__stack_chk_guard'
/usr/lib/gcc/riscv64-unknown-linux-musl/14/../../../../riscv64-unknown-linux-musl/bin/ld: /home/mjo/src/zsbl.git/build/../drivers/sd/mmc.c:62:(.text.mmc_send_cmd+0x90): undefined reference to `__stack_chk_fail'
...
One way to work around this is with -fno-stack-protector
, but maybe there is a way to keep the stack protection? If this were a normal userland program, it would need to link with libc and/or libssp_nonshared depending on the libc. But obviously that won't work for ZSBL. I do know that the linux kernel has some support for a stack protector though so there must be some way to do it.
Hi, if I am using the distro toolchain on the pioneer (and not cross-compiling with the bundled GCC), I get a build failure due to a relocation:
ld -r -o libzsbl.a --whole-archive common/built-in.a arch/riscv/src/built-in.a drivers/built-in.a lib/built-in.a plat/built-in.a test/built-in.a --no-whole-archive
/usr/lib/gcc/riscv64-unknown-linux-musl/14/../../../../riscv64-unknown-linux-musl/bin/ld: arch/riscv/src/vector.o: warning: relocation against `_fw_start' in read-only section `.vector'
/usr/lib/gcc/riscv64-unknown-linux-musl/14/../../../../riscv64-unknown-linux-musl/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status
This can be worked around with -Wl,-znotext
but there is probably a better solution.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.