Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51488 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95880 invoked from network); 20 Feb 2011 16:17:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2011 16:17:24 -0000 Authentication-Results: pb1.pair.com header.from=martin.herrman@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=martin.herrman@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: martin.herrman@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:63934] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/AD-21930-19E316D4 for ; Sun, 20 Feb 2011 11:17:21 -0500 Received: by wyf19 with SMTP id 19so838924wyf.29 for ; Sun, 20 Feb 2011 08:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=Sd925DlPu9Ya7jLJ8BHUuV0ab0OVQZgltNTI9XeJNyQ=; b=X0pLldgNBYUxRgob/gTPBZQDATJaYaz8qC4hdYarOu5BCcDI6lV1GQ80fHRIcb/dhF YVdzbHOD+SmycT/XxonUIeS6C283KhjWH6srnkx3HYevg8Iv673CETOl/mVwhL5IDyiN QpSE2p0ryq8JIS0BHPLzQZ/21H1AKfnYGFUqY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=pHZjVaUCzE8Bm/BAMRRJfBFy5Fhukl1dpfiMnheR7SRcobnsdtRXrBxkGrr9Xk4OM6 X6ATY/H/HGbPgJ/qwvFa/iYY5uKj3s/l0WgNLieHYkS8EcfDwZrTZAtm61bn5iTsbW9p Ax5ISGFyNukiFzTlTP2LhQ9S/G4chSxsk5a6U= MIME-Version: 1.0 Received: by 10.216.165.85 with SMTP id d63mr397786wel.12.1298218637801; Sun, 20 Feb 2011 08:17:17 -0800 (PST) Sender: martin.herrman@gmail.com Reply-To: martin@herrman.nl Received: by 10.216.27.194 with HTTP; Sun, 20 Feb 2011 08:17:17 -0800 (PST) In-Reply-To: References: <4D612CBE.5040205@thelounge.net> Date: Sun, 20 Feb 2011 17:17:17 +0100 X-Google-Sender-Auth: T3kALM1EV7Kc7J9w7hCg_F6g0GE Message-ID: To: Daniel Brown Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP for embedded device: reduce size From: martin@herrman.nl (Martin Herrman) 2011/2/20 Daniel Brown : > On Sun, Feb 20, 2011 at 10:42, Martin Herrman wrote: >> >> I already had --disabled-all. I have now tested with -Os instead of >> -O2 which results in a 2.8MB executable. So that helps a bit :-) > > =A0 =A0Try running `strip` on there to take out the excess symbols. This is my cross-compile script for -O2: #!/bin/sh # Set variables export CFLAGS=3D"-EL -O2" export CXXFLAGS=3D"-EL -O2" export CC=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-gcc" export CXX=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-g++" export PATH=3D/opt/Sourcery_G++_Lite/bin:$PATH export AR=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-ar" export LDFLAGS=3D" -s -Xlinker -rpath /lib -Xlinker -rpath-link /opt/Sourcery_G++_Lite/lib/gcc/mips-linux-gnu/4.3.3/el" export STRIP=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-strip" export RANLIB=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-ranlib" export AS=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-as" export LD=3D"/opt/Sourcery_G++_Lite/bin/mips-linux-gnu-ld" # Cleanup previous compilations rm -rf /home/martin/result/php-5.3.5 rm -rf /home/martin/work/php* # Download source and configure, compile, install cd /home/martin/work wget http://nl.php.net/get/php-5.3.5.tar.gz/from/this/mirror -O php-5.3.5.t= ar.gz tar -zxvf php-5.3.5.tar.gz cd php-5.3.5 #./configure --help ./configure --prefix=3D/home/martin/result/php-5.3.5 --host=3Di686-pc-linux-gnu --target=3Dmipsel-linux-gnu --build=3Dmipsel-linux-gnu --enable-cgi --disable-all --without-pear make make install This is the result: martin@martindesktop ~/ $ ls -ltr result/php-5.3.5/bin/php-cgi -rwxr-xr-x 1 martin users 3142772 Feb 20 16:58 result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ file result/php-5.3.5/bin/php-cgi result/php-5.3.5/bin/php-cgi: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.12, with unknown capability 0xf41 =3D 0x756e6700, with unknown capability 0x70100 =3D 0x1040000, stripped martin@martindesktop ~/ $ /opt/Sourcery_G++_Lite/bin/mips-linux-gnu-strip result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ file result/php-5.3.5/bin/php-cgi result/php-5.3.5/bin/php-cgi: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.12, with unknown capability 0xf41 =3D 0x756e6700, with unknown capability 0x70100 =3D 0x1040000, stripped martin@martindesktop ~/ $ ls -ltr result/php-5.3.5/bin/php-cgi -rwxr-xr-x 1 martin users 3142772 Feb 20 17:07 result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ Now for -Os: martin@martindesktop ~/ $ ls -ltr result/php-5.3.5/bin/php-cgi -rwxr-xr-x 1 martin users 2813508 Feb 20 17:10 result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ file result/php-5.3.5/bin/php-cgi result/php-5.3.5/bin/php-cgi: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.12, with unknown capability 0xf41 =3D 0x756e6700, with unknown capability 0x70100 =3D 0x1040000, stripped martin@martindesktop ~/ $ /opt/Sourcery_G++_Lite/bin/mips-linux-gnu-strip result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ ls -ltr result/php-5.3.5/bin/php-cgi -rwxr-xr-x 1 martin users 2813508 Feb 20 17:16 result/php-5.3.5/bin/php-cgi martin@martindesktop ~/ $ file result/php-5.3.5/bin/php-cgi result/php-5.3.5/bin/php-cgi: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.12, with unknown capability 0xf41 =3D 0x756e6700, with unknown capability 0x70100 =3D 0x1040000, stripped martin@martindesktop ~/ $