premake/premake-core

os.findlib is not architecture aware

开放

#542 创建于 2016年7月14日

 (0 条评论) (0 个反应) (0 位负责人)C (651 个派生)auto 404
enhancementhelp wanted

仓库指标

星标
 (3,621 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

os.findlib may return the path to a 32bit lib even if the current project is configured to use the x86_64 architecture.

I am not really familiar with this but it seems to be possible to check for a compatible architecture/bitness by inspecting the file header.

Unix fifth byte of the ELF header

Value Bitness
1 32 bit
2 64 bit

Windows first two bytes of COFF header

Value Architecture
0x014c x86
0x8664 x64

Therefore one possibiliy would be to ignore incompatible files (and removing their path) until os.pathsearch returns a compatible file or nil.

贡献者指南