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

Builds for embedded powerpcle64 have no unmangled memset/memcpy/memmove #67896

Closed
tomtor opened this issue Jan 5, 2020 · 3 comments
Closed

Comments

@tomtor
Copy link

tomtor commented Jan 5, 2020

See antonblanchard/microwatt#125

I have to define my own memset/memcpy/memmove in the calling C-program:

https://github.com/tomtor/microwatt/blob/37bc1f31c2139ec06a56e51ed595e0bc664fdbc8/rust_lib_demo/hello_world.c#L172

This looks related to #56814

@jonas-schievink
Copy link
Contributor

We don't have any embedded (#![no_std]) PowerPC targets. You are building for powerpc64le-unknown-linux-gnu, which assumes that libc provides these functions.

@tomtor
Copy link
Author

tomtor commented Jan 5, 2020

Adding /usr/powerpc64le-linux-gnu/lib/libc.a

gives

/usr/powerpc64le-linux-gnu/lib/libc.a(fileops.o): In function `_IO_new_file_underflow':
(.text+0x628): undefined reference to `_Unwind_Resume'
/usr/powerpc64le-linux-gnu/lib/libc.a(printf_fp.o): In function `__printf_fp_l':
(.text+0x650): undefined reference to `__unordkf2'
(.text+0x68c): undefined reference to `__unordkf2'
(.text+0xcf8): undefined reference to `__lekf2'
/usr/powerpc64le-linux-gnu/lib/libc.a(printf_fphex.o): In function `__printf_fphex':
(.text+0xf8): undefined reference to `__unordkf2'
(.text+0x144): undefined reference to `__unordkf2'
(.text+0x164): undefined reference to `__lekf2'
/usr/powerpc64le-linux-gnu/lib/libc.a(iofputs.o): In function `_IO_fputs':
(.text+0x204): undefined reference to `_Unwind_Resume'
/usr/powerpc64le-linux-gnu/lib/libc.a(iofwrite.o): In function `_IO_fwrite':
(.text+0x2f4): undefined reference to `_Unwind_Resume'
/usr/powerpc64le-linux-gnu/lib/libc.a(iogetdelim.o): In function `_IO_getdelim':
(.text+0x460): undefined reference to `_Unwind_Resume'
Makefile:34: recipe for target 'hello_world.elf' failed

So for some reason not just memcpy is copied in.

I see in #56814 that unmangled versions USED to be in the compiler_builtins but were remove because they are not needed for ARM targets?

@tomtor
Copy link
Author

tomtor commented Jan 5, 2020

We don't have any embedded (#![no_std]) PowerPC targets.

@jonas-schievink Indeed an official tier-2 embedded PowerPC target would be nice, but I would expect that a specific xargo configuration (I already use xargo for building a working soft-float library) would allow use of the current powerpc64le-unknown-linux-gnu target.

I fixed it now with this Xargo.toml:

[target.powerpc64le-unknown-linux-gnu.dependencies]

[dependencies.alloc]
features = ["compiler-builtins-mem"]

@tomtor tomtor closed this as completed Jan 5, 2020
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

2 participants