While compiling 32 bit binary on 64 bit Linux (ubuntu 14.04) getting wrong ELF class error âwrong ELF class: ELFCLASS64â
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have 64 bit Ubuntu 16.04 installed on my system. For some reasons i have to change root directory to a directory which is nothing but a replica of a different system with the required libraries installed which are required for my compilation task.
I have made the directory as root directory with chroot. Now while compiling the 32 bit binary for android which requires libc++.so
file for compilation it produces the error
error while loading shared libraries: libc++.so: wrong ELF class: ELFCLASS64
File output of the .so file:
$file /cpa/android/sdk/build-tools/23.0.3/aapt
/cpa/android/sdk/build-tools/23.0.3/aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=cfb63b4ad11d0c2d59f10329f0116706e99bf72e, not stripped
Compiling the binaries for android.
linux gcc chroot
 |Â
show 1 more comment
up vote
2
down vote
favorite
I have 64 bit Ubuntu 16.04 installed on my system. For some reasons i have to change root directory to a directory which is nothing but a replica of a different system with the required libraries installed which are required for my compilation task.
I have made the directory as root directory with chroot. Now while compiling the 32 bit binary for android which requires libc++.so
file for compilation it produces the error
error while loading shared libraries: libc++.so: wrong ELF class: ELFCLASS64
File output of the .so file:
$file /cpa/android/sdk/build-tools/23.0.3/aapt
/cpa/android/sdk/build-tools/23.0.3/aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=cfb63b4ad11d0c2d59f10329f0116706e99bf72e, not stripped
Compiling the binaries for android.
linux gcc chroot
3
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
1
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
1
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
1
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42
 |Â
show 1 more comment
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have 64 bit Ubuntu 16.04 installed on my system. For some reasons i have to change root directory to a directory which is nothing but a replica of a different system with the required libraries installed which are required for my compilation task.
I have made the directory as root directory with chroot. Now while compiling the 32 bit binary for android which requires libc++.so
file for compilation it produces the error
error while loading shared libraries: libc++.so: wrong ELF class: ELFCLASS64
File output of the .so file:
$file /cpa/android/sdk/build-tools/23.0.3/aapt
/cpa/android/sdk/build-tools/23.0.3/aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=cfb63b4ad11d0c2d59f10329f0116706e99bf72e, not stripped
Compiling the binaries for android.
linux gcc chroot
I have 64 bit Ubuntu 16.04 installed on my system. For some reasons i have to change root directory to a directory which is nothing but a replica of a different system with the required libraries installed which are required for my compilation task.
I have made the directory as root directory with chroot. Now while compiling the 32 bit binary for android which requires libc++.so
file for compilation it produces the error
error while loading shared libraries: libc++.so: wrong ELF class: ELFCLASS64
File output of the .so file:
$file /cpa/android/sdk/build-tools/23.0.3/aapt
/cpa/android/sdk/build-tools/23.0.3/aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=cfb63b4ad11d0c2d59f10329f0116706e99bf72e, not stripped
Compiling the binaries for android.
linux gcc chroot
edited Mar 7 at 13:01
asked Mar 6 at 7:42
NiK
112
112
3
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
1
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
1
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
1
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42
 |Â
show 1 more comment
3
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
1
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
1
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
1
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42
3
3
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
1
1
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
1
1
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
1
1
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42
 |Â
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428433%2fwhile-compiling-32-bit-binary-on-64-bit-linux-ubuntu-14-04-getting-wrong-elf-c%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
What's the command you use for compilation?
â schaiba
Mar 6 at 7:46
1
The package which I have to compile has a python script file to run which internally makes call to other shell scripts. the command which i can see in one of the shell script is run_cmake -c $CONFIG $WORKSPACE/$path $!TARGET -- $COMMON_OPTS $!OPTS "-DPRODUCT_NAME=$PRODUCT_NAME"
â NiK
Mar 6 at 9:17
1
What is your LD_LIBRARY_PATH set to?
â tk421
Mar 6 at 19:54
1
LD_LIBRARY_PATH="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jli/:/cpa/android/sdk/platform-tools/lib64/:/lib" Also forgot to add the binary which i am compiling is an android one
â NiK
Mar 7 at 6:22
Welcome to U&L please edit your question here to add the additional information
â GAD3R
Mar 7 at 9:42