Skip to content

Commit cf8bded

Browse files
arkaitzjcatamorphism
authored andcommitted
Enable configure to detect 32 bit systems on 64 bit kernels
These systems run 32 bit binaries so arch needs to be forced to 32 bits.
1 parent 33adb7a commit cf8bded

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

configure

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,16 @@ case $CFG_CPUTYPE in
257257
err "unknown CPU type: $CFG_CPUTYPE"
258258
esac
259259

260+
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
261+
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
262+
then
263+
file -L "$SHELL" | grep -q "x86[_-]64"
264+
if [ $? != 0 ]; then
265+
CFG_CPUTYPE=i686
266+
fi
267+
fi
268+
269+
260270
DEFAULT_HOST_TRIPLE="${CFG_CPUTYPE}-${CFG_OSTYPE}"
261271

262272
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"

0 commit comments

Comments
 (0)