Summary: | sys-libs/newlib-2.0.0 - non-assembly memset broken with -O3 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexander Holler <holler> |
Component: | [OLD] Development | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lu_zero |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/ml/newlib/2013/msg01059.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
inhibit_loop_to_libcall.patch
inhibit_loop.patch |
Description
Alexander Holler
2013-12-08 12:17:51 UTC
Created attachment 364926 [details, diff]
inhibit_loop_to_libcall.patch
gcc-only patch to fix the problem.
Created attachment 365044 [details, diff]
inhibit_loop.patch
Updated patch (including configure stuff) which should work with any compiler.
Tested on ARM Cortex-Mn.
I've just checked newlib 2.1.0 which was released at 23-12-2013 and it contains the necessary patch for the memset problem (I've reported upstream too). So just upgrading the version to 2.1.0 would fix this bug. Up to now I haven't tested 2.1.0 myself, but I assume it will now work too with -O3 as the source looks like the attached patch. I'm still not sure where newlib got the -O3 from (maybe it has taken it from my host CFLAGS, which indeed contains -O3), but I don't care much. It might be a good idea to add a useflag to add --enable-target-optspace to the configure flags (or even enable that by default), as that option enables -Os. But I'm not sure about that, because I don't know where newlib is used besides my use case (ARM Cortex-Mn). (In reply to Alexander Holler from comment #3) 2.1.0 is in the tree already we don't create USE flags that just control optimization flags. testing 2.1.0, i don't see -O3 being used. Very unusual but newlib uses the optimization level as found in the CFLAGS of the build machine (e.g. in /etc/portage/make.conf) to (cross-)compile the target libraries. Therefor a useflag might make sense here. Anyway, since it now works even if CFLAGS contains -O3 (just tested), it's ok. Thanks for the version bump. (In reply to Alexander Holler from comment #5) this is a known TODO in crossdev (bug 420089). a USE flag doesn't make sense. |