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

Newlib baremetal C++ fails with "qemu-system-aarch64: rom check and register reset failed" on QEMU run and "relocation truncated to fit: R_AARCH64_PREL32 against `.text'" on gem5 build #119

Open
cirosantilli opened this issue Mar 23, 2020 · 0 comments

Comments

@cirosantilli
Copy link
Owner

TODO not working as of 8825222 + 1. Not yet properly researched / reported upstream yet.

Should not be hard in theory since libstdc++ is just part of GCC, as shown at: https://stackoverflow.com/questions/21872229/how-to-edit-and-re-build-the-gcc-libstdc-c-standard-library-source/51946224#51946224

To test it out, I first hack link:common.py[] to enable C++:

consts['baremetal_build_in_exts'] = consts['build_in_exts']

and then I hack link:userland/arch/aarch64/inline_asm/multiline.cpp[] to consist only of an empty main:

int main() {}

then for example:

./build-baremetal --arch aarch64
./run --arch aarch64 --baremetal userland/arch/aarch64/inline_asm/multiline.cpp

fails with:

rom: requested regions overlap (rom dtb. free=0x00000000000000a0, addr=0x0000000000000000)
qemu-system-aarch64: rom check and register reset failed

and the gem5 build fails completely:

./build-baremetal --arch aarch64 --emulator gem5 userland/arch/aarch64/inline_asm/multiline.cpp

fails with:

/tmp/ccFd2YIB.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text'
collect2: error: ld returned 1 exit status
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

No branches or pull requests

1 participant