- Identify the architecture of the 32-bit libraries in your Go project.
file your_library.so
- Install the necessary 64-bit libraries.
sudo dpkg --add-architecture amd64
sudo apt-get update
sudo apt-get install libc6:amd64 libncurses5:amd64 libstdc++6:amd64
- Set the environment variable for 64-bit architecture.
export GOARCH=amd64
- Rebuild your Go project with the 64-bit architecture.
go build
- Verify the architecture of the generated binary.
file your_binary
- Check for any 32-bit dependencies using the
readelf
command.
readelf -h your_binary | grep Class
- If necessary, update or replace the 32-bit dependencies with their 64-bit equivalents.
sudo apt-get install lib32example-dev:amd64
- Rebuild the project again.
go build
- Verify that the binary is now compliant with the 64-bit requirement.
file your_binary
- Test the application to ensure it works as expected on 64-bit devices.
./your_binary