Bug 339945 - Patch: replace #if !defined (VGPV_*_linux_android) with #ifndef AT_FPUCW
Summary: Patch: replace #if !defined (VGPV_*_linux_android) with #ifndef AT_FPUCW
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.10 SVN
Platform: Android Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-13 23:00 UTC by dimitry
Modified: 2017-04-19 18:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dimitry 2014-10-13 23:00:29 UTC
It looks like Android is not really unique is this respect; most of other platforms do not use AT_FPUCW also, the only difference is that bionic's elf.h does not define this symbol.

kernel defines this only for sh platform in it's headers...

Reproducible: Always




Patch:

Index: coregrind/m_initimg/initimg-linux.c
===================================================================
--- coregrind/m_initimg/initimg-linux.c	(revision 14617)
+++ coregrind/m_initimg/initimg-linux.c	(working copy)
@@ -246,6 +246,10 @@
 /*=== Setting up the client's stack                                ===*/
 /*====================================================================*/
 
+#ifndef AT_FPUCW
+#define AT_FPUCW		18
+#endif /* AT_FPUCW */
+
 #ifndef AT_ICACHEBSIZE
 #define AT_ICACHEBSIZE		20
 #endif /* AT_ICACHEBSIZE */
@@ -633,11 +637,7 @@
          case AT_GID:
          case AT_EGID:
          case AT_CLKTCK:
-#        if !defined(VGPV_arm_linux_android) \
-            && !defined(VGPV_x86_linux_android) \
-            && !defined(VGPV_mips32_linux_android)
-         case AT_FPUCW: /* missing on android */
-#        endif
+         case AT_FPUCW:
             /* All these are pointerless, so we don't need to do
                anything about them. */
             break;
Comment 1 Elliott Hughes 2017-04-19 18:01:06 UTC
https://android-review.googlesource.com/375892 adds AT_FPUCW (and other historical arch-specific cruft) to bionic, available via <elf.h> and <sys/auxv.h>.

until an NDK with that is released, guarding the AT_FPUCW reference with #if defined(AT_FPUCW) would be less error-prone than listing all the Android targets here. (what about x86-64, for example?)