From Fedora Project Wiki

< User:Hamzy

Revision as of 00:32, 21 June 2017 by Hamzy (talk | contribs) (Created page with "= steps taken to build phantomjs on ppc64le = The phantomjs project uses a docker container to perform the build. The instructions say: <pre> $ git clean -xfd . $ docker run...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

steps taken to build phantomjs on ppc64le

The phantomjs project uses a docker container to perform the build. The instructions say:

$ git clean -xfd .
$ docker run -v $PWD:/src debian:wheezy /src/deploy/docker-build.sh

the script is here [1]

However, I could not build a wheezy container for Debian:

[hamzy@pkvmci853 phantomjs]$ sudo su -
[root@pkvmci853 ~]# mkdir /wheezy-root
[root@pkvmci853 ~]# debootstrap --arch=powerpc wheezy /wheezy-root/ http://ftp.debian.org/debian/
W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving InRelease 
I: Retrieving Release 
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
...
I: Extracting zlib1g...
W: Failure trying to run: chroot /wheezy-root dpkg-deb -f /var/cache/apt/archives/dpkg_1.16.18_powerpc.deb Version
W: See /wheezy-root/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /wheezy-root mount -t proc proc /proc
W: See /wheezy-root/debootstrap/debootstrap.log for details
[root@pkvmci853 ~]# cat /wheezy-root/debootstrap/debootstrap.log
chroot: failed to run command 'dpkg-deb': Exec format error
chroot: failed to run command 'mount': Exec format error

Building a Jessie container did work:

[hamzy@pkvmci853 phantomjs]$ sudo su -
[root@pkvmci853 ~]# mkdir /jessie-root
[root@pkvmci853 ~]# debootstrap --arch=ppc64el jessie /jessie-root/ http://ftp.debian.org/debian/
W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving InRelease
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
...
I: Configuring systemd...
I: Base system installed successfully.
[root@pkvmci853 ~]# tar -C /jessie-root/ -cJvf jessie-docker.tar.xz --xattrs .
[root@pkvmci853 ~]# cat jessie-docker.tar.xz | docker import - jessie-el
sha256:d0b376f5dd5397c6f5ded97293485043654a101ba77de54b9c926f974648724d

Running the commands in the above script ran into a problem:

[hamzy@pkvmci853 phantomjs]$ sudo docker run --rm -it --privileged jessie-el /bin/bash
root@8c186e049fe0:/# apt-get update -y
...
Reading package lists... Done
root@8c186e049fe0:/# apt-get install -y build-essential git flex bison gperf python ruby git libfontconfig1-dev
root@8c186e049fe0:/# echo "deb-src http://httpredir.debian.org/debian jessie main" >> /etc/apt/sources.list
root@8c186e049fe0:/# apt-get update -y
root@8c186e049fe0:/# apt-get source openssl
root@8c186e049fe0:/# cd openssl-1.0.1t/
root@8c186e049fe0:/openssl-1.0.1t# export OPENSSL_TARGET='linux-ppc64'
root@8c186e049fe0:/openssl-1.0.1t# export OPENSSL_FLAGS='no-idea no-mdc2 no-rc5 no-zlib enable-tlsext no-ssl2 no-ssl3 no-ssl3-method enable-rfc3779 enable-cms'
root@8c186e049fe0:/openssl-1.0.1t# ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib ${OPENSSL_FLAGS} ${OPENSSL_TARGET}
root@8c186e049fe0:/openssl-1.0.1t# make depend && make && make install
...
make[2]: Entering directory '/openssl-1.0.1t/apps'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl  -L.. -lcrypto -ldl}"; LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DB_ENDIAN -O3 -Wall -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} )
/usr/bin/ld: ../libcrypto.a(ppccpuid.o): ABI version 1 is not compatible with ABI version 2 output
/usr/bin/ld: failed to merge target specific data of file ../libcrypto.a(ppccpuid.o)
/usr/bin/ld: ../libcrypto.a(sha1-ppc.o): ABI version 1 is not compatible with ABI version 2 output
/usr/bin/ld: failed to merge target specific data of file ../libcrypto.a(sha1-ppc.o)
...
root@8c186e049fe0:/openssl-1.0.1t# exit