While compiling 32 bit binary on 64 bit Linux (ubuntu 14.04) getting wrong ELF class error “wrong ELF class: ELFCLASS64”

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question


















  • 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














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.







share|improve this question


















  • 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












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.







share|improve this question














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.









share|improve this question













share|improve this question




share|improve this question








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












  • 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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay