The Raspberry Pi is an amazing machine. We can easily install Ubuntu Linux on Raspberry Pi. I sometimes confuse Raspberry Pi and desktop PC(x86-64). At that time, I come up with idea. How about setup software development environment on my Raspberry Pi instead of X86 PC.
I installed some packages like Git, Docker for software engineers. I downloaded my source codes from Git. Then I tried to build docker image on Raspberry Pi. And I encountered error message.
[My docker script]
FROMT ubuntu:16.04 RUN apt-get update && apt-get install -y libc6-i386 |
[Actual Result]
Fetched 16.7 MB in 20s (808 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package libc-i386 The command '/bin/sh -c apt-get update && apt-get install -y libc-i386' returned a non-zero code: 100 |
We are using some binaries for building job. Some binaries of them were built for 80386. So, I added libc-i386 package to my docker script. But, ubuntu for ARM does not support libc-i386 package. If you are using x86-64, you can execute x86 binary with libc-i386.
[Before installation libc-i386 on x86-64 machine]
$ file alfill
alfill: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped
$ ./alfill
bash: ./alfill: cannot execute binary file: Exec format error
I cannot execute the binary. Because my machine is x86-64 and binary is 80386.
[After installation libc-i386 on x86-64 machine
$ sudo apt-get install libc-i386
$ ./alfill
(It works)
After installation libc-i386, we can execute 80386 binary on x86-64 machine.
[Tring install libc-i386 on ARM64]
$ sudo apt-get install libc-i386 E: Unable to locate package libc-i386 |
But, we cannot install libc-i386 package on ARM. Because the instruction set of ARM CPU is different X86's one. (The X86 is CISC CPU. And The ARM is RISC CPU.)
Finally, we cannot execute x86 binary on Raspberry Pi. You had better make tool as script language like python. Then, you can use it on X86 and on ARM.
Thank you.
'Study > 라즈베리파이 공부' 카테고리의 다른 글
라즈베리파이에 FTP 서버 설정 (proftpd inactive 문제 해결 방법) (0) | 2021.04.21 |
---|---|
[라즈베리파이] Your Computer Clock Is Wrong 해결 방법 (0) | 2021.03.19 |
[라즈베리파이] ACT LED가 5번 깜빡이면서 부팅 불량시 조치사항 (0) | 2021.02.01 |
[라즈베리파이] ACT LED가 계속 점등되면서 느려지는 문제 해결 방법 (0) | 2021.01.31 |
[라즈베리파이] UART 시리얼 포트로 터미널 접속 방법(Headless 환경) (0) | 2021.01.26 |