2012年05月15日
Ubuntu 12.04LTS 正式版でMultiarchを試す
前回は正式リリース直前のUbuntu 12.04 Beta2でMultiarchを試しました。ユーザーモードQEMUを使うことで、armhf用の実行オブジェクトをそのまま実行できるようになっています。
実は、Beta2から正式版の間にarmhfのインタフェースに関して大きな動きがありました。ダイナミックリンカのパス名が各ディストリビューションごとにまちまちでした。armhfのディストリビューションをまたがったバイナリ互換を目指すならば、ダイナミックリンカのパス名の統一は必要条件です。
メーリングリスト上で議論を行うもののなかなか収束せずに、最後は電話会議によって決定されたようです。
https://wiki.linaro.org/OfficeofCTO/HardFloat/LinkerPathCallApr2012
これが4月13日でした。
gccのパッチがすぐに用意され、Ubuntu 12.04LTSの正式版はこれが適用されたものになっています。
$ arm-linux-gnueabihf-gcc -o hello_armhf hello.c $ file ./hello_armhf ./hello_armhf: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0xd791295243a8f643bd8c76c23052d01c28223cc6, not stripped $ ./hello_armhf /lib/ld-linux-armhf.so.3: No such file or directory
Beta2のときには、これは /lib/arm-linux-gnueabihf/ld-linux.so.3 でした。
$ cd /lib $ sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-2.15.so ld-linux-armhf.so.3 $ ls -l /lib/ld-linux-armhf.so.3 lrwxrwxrwx 1 root root 39 May 15 18:02 /lib/ld-linux-armhf.so.3 -> /usr/arm-linux-gnueabihf/lib/ld-2.15.so $ cd -
このようにシンボリックリンクを作ります。
$ ./hello_armhf Hello, world!
これで動きました。