[llvm-bugs] [Bug 38455] Optimizing to library calls with -ffreestanding and -O0
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Nov 14 10:59:21 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=38455
bzt <bztemail at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WONTFIX
--- Comment #10 from bzt <bztemail at gmail.com> ---
Hi Tim,
I've made peace with clang not supporting some gcc features. I believe what
caused the problem is the undocumented -nolibc argument, somehow implied by
-nostartfiles (more precisely it's only documented for the GNU ld, but clearly
gcc won't generate calls to memcpy, memset etc. when used, therefore the issue
maybe not related to -ffreestanding).
I decided to go on with workarounds: I've implemented those memory functions
for all the architectures I work with, and now that I don't have linking
errors, and I don't care why memset is called in my meminit, everything is
working just fine (and there's no __builtin_trap() either with -O0). I have to
debug my run-time linker though, because lld generates a little bit different
ELF structures than GNU ld. But I'm sure that's on me, as I have made some
GNU-specific assumption in my code I was unaware of.
Anyway, I'd like to say thanks again for your help, and I think we can safely
close this issue.
Cheers,
bzt
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181114/be30bfca/attachment.html>
More information about the llvm-bugs
mailing list