I am trying to compile Cyanogenmod on Linux Mint 15. And receive the following error.

host StaticLib: libmincrypt (/home/benji/Source/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
ERROR: prebuilts/tools/gcc-sdk/../../gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin/x86_64-linux-ar only run on 64-bit linux
make: *** [/home/benji/Source/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a] Error 1
make: *** Waiting for unfinished jobs....
# In case value of PACKAGES is empty.

-

benji@ultranoid ~/Source/prebuilts/tools/gcc-sdk $ ./gcc
ERROR: ./../../gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin/x86_64-linux-gcc only run on 64-bit linux

I can't figure out what is causing this. I am on a 64 bit install. Please advise.

benji@ultranoid ~/Source $ uname -p
x86_64
有帮助吗?

解决方案

Workaround

Comment out lines 23-38 of prebuilts/tools/gcc-sdk/gcc

Example: http://pastebin.com/qH0BYcSF

其他提示

As pointed out here, within Android build system the test for x32 vs x64 host is based on the output of file -L "$SHELL" | grep -q "x86[_-]64". In other words it tests whether or not current shell is a 64 bit binary.

So a possible answer is : check out if value of environmental variable $SHELL is a valid path to a shell executable.

  1. You may try to change shell with chsh or

  2. create a link to your favorite shell so that $SHELL is satisfied. The latter did the trick for me - I've simply linked /bin/bash to where $SHELL pointed.

use uname -m to check system.

#file -L "$SHELL" | grep -q "x86[_-]64"

#if [ $? != 0 ]; then

# $SHELL is not a 64-bit executable, so assume our userland is too.

# echo "ERROR: $MY_TOOL only run on 64-bit linux"

# exit 1

#fi

changed to:

ARCH_OS=uname -m | tr '[:upper:]' '[:lower:]'

if [ "$ARCH_OS" != "x86_64" ] ; then
    echo "ERROR: $MY_TOOL only run on 64-bit linux from uname -m"
    exit 1
fi
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top