Hello,
I'm having an issue with running a 32-bit executable built with GCC inside a Bitbucket pipeline using the atlassian/default-image:2 image:
<span>/usr/local/bin/pawncc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=1df4edb3e7046c89aaac29df60750a897c3e0540, not stripped</span><span>+ file /usr/local/bin/pawncc</span>
<span> not a dynamic executable</span><span>+ ldd /usr/local/bin/pawncc</span>
LDD says that it's "not a dynamic executable".
Do I need to install some extra packages to run 32-bit programs? I currently have the following:
<span>+ apt-get install -y libc6:i386 linux-libc-dev:i386 cmake gcc-multilib gcc-4.8 gcc-4.8-multilib g++-4.8 g++-4.8-multilib cmake snapd</span>
Update:
Sample bitbucket-pipelines.yml that reproduces the issue:
image: atlassian/default-image:2
pipelines:
default:
- step:
name: Build
script:
- uname -a
- cat /etc/lsb-release
- dpkg --add-architecture i386
- apt-get update -qq
- apt-get install -y binfmt-support file wget libc6-i386 linux-libc-dev:i386 gcc gcc-multilib
- echo 'int main() { printf("Hello, world!"); }' >> test.c
- gcc -m32 test.c -o test
- ./test
Output:
<span>bash: ./test: cannot execute binary file: Exec format error</span>