Comment 1 for bug 911860

Revision history for this message
Dave Martin (dave-martin-arm) wrote :

Just a quick comment based on what I see in http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/libjpeg-turbo/precise/view/3/simd/jsimd_arm.c:

Yes, the current code looks a bit dodgy... you'll need to open /proc/self/auxv instead of trying to find the auxv data by scanning from envp.

Except in native assembler programs which do not use a C library, there's no guarantee that the auxv data will be present at the end of the environment since the C library may have overwritten or moved the initial environment block since the process started. AFAIK, libc doesn't provide any API for getting at the auxv data, so reading /proc/self/auxv or /proc/cpuinfo is the only option (and /proc/self/auxv has a more fixed, easier-to-parse format)