premake/premake-core

os.findlib is not architecture aware

Ouverte

#542 ouverte le 14 juil. 2016

 (0 commentaire) (0 réaction) (0 personne assignée)C (651 forks)auto 404
enhancementhelp wanted

Métriques du dépôt

Stars
 (3 621 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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.

Guide contributeur