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

Pie is not supported #345

Open
chipsme opened this issue Jul 3, 2022 · 1 comment
Open

Pie is not supported #345

chipsme opened this issue Jul 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@chipsme
Copy link

chipsme commented Jul 3, 2022

Hi,
I’m trying to use meta-riscv with Poky. The build is fine. Howerver, when using elf toolchain,the pie is not supported as

Building target: HelloworldDemo.elf
Invoking: GNU RISC-V Cross C Linker
riscv64-poky-elf-gcc -mcmodel=medlow -msmall-data-limit=8 -mno-save-restore -march=rv64imac_zicsr_zifencei -mabi=lp64 -O0 -w  -g -T "" -nostartfiles -Xlinker --gc-sections -Wl,-Map,"HelloworldDemo.map" -o "HelloworldDemo.elf"  ./src/target-specific/libfemto/std/abort.o ./src/target-specific/libfemto/std/clz.o ./src/target-specific/libfemto/std/ctz.o ./src/target-specific/libfemto/std/exit.o ./src/target-specific/libfemto/std/getchar.o ./src/target-specific/libfemto/std/malloc.o ./src/target-specific/libfemto/std/memchr.o ./src/target-specific/libfemto/std/memcmp.o ./src/target-specific/libfemto/std/memcpy.o ./src/target-specific/libfemto/std/memset.o ./src/target-specific/libfemto/std/printf.o ./src/target-specific/libfemto/std/purtchar.o ./src/target-specific/libfemto/std/puts.o ./src/target-specific/libfemto/std/snprintf.o ./src/target-specific/libfemto/std/strchr.o ./src/target-specific/libfemto/std/strcmp.o ./src/target-specific/libfemto/std/strlen.o ./src/target-specific/libfemto/std/strncmp.o ./src/target-specific/libfemto/std/strncpy.o ./src/target-specific/libfemto/std/vprintf.o ./src/target-specific/libfemto/std/vsnprintf.o  ./src/target-specific/libfemto/drivers/htif.o ./src/target-specific/libfemto/drivers/neorv32_uart.o ./src/target-specific/libfemto/drivers/ns16550a.o ./src/target-specific/libfemto/drivers/semihost.o  ./src/target-specific/libfemto/arch/riscv/auxval.o ./src/target-specific/libfemto/arch/riscv/csr.o ./src/target-specific/libfemto/arch/riscv/device.o ./src/target-specific/libfemto/arch/riscv/memory.o ./src/target-specific/libfemto/arch/riscv/pmp.o ./src/target-specific/libfemto/arch/riscv/spinlock.o ./src/target-specific/libfemto/arch/riscv/start.o ./src/target-specific/libfemto/arch/riscv/trap.o  ./src/environmental-support/virt/crt.o ./src/environmental-support/virt/setup.o  ./src/environmental-support/common/rv32/macros.o  ./src/environmental-support/common/constants.o  ./src/HelloworldDemo.o   
~/toolchain/riscv64-poky-elf/sysroots/x86_64-pokysdk-linux/usr/libexec/riscv64-poky-elf/gcc/riscv64-poky-elf/11.2.0/real-ld: -pie not supported
collect2: error: ld returned 1 exit status
make: *** [HelloworldDemo.elf] Error 1
makefile:56: recipe for target 'HelloworldDemo.elf' failed

Can you please give me few hints?
I’m just a newbie with poky and meta-riscv.
Thank you

@kraj
Copy link
Collaborator

kraj commented Jun 14, 2024

@chipsme I think the problem perhaps is in meta/conf/distro/include/security_flags.inc

GCCPIE ?= "--enable-default-pie"

perhaps we should define it to empty string in conf/machine/ baremetal-riscv64.conf

@kraj kraj added the bug Something isn't working label Jun 14, 2024
vishwamartur added a commit to vishwamartur/meta-riscv that referenced this issue Nov 1, 2024
Related to riscv#345

Override the `GCCPIE` flag to an empty string in `conf/machine/baremetal-riscv64.conf`.

* Add a comment explaining the reason for the override to support PIE with the elf toolchain.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/riscv/meta-riscv/issues/345?shareId=XXXX-XXXX-XXXX-XXXX).
kraj pushed a commit that referenced this issue Dec 3, 2024
Related to #345

Override the `GCCPIE` flag to an empty string in `conf/machine/baremetal-riscv64.conf`.

* Add a comment explaining the reason for the override to support PIE with the elf toolchain.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/riscv/meta-riscv/issues/345?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants