[OE-core] [PATCH 5/5] lib/oe/package.py: is_elf: Make it less prone to false positives

Mark Hatle mark.hatle at windriver.com
Mon Dec 4 19:22:50 UTC 2017


On 12/4/17 4:00 AM, Olof Johansson wrote:
> On 17-12-01 22:13 +0100, Olof Johansson wrote:
>> On 17-12-01 11:43 -0600, Mark Hatle wrote:
>>> The original implementation did not include the ',' options because different
>>> versions of file (as well as different architectures) would return different
>>> strings.
>>>
>>> They all contains the same information, but order and inclusion of ',' changed
>>> regularly.
>>>
>>> So I would caution that for this to check out a wide variety of host systems and
>>> architectures would need to be verified.  (It's very possible that all modern
>>> systems now conform to a single standard...)
>>
>> I was a little bit worried about this, thanks, this is useful
>> feedback. Perhaps dropping the "," while still retaining the
>> whitespace delimitation could be enough, and still work with a
>> variety of file implementations?
> 
> Reading more about this, I was wrong in calling it GNU file, I
> don't know where I got that from. It actually seems to be only
> one prevalent implementation, one written by Ian Darwin [0]:

I'm thinking back to RHEL 4-ish era, Ubuntu, Debian, Arch, Gentoo, etc.  We were
getting a mix/match of different results depending on the age of the 'file'
application being used, and even the magic file associated with it.

All of the information was present, but the order of certain elements changed
from arch to arch, and as I mentioned before the ',' bit was not always present.

It's possible that all modern file based systems are now using the same sources
and magic, but it was definitely not true in the past.

--Mark

>> Who's using it?
>>
>>    Most known BSD distributions (FreeBSD, NetBSD, Darwin/Mac OS X, etc)
>>    Every known Linux distribution
> 
> Could you elaborate on the portability issues you've seen?
> 
> 
> 0: http://www.darwinsys.com/file/
> 




More information about the Openembedded-core mailing list