From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: PowerPC & GNU/Hurd cross-compilation Date: Sat, 21 Jan 2017 22:24:46 +0100 Message-ID: <87d1fgjech.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cV39Z-0006fQ-MH for guix-devel@gnu.org; Sat, 21 Jan 2017 16:24:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cV39V-0003sN-L8 for guix-devel@gnu.org; Sat, 21 Jan 2017 16:24:53 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Carlos =?utf-8?Q?S=C3=A1nchez?= de La Lama , Manolis Ragkousis Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Guix! A picture (?) is worth a thousand words: --8<---------------cut here---------------start------------->8--- $ file $(./pre-inst-env guix build -q --target=3Di586-pc-gnu guile )/bin/gu= ile The following files will be downloaded: /gnu/store/8jxpzizhb780cqqn9qk27hfgyv9v224x-guile-2.0.13-debug /gnu/store/zl3m30z9rvj15jnfgn43wd6qikahf9l1-guile-2.0.13 /gnu/store/0p00kg842bpjfj7vvix73iqvz977wnng-readline-7.0 /gnu/store/1l8jnzmpzivmph26md6wvrbkdi0xlbd9-libgc-7.6.0 /gnu/store/4icii2kkn8zwgi6qz6varyflp1ms11i7-gcc-cross-i586-pc-gnu-5.4.0 /gnu/store/5nwkzw2ipzbdmyx0c8jg3zv74p233yg8-glibc-cross-i586-pc-gnu-2.23 /gnu/store/7j4ni6bliwr5y4f8x6caqcfpw6cayi9x-libunistring-0.9.7 /gnu/store/9g4lx00ifmgwp47l6n4h0sx72fk1r7jf-libltdl-2.4.6 /gnu/store/9jfv1vgnag4nc7pfhzyc2j97q9l567x2-gmp-6.1.2 /gnu/store/v3zi67s9yyfb1cym28chczk5zf9gmczn-libffi-3.2.1 /gnu/store/xxmdzy6v625fqdafcgp4lxvdipnjqd45-gcc-cross-sans-libc-i586-pc-= gnu-5.4.0 /gnu/store/flwn3xam69q593iinvb9sjl9lzyad2k1-libatomic-ops-7.4.4 /gnu/store/kh3f6x5d0r3xmqzl79y99drdsn1lsmaz-ncurses-6.0 /gnu/store/ln735a8nzl427izyb4lfgwr4rfd929wr-pkg-config-i586-pc-gnu-0.29 /gnu/store/mpz7j090145v0zij8h28v9zvqr2kafw5-bash-4.4.5 /gnu/store/8jxpzizhb780cqqn9qk27hfgyv9v224x-guile-2.0.13-debug: directo= ry /gnu/store/zl3m30z9rvj15jnfgn43wd6qikahf9l1-guile-2.0.13/bin/guile: ELF 32-= bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, inte= rpreter /lib/ld.so, for GNU/Hurd 0.0.0, not stripped $ file $(./pre-inst-env guix build -q --target=3Dpowerpc-linux-gnu guile )/= bin/guile The following files will be downloaded: /gnu/store/4cmc36jhjj2qq7z5pd0n9fw48dfq1cr7-guile-2.0.13-debug /gnu/store/h153jzzqiz10xc3yh4r2w7lkrm5pbx88-guile-2.0.13 /gnu/store/253hrca11y3cjh2f83dcjaxiv9a2j5m3-gmp-6.1.2 /gnu/store/29iq9axvllgdrf6y6zfqz111icmy3pdj-libgc-7.6.0 /gnu/store/911r5chr83yi6xivavndgb6mcvn71qv1-libunistring-0.9.7 /gnu/store/hkhffl6c6iap2igbbcap2vqbcgh7xkjv-gcc-cross-sans-libc-powerpc-= linux-gnu-5.4.0 /gnu/store/k2j02w9q58h6i07y1fixvcdq8jply68i-gcc-cross-powerpc-linux-gnu-= 5.4.0 /gnu/store/naqawviclvwzixvcjc17c3sss7zj9k1w-readline-7.0 /gnu/store/qivxbbn03scn5wn932ky8mm5xap5zn93-glibc-cross-powerpc-linux-gn= u-2.24 /gnu/store/rqb8p9f13mfha1xkkjwf7wfjvzv34xlk-libltdl-2.4.6 /gnu/store/z1qain73n3475p6sdb2ignwyalckvgnx-libffi-3.2.1 /gnu/store/4dazcdvnbgvhdvi5aj17ci07mz1xwzvq-bash-4.4.5 /gnu/store/6fzzsp453p3n5axcnl0rddjf1yw9309m-ncurses-6.0 /gnu/store/r7dbj8y4nf024phn8sd2v4206y71mk8q-pkg-config-powerpc-linux-gnu= -0.29 /gnu/store/rbhdn0wkbgb69w17f1fhridw81msam8v-libatomic-ops-7.4.4 /gnu/store/4cmc36jhjj2qq7z5pd0n9fw48dfq1cr7-guile-2.0.13-debug: directo= ry /gnu/store/h153jzzqiz10xc3yh4r2w7lkrm5pbx88-guile-2.0.13/bin/guile: ELF 32-= bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically li= nked, interpreter /gnu/store/qivxbbn03scn5wn932ky8mm5xap5zn93-glibc-cross-p= owerpc-linux-gnu-2.24/lib/ld.so.1, for GNU/Linux 3.2.0, not stripped $ git describe v0.12.0-458-g168c40004 --8<---------------cut here---------------end--------------->8--- Coreutils 8.26 fails upon =E2=80=98make install=E2=80=99 when cross-compili= ng, but I think Manolis has already investigated that so we should be able to fix it soon: https://hydra.gnu.org/build/1817891/nixlog/1/raw There=E2=80=99s also a small problem with sed: https://hydra.gnu.org/build/1817854/nixlog/1/raw Besides, on GNU/Hurd, the loader file name is incorrect: --8<---------------cut here---------------start------------->8--- $ readelf -a /gnu/store/zl3m30z9rvj15jnfgn43wd6qikahf9l1-guile-2.0.13/bin/g= uile |grep -A1 INTERP INTERP 0x000134 0x08048134 0x08048134 0x0000b 0x0000b R 0x1 [Requesting program interpreter: /lib/ld.so] --8<---------------cut here---------------end--------------->8--- (Should be /gnu/store/=E2=80=A6-glibc-2.24/lib/ld.so.) Looking at gcc/config/i386/gnu.h, I think the problem is fixed with the patch below, I=E2=80=99ll give it a try and commit if it works. Enjoy! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -213,9 +213,10 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$") - (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) - (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" - suffix + (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ ]*).*$" + _ gnu-user suffix) + (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%" + gnu-user suffix (string-append libc ,(glibc-dynamic-linker))))) ;; Tell where to find libstdc++, libc, and `?crt*.o', except --=-=-=--