Backout changes related to ticket #2940 which were committed by accident.
[pkgsrc.git] / doc / HACKS
1 # $NetBSD: HACKS,v 1.30 2005/05/15 22:23:09 jschauma Exp $
2 #
3 # This file is intended to document workarounds for currently unsolved
4 # (mostly) compiler bugs.
5 #
6 # Format:
7 #   hack                title
8 #   cdate               creation date
9 #   mdate               mod date
10 #   who                 responsible developer
11 #   port                ...
12 #         affected ports, space separated, if not "all"
13 #   file                affected file : revision : line from : line to
14 #         affected files and revision and line numbers describing hack
15 #         multiple lines if necessary.
16 #   pr                  NNNN ...
17 #         problem reports this hack works around, if known. Space
18 #         separated.
19 #   regress             src/regress/directory/where/test/found
20 #         regression test directories, if available.
21 #   descr
22 #         insert short informal description (multi-line). (Longer ones
23 #         should be in the PR database. More formal descriptions might
24 #         be in the regress tree. See above).
25 #   kcah
26 #         closing bracket.
27 #
28 # this is a comment.
29
30
31 hack    gcc 2.95.3/alpha -O2 bug
32 cdate   Wed Feb  5 16:36:58 EST 2003
33 who     dmcmahill
34 port    alpha
35 file    audio/xsidplay/patches/patch-aa : 1.8
36         cad/qcad/patches/patch-aa : 1.4
37         devel/guile-gtk//Makefile : 1.10
38         devel/guile-gtk/patches/patch-aa : 1.6
39         x11/qt2-libs/patches/patch-ae : 1.8
40         x11/qt2-libs/patches/patch-ae : 1.18
41         x11/kdelibs3/patches/patch-cd : 1.1
42         x11/kdelibs3/patches/patch-ce : 1.1
43         lang/gcc3/Makefile : 1.5
44         net/bing/Makefile : 1.12
45         net/isic/Makefile : 1.5
46         net/ettercap/patches/patch-aa : 1.4
47         net/ettercap/Makefile : 1.11
48 descr
49         Compiler crashes
50 kcah
51
52 hack    gcc 2.95.3/alpha -O2 bug
53 cdate   Thu Jan 23 15:42:57 UTC 2003
54 who     dmcmahill
55 port    alpha
56 file    mail/imap-uwwm/Makefile : 1.52
57 descr
58         Compiler crashes
59 kcah
60
61 hack    gcc 2.95.3/alpha c++ -O2 bug
62 cdate   Fri Aug 16 06:38:16 EDT 2002
63 who     dmcmahill
64 port    alpha
65 file    print/cjk-lyx/patches/patch-ab : 1.2
66 file    print/cjk-lyx/patches/patch-ad : 1.1
67 file    print/cjk-lyx/patches/patch-ae : 1.1
68 file    print/cjk-lyx/patches/patch-af : 1.1
69 descr
70         Assembler runs forever and never returns with -O2 on some files.
71 kcah
72
73 hack    gcc 2.95.3/alpha -O2 bug
74 cdate   Sun Aug 11 12:39:46 EDT 2002
75 who     dmcmahill
76 port    alpha
77 file    wm/flubox/patches/patch-ab : 1.3
78 descr
79         Assembler runs forever and never returns with -O2 on some files.
80 kcah
81
82 hack    gcc 2.95.3/m68k -O2 bug
83 cdate   Fri Jul 19 04:33:29 UTC 2002
84 who     fredb
85 port    mac68k, amiga
86 file    graphics/gdk-pixbuf/patches/patch-aa : 1.3
87 descr
88         pixops.c gives 'Internal compiler error' with -O2 (but not -O),
89         on m68k only. The exact error message is reproduced in the patch.
90 kcah
91
92 hack    gas 2.11.2 commutative constraint bug
93 cdate   Fri May 10 04:51:29 UTC 2002
94 who     fredb
95 port    mac68k
96 file    devel/gmp/patches/patch-aa : 1.7
97 descr
98         The __asm__() in longlong.h fails to assemble on m68k with an
99         "unrecognized instruction" error, unless the commutative
100         constraint ('%') is removed (which makes it *more* constrained).
101 kcah
102
103 hack    gcc 2.95.3 -O2 bug
104 cdate   Thu Apr 18 15:42:57 UTC 2002
105 who     fredb, dmcmahill
106 port    alpha, mac68k
107 file    print/lyx/patches/patch-ab : 1.2
108 file    print/lyx/patches/patch-ac : 1.1
109 file    print/lyx/patches/patch-ae : 1.1
110 descr
111         lyxfunc.C causes 'Internal compiler error' with -O2 (but not -O).
112         The exact error message is reproduced in the patch.
113         Various other files cause the assembler to run forever (well,
114         I gave up after several hours) on netbsd-1.5.3/alpha using
115         gcc-2.95.3 and -O2.
116 kcah
117
118 hack    cc -O* bug
119 mdate   29 Dec 2001
120 who     abs
121 port    arm32
122 file    audio/libvorbis/Makefile : 1.12 : 20 : 28
123 descr
124         floor1.c causes Internal compiler error with egcs-2.91.66 19990314
125         (shipped with 1.5.2)
126 kcah
127
128 hack    cc -O* bug
129 mdate   10 Oct 2001
130 who     abs
131 port    arm32
132 file    net/djbdns/Makefile : 1.14 :
133 descr
134         various files go into infinite loop if optimisation enabled in
135         egcs-2.91.66 19990314 (shipped with 1.5.2)
136 kcah
137
138 hack    cc -O* bug
139 mdate   03 Oct 2001
140 who     abs
141 port    arm32
142 file    net/ucspi-tcp/Makefile  : 1.7 :
143 descr
144         various files go into infinite loop if optimisation enabled in
145         egcs-2.91.66 19990314 (shipped with 1.5.2)
146 kcah
147
148 hack    cc -O* bug
149 mdate   23 Aug 2001
150 who     abs
151 port    sparc64
152 file    graphics/tiff/patches/patch-aa  : 1.3 : 52 : 58
153 descr
154         on tif_dirread.c -O[12] causes the compiler to abort
155 kcah
156
157 hack    cc -O* bug
158 cdate   08 Nov 2000
159 mdate   10 Jan 2002
160 who     abs
161 port    arm32 arm
162 file    benchmarks/lmbench/patches/patch-aa     : 1.2 :
163 file    benchmarks/lmbench/Makefile             : 1.9 :
164 descr
165         on certain c files, using -O[1-3] will cause the arm32 cc1 to run
166         forever.
167         reported to GCC people as PR optimization/2391.
168 kcah
169
170 hack    cc -O* bug
171 mdate   18 May 2001
172 who     abs
173 file    x11/xscreensaver/distinfo               : 1.2 :
174 file    x11/xscreensaver/patches/patch-ab       : 1.7 :
175 descr
176         on distort.c -O[12] causes the compiler to abort
177 kcah
178
179 hack    c++ -O* bug
180 mdate   02 Jun 2000
181 who     dmcmahill
182 file    audio/festival/patches/patch-ai         : 1.2 :
183 file    audio/festival/patches/patch-aj         : 1.1 :
184 file    audio/festival/patches/patch-ak         : 1.1 :
185 file    audio/festival/patches/patch-al         : 1.1 :
186 file    cad/verilog/patches/patch-ad            : 1.3 :
187 file    cad/verilog-current/patches/patch-ad    : 1.3 :
188 file    cad/vipec/patches/patch-ac              : 1.4 :
189 file    emulators/stella/patches/patch-ac       : 1.3 : 36 : 43
190 file    graphics/kdegraphics/patches/patch-af   : 1.5
191 file    graphics/xpdf/Makefile                  : 1.18: 27
192 file    graphics/xpdf/patches/patch-aa          : 1.3
193 file    math/yacas/patches/patch-ac             : 1.1.1.1 :
194 file    x11/glclock/Makefile                    : 1.3 : 18 : 20
195 file    x11/windowmaker/Makefile                        : 1.51 : 39 : 42
196 pr      9453
197 descr
198         on certain c++ files, using -O[1-3] will cause cc1plus to run
199         forever.  On other files, c++ -O[1-3] will cause the assembler to run
200         forever.  This problem is noted on pmax and sparc (NetBSD-1.4.*) with
201         gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
202
203         evidently this problem also exists on arm32.
204 kcah
205
206 hack    mac68k-jade
207 mdate   29 Mar 2001
208 who     hubertf
209 port    mac68k
210 file    textproc/jade/patches/patch-aa: 1.1 : 1 : 999
211 descr
212         jade on mac68k seems to dump core under certain conditions, the
213         patch was sent in by "Kogule, Ryo" <kogule@mars.dti.ne.jp> via
214         tech-pkg. The subject of the thread is "Jade doesn't work"
215         It is suspected that the patch really works around a bug in the
216         toolchain.
217 kcah
218
219 hack    perl5-base
220 mdate   12 Apr 2001
221 who     manu
222 port    all
223 Checking in perl5-base/patches/patch-ag: 1.2 : 1 : 999
224 descr
225         The Xerces-Perl module is implemented as a shared object. It needs
226         some symbols from libgcc.a, such as __eh_alloc. It's not possible
227         to link the xerces-P shared object with libgcc.a, because libgcc.a
228         is not compiled with -fPIC. Hence we need to have the missing
229         symbols in the Perl executable.
230         This hack includes the whole libgcc.a in the Perl executable, and
231         links with c++ so that some mandatory symbols such as __pure_virtual
232         are also included. It should go away with GCC-3.0, or if we make a
233         libgcc.so on day.
234 kcah
235
236 hack    gcc-2.95.3 -O* bug
237 mdate   12 Feb 2002
238 who     mrauch
239 port    i386
240 file    devel/pth/Makefile      : 1.37 : 20 : 22
241 descr
242         OpenOffice segfaults after some time in the pthread library with a
243         completely thrashed stack. Removing optimization when building
244         pth (-O0) avoids this problem.
245 kcah
246
247 hack    binutils-2.11.2 ld versioned symbols bug
248 cdate   26 Feb 2002
249 who     mrauch
250 file    misc/openoffice/patches/patch-dj
251 file    misc/openoffice/patches/patch-dk
252 descr   Using versioned symbols the special symbol _etext can end up
253         in the shared library with a junk value for the version string
254         instead of "0" for no version. Sometimes it is sufficient to
255         reorder the -l flags on the link line but the general hack is to
256         disable versioned symbols.
257 kcah
258
259 hack    sparc64-kth-krb
260 cdate   29 Mar 2002
261 who     hubertf
262 file    security/kth-krb4/Makefile
263 descr   This package hangs when compiling one of the files with the
264         compiler that comes with 1.5ZC. The compiler needs to be killed
265         manually - the package is marked as interactive on sparc64 for
266         that reason.
267 kcah
268
269 hack    cc -O* bug
270 mdate   04 Jun 2002
271 who     cjep
272 port    arm
273 file    net/ucspi-tcp/Makefile  : 1.11 :
274 descr
275         some compilations go into infinite loop if optimisation enabled in
276         gcc-2.95.3 20010315 (release) (NetBSD nb2) as shipped with
277         a releng snapshot (May 31st) of NetBSD-1.6_BETA1. See also abs's
278         entry above. First hang at:
279         ( ( ./compile tryulong32.c && ./load tryulong32 &&  ./tryulong32 ) \
280         >/dev/null 2>&1  && cat uint32.h2 || cat uint32.h1 ) > uint32.h
281 kcah
282
283 hack    cc -O* bug
284 mdate   04 Jun 2002
285 who     cjep
286 port    arm
287 file    net/djbdns/Makefile : 1.19 :
288 descr
289         various files go into infinite loop if optimisation enabled in
290         gcc-2.95.3 20010315 (release) (NetBSD nb2) as shipped with
291         a releng snapshot (May 31st) of NetBSD-1.6_BETA1. See also abs's
292         entry above. First hang as ucspi-tcp.
293 kcah
294
295 hack    cc -O* bug
296 mdate   06 Jun 2002
297 who     cjep
298 port    arm
299 file    emulators/stella/Makefile : 1.5 :
300 descr
301         Usual arm optimisation problem. The first problem is at:
302         c++ -c -O2 -fno-rtti -I. -I../emucore -I../emucore/m6502/src    \
303         -I../emucore/m6502/src/bspf/src -I../ui/x11 -I../ui/sound       \
304         -I/usr/X11R6/include -DBSPF_UNIX ../emucore/m6502/src/M6502.cxx
305 kcah
306
307 hack    cc -O* bug
308 mdate   07 Jun 2002
309 who     cjep
310 port    arm
311 file    databases/cdb/Makefile : 1.3 :
312 descr
313         Usual arm optimisation problem. The first problem occurs around
314         ( cat warn-auto.sh;  echo exec "`head -1 conf-cc`" '-c ${1+"$@"}'  \
315         ) > compile
316         chmod 755 compile
317 kcah
318
319 hack    gcc 2.95.3 -O2 bug
320 mdate   22 Jun 2002
321 who     jlam
322 port    sparc64
323 file    x11/openmotif/patches/patch-ap : 1.2 : 209
324 pr      15477
325 descr
326         With -O2 optimization, a "if {} else if {} else {}" C statement
327         isn't converted into the correct code.
328 kcah
329
330 hack    cc -O* bug
331 mdate   28 Nov 2002
332 who     agc
333 port    arm
334 file    emulators/simh/Makefile : 1.3 :
335 descr
336         Usual arm optimisation problem. The first problem occurs around
337         compilation of altairz80
338 kcah
339
340 hack    gcc-sparc64-memorysize
341 mdate   8 Jan 2003
342 who     salo
343 port    sparc64
344 file    security/skey/patch-aa : 1.2
345 file    security/skey/patch-ab : 1.1
346 descr
347         The SHA1Transform() function causes the sparc64 compiler to use
348         excessive amounts of memory attempting to optimise this function.
349         Using no optimisation allows the function to build.
350 kcah
351
352 hack    ImageMagick arm32+mipsel -O2 bug
353 mdate   25 Jan 2003
354 who     hubertf (the mipsel one, dunno who did the arm32 one)
355 port    cobald (probably other mipsel's), arm32
356 file    graphics/ImageMagick/Makefile : 1.90
357 descr
358         When compiling with -O2, gcc spins at one file. Going back to
359         -O fixes this. (The usual story...)
360 kcah
361
362 hack    zip -O bug
363 mdate   1 Jun 2003
364 who     grant
365 port    powerpc
366 file    archivers/zip/Makefile : 1.33
367 descr
368         When compiling with -O or -O2, gcc dies with an internal
369         compiler error on crypt.c. Turning off optimization fixes this.
370 kcah
371
372 hack    gcc 2.95.3/arm -O2 bug
373 cdate   2 Aug 2003
374 who     kristerw
375 port    arm
376 file    devel/ftnchek/Makefile : 1.13
377 descr   Internal compiler error for fortran.c when -O2. Use -O1 instead.
378 kcah
379
380 hack    gcc 2.95.3/arm -O* bug
381 cdate   19 Oct 2003
382 who     kristerw
383 port    arm
384 file    mail/safecat/patches/patch-aa : 1.1
385 descr   Compilation of the tryulong32.c configuration test takes ~forever.
386 kcah
387
388 hack    gcc 2.95.3/arm internal error
389 cdate   31 Jan 2004
390 who     kristerw
391 port    arm
392 file    games/sjeng/Makefile : 1.7
393 descr   Internal compiler error when compiling search.c.
394 kcah
395
396 hack    gcc 2.95.3/arm -O* bug
397 cdate   31 Jan 2003
398 who     kristerw
399 port    arm
400 file    databases/cdb/patches/patch-aa : 1.1
401 descr   Compilation of the tryulong32.c configuration test takes ~forever.
402 kcah
403
404 hack    perl 5.8/openssl/sparc64 bug
405 cdate   Wed Feb 16 13:24:06 2000
406 who     seb
407 port    sparc64
408 file    security/openssl/patches/patch-ak
409 descr
410         Perl's int() function gives bad result on sparc64.
411         Hence openssl's bn_prime.pl perl script fails.
412         Use POSIX::floor() as a workaround.
413         See perl ticket #25249.
414 kcah
415
416 hack    alpha c++ -O2 bug
417 cdate   Wed Feb 16 13:24:06 2000
418 who     recht
419 port    alpha
420 file    graphics/freetype2/Makefile
421 pr      25742
422 descr
423         The default compiler flags on the alpha port "-O2 -mieee"
424         cause the c++ compiler to generate buggy code.
425 kcah
426
427 hack    sparc64 gcc 3.3.x -O2 bug
428 cdate   29 Apr 2004
429 who     adam
430 port    sparc64
431 file    graphics/netpbm/patches/patch-ab
432 descr
433         sparc64 gcc 3.3.x toolchain bug means we must compile exif.o
434         without optimisation
435 kcah
436
437 hack    i386 g++ 3.3.x -O2 bug
438 cdate   Tue Aug 17 00:59:31 NZST 2004
439 who     dsainty
440 port    i386
441 file    emulators/palmosemulator/patches/patch-an
442 descr
443         EmPoint.cpp malfunctions with optimisation on, trashing point
444         coordinates.  Apparently an aliasing issue with automatic variables on
445         the stack and some fairly dodgy type casting.  The patch file contains
446         more details.
447 kcah
448
449 hack    libtool nawk line length problem
450 cdate   Tue Sep  7 01:23:10 UTC 2004
451 who     jschauma
452 port    mipseb (IRIX)
453 file    x11/gtk2/Makefile
454 descr
455         If we're on IRIX and we're using gcc, then, apparently, we need gawk,
456         as otherwise the awk invocation in libtool breaks complaining about
457         the ``Input record [...] too long'' near the end of the build process.
458         Oddly this does not occur using the mipspro compiler.  Possible
459         reason: using gcc we have longer CFLAGS.  Fix:  add USE_GNU_TOOLS+=awk
460         iff IRIX and gcc.  Problem: this might affect other packages as well.
461         One might consider depending libtool on gawk for IRIX.
462 kcah
463
464 hack    devel/bison -O* bug with sunpro
465 cdate   Tue Nov  2 17:30:48 GMT 2004
466 who     sketch
467 port    sparc (Solaris)
468 file    devel/bison/Makefile : 1.49
469 descr
470         bison's quotearg_buffer_restyled() has issues with certain compilers
471         using optimisation flags.  The resulting bison with optimsation
472         breaks on at least net/libIDL.  BUILDLINK_TRANSFORM -O* away until
473         the root cause can be fixed.
474 kcah
475
476 hack    security/libgpg-error awk on IRIX
477 cdate   Sun May 15 18:08:48 EDT 2005
478 who     jschauma
479 port    mipseb (IRIX)
480 file    security/libgpg-error/Makefile
481 descr
482         Apparently, for as of yet undetermined reasons, gawk as built on IRIX
483         under pkgsrc croaks on regular expressions including a combination of
484         alpha- and numerical matches, such as the rather trivial
485         /^[ \t]*[0-9]+/
486         Let's use the system's AWK (ie nawk) for this package to avoid
487         breaking hundreds of dependents.
488         Speculation: somehow the regular expression library used to build gawk
489         conflicts with the systems regular expression library or some such.
490         Note: gawk from SGIs freeware collection depends on expat -- why is
491         that?  Does that have anything to do with anything?
492 kcah