| Bug #22077 | Compilation hangs on sha1.c when using -O2 | ||||
|---|---|---|---|---|---|
| Submitted: | 5 Feb 2003 11:42am UTC | Modified: | 22 May 2003 4:40pm UTC | ||
| From: | slash at peereboom dot us | Assigned to: | |||
| Status: | No Feedback | Category: | Compile Failure | ||
| Version: | 4.3.0 | OS: | OpenBSD 3.2 sparc64 | ||
| Votes: | 2 | Avg. Score: | 5.0 ± 0.0 | Reproduced: | 2 of 2 (100.0%) |
| Same Version: | 1 (50.0%) | Same OS: | 1 (50.0%) | ||
[11 Feb 2003 5:14pm UTC] iliaa@php.net
Looks like a compiler bug to me since the very same code compiles fine with other compilers. What compiler are you using?
[11 Feb 2003 7:22pm UTC] slash at peereboom dot us
[root@web root]# gcc -v Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd3.2/2.95.3/specs gcc version 2.95.3 20010125 (prerelease)
[25 Feb 2003 4:33am UTC] sniper@php.net
>> gcc version 2.95.3 20010125 (prerelease) prerelease? Is there any better available for that OS?
[25 Feb 2003 1:43pm UTC] slash at peereboom dot us
That what ships with it. Don't pay too much attention to it though; the compiler is higly altered by the OpenBSD developers. It is as good as any other gcc sparc64 compiler (that's the problem!)
[26 Feb 2003 2:44pm UTC] derick@php.net
Maybe the alterations are the problem...
[9 Mar 2003 6:51pm UTC] sniper@php.net
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
[16 May 2003 6:39pm UTC] peteg at san dot rr dot com
im using php 4.3.1 on openbsd 3.3 sparc64 (u5) it hangs in the exact same place during compilation # gcc -v Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd3.3/2.95.3/specs gcc version 2.95.3 20010125 (prerelease, propolice) if anyone has a fix please reply /post thanks
[17 May 2003 5:21am UTC] derick@php.net
Give me an account and I can have a look :)OpenBSD on sparc is not a common system, and we really don't have all those boxes for us to access.
[22 May 2003 4:40pm UTC] sniper@php.net
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
[21 Jul 2003 2:11pm UTC] php at gotontheinter dot net
"Me too" and I've already given (and eventually revoked for lack of use) an account to the PHP team (Jan, in this case). If you want me to reactivate it (or create a new one) just let me know. I'd love to get php working on this system. (Account created Nov 26 2002, last login Nov 28, disabled May 29 2003...)

Fix: use -O0 on sha1.c during compilation. Error: I was trying to compile php-4.3.0 on an Ultra-5 & an Ultra-10 (dmesg at the bottom). Both boxes run OpenBSD 3.2-sparc64. What happens is that the compiler hangs on sha1.c. It seems as if there are way too many macro's in there. I removed the macro's and the file did compile. The macro's that hang the compiler are (php-4.3.0/ext/standard/sha1.c line 144): /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. */ #define FF(a, b, c, d, e, w) { \ (e) += F ((b), (c), (d)) + (w) + (php_uint32)(0x5A827999); \ (e) += ROTATE_LEFT ((a), 5); \ (b) = ROTATE_LEFT((b), 30); \ } #define GG(a, b, c, d, e, w) { \ (e) += G ((b), (c), (d)) + (w) + (php_uint32)(0x6ED9EBA1); \ (e) += ROTATE_LEFT ((a), 5); \ (b) = ROTATE_LEFT((b), 30); \ } #define HH(a, b, c, d, e, w) { \ (e) += H ((b), (c), (d)) + (w) + (php_uint32)(0x8F1BBCDC); \ (e) += ROTATE_LEFT ((a), 5); \ (b) = ROTATE_LEFT((b), 30); \ } #define II(a, b, c, d, e, w) { \ (e) += I ((b), (c), (d)) + (w) + (php_uint32)(0xCA62C1D6); \ (e) += ROTATE_LEFT ((a), 5); \ (b) = ROTATE_LEFT((b), 30); \ } Note all the embedded macro's (F, G, H, I, ROTATE_LEFT). Anyway, has anyone run into this and figured out a fix? I will try to compile the same code on Intel and see what happens. I searched the web, mail archives and the php archives. More details: PHP requires quite a bit of lib's so I installed the following from the ports: curl-7.9.8.tgz gdbm-1.8.0.tgz libiconv-1.8.tgz pkgconfig-0.12.0.tgz libxml-2.4.24.tgz jpeg-6b.tgz png-1.2.4.tgz gettext-0.10.40.tgz gmake-3.79.1.tgz expat-1.95.4.tgz sablotron-0.96.tgz libxslt-1.0.20.tgz I compiled the following ones from source: freetype2.1.3 imap-wu-2002 (coppied the headers manually to /usr/local/include) libmcal-0.6 (coppied the headers manually to /usr/local/include) I configured PHP as follows: ./configure --prefix=/usr/local/php --with-openssl --with-zlib --enable-bcma th --enable-calendar --with-curl --with-gdbm --with-dom --with-gd --with-jpe g-dir --with-png-dir=/usr/local --with-freetype-dir --enable-gd-native-ttf - -with-imap --with-mcal --with-mysql=/usr/local/mysql --enable-xslt --with-ex pat-dir=/usr/local --with-iconv=/usr/local --with-dom-xslt --with-xslt-sablo t=/usr/local --with-expat-dir=/usr/local --with-iconv-dir=/usr/local Top after running overnight: load averages: 1.15, 1.17, 1.16 09:41:52 15 processes: 2 running, 13 idle CPU states: 98.8% user, 0.0% nice, 1.2% system, 0.0% interrupt, 0.0% idle Memory: Real: 15M/38M act/tot Free: 207M Swap: 3896K/256M used/tot Command not understood PID USERNAME PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND 32291 root 64 0 8312K 8696K run - 730:13 98.39% cc1 15610 root 28 0 240K 1520K run - 0:00 0.29% top 32651 root 2 0 792K 896K sleep select 0:07 0.00% sshd 23396 root 2 0 832K 864K idle select 0:11 0.00% sshd 24835 root 2 0 1760K 1912K sleep select 0:00 0.00% sendmail 2362 root 2 0 736K 0K idle select 0:02 0.00% sshd 18904 root 10 0 1992K 672K idle wait 0:01 0.00% bash 2455 root 10 0 1992K 816K sleep wait 0:01 0.00% bash 1758 root 2 0 328K 688K idle select 0:00 0.00% cron 17119 root 2 0 176K 640K sleep select 0:00 0.00% syslogd 17210 root 2 0 144K 624K idle select 0:00 0.00% inetd 1 root 10 0 656K 104K idle wait 0:00 0.00% init 19709 root 2 0 800K 424K idle poll 0:00 0.00% dhclient 31498 root 10 0 264K 1088K idle wait 0:00 0.00% gcc 1579 root 3 0 72K 0K idle ttyin 0:00 0.00% getty Dmesg of ultra-5 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2002 OpenBSD. All rights reserved. http://www.OpenBSD.org OpenBSD 3.2 (GENERIC) #8: Thu Oct 3 20:00:17 MDT 2002 deraadt@sparc64.openbsd.org:/usr/src/sys/arch/sparc64/compile/GENERIC total memory = 268435456 avail memory = 240558080 using 1638 buffers containing 13418496 of memory bootpath: /pci@1f,0/pci@1,1/ide@3,0/disk@0,0 mainbus0 (root): SUNW,Ultra-5_10 cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 333 MHz, version 0 FPU cpu0: physical 32K instruction (32 b/l), 16K data (32 b/l), 2048K external (64 b/l) psycho0 at mainbus0 addr 0xfffc4000 SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0 IOTDB: f66000 to fe6000 pci0 at psycho0 ppb0 at pci0 dev 1 function 1 "Sun Simba PCI-PCI" rev 0x13 pci1 at ppb0 bus 1 ebus0 at pci1 dev 1 function 0 "Sun PCIO Ebus2" rev 0x01 auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 72c000-72c003, 72f000-72f003 power at ebus0 addr 724000-724003 ipl 37 not configured SUNW,pll at ebus0 addr 504000-504002 not configured sab0 at ebus0 addr 400000-40007f ipl 43: rev 3.2 sabtty0 at sab0 port 0: console i/o sabtty1 at sab0 port 1 comkbd0 at ebus0 addr 3083f8-3083ff ipl 41 wskbd0 at comkbd0 com0 at ebus0 addr 3062f8-3062ff ipl 42, mouse: ns16550a, 16 byte fifo lpt0 at ebus0 addr 3043bc-3043cb, 30015c-30015d, 700000-70000f ipl 34: polled fdthree at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 39 not configured clock0 at ebus0 addr 0-1fff: mk48t59: hostid 80a73606 flashprom at ebus0 addr 0-fffff not configured audioce0 at ebus0 addr 200000-2000ff, 702000-70200f, 704000-70400f, 722000-722003 ipl 35 ipl 36: nvaddrs 0 audio0 at audioce0 hme0 at pci1 dev 1 function 1 "Sun HME" rev 0x01: address 08:00:20:a7:36:06 nsphy0 at hme0 phy 1: DP83840 10/100 media interface, rev. 1 hme0: using ivec 3021 for interrupt vgafb0 at pci1 dev 2 function 0 "ATI Mach64 GP" rev 0x5c wsdisplay0 at vgafb0 wsdisplay0: screen 0 added (sun, sun emulation) pciide0 at pci1 dev 3 function 0 "CMD Technology PCI0646" rev 0x03: DMA, channel 0 configured to native-PCI, channel 1 configured to native-PCI pciide0: using ivec 1820 for native-PCI interrupt wd0 at pciide0 channel 0 drive 0: <ST39140A> wd0: 16-sector PIO, LBA, 8693MB, 17662 cyl, 16 head, 63 sec, 17803440 sectors wd0(pciide0:0:0): using PIO mode 4, DMA mode 2 atapiscsi0 at pciide0 channel 1 drive 0 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: <LG, CD-ROM CRD-8322B, 1.03> SCSI0 5/cdrom removable cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 ppb1 at pci0 dev 1 function 0 "Sun Simba PCI-PCI" rev 0x13 pci2 at ppb1 bus 2 gem0 at pci2 dev 1 function 0 "Sun GEM" rev 0x01 gem0: address 08:00:20:9e:a6:bb gem0: using ivec 3010 for interrupt pcons at mainbus0 not configured No counter-timer -- using %tick at 333MHz as system clock. root on wd0a rootdev=0xc00 rrootdev=0x1a00 rawdev=0x1a02