Home | History | Annotate | Line # | Download | only in doc
HACKS revision 1.14
      1 # $NetBSD: HACKS,v 1.14 2003/10/27 07:31:07 simonb 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 hack	gcc 2.95/vax cannot handle __builtin_ffs()
     31 cdate	Fri Aug 23 21:31:15 CEST 2002
     32 who	ragge
     33 port	vax
     34 file	sys/lib/libkern/libkern.h : 1.42
     35 descr
     36 	__builtin_ffs() is ifdef'd away if __vax__. Matt Thomas has added
     37 	this feature to GCC 3 so it can be removed when switching.
     38 kcah
     39 
     40 hack	binutil-2.11-sparc64-pltrela
     41 mdate	14 Aug 2001
     42 who	eeh
     43 port	sparc64
     44 file	libexec/ld.elf_so/reloc.c: 1.41 : 597 : 619
     45 descr
     46 	The first for PLT entries are reserved.  There is some disagreement
     47 	whether they should have associated relocation entries.  Both the
     48 	SPARC 32-bit and 64-bit ELF specifications say that they should have
     49 	relocation entries, but the 32-bit SPARC binutils do not generate
     50 	them, and now the 64-bit SPARC binutils have stopped generating them
     51 	too.
     52 
     53 	To provide binary compatibility, we will check the first entry, if it
     54 	is reserved it should not be of the type JMP_SLOT.  If it is JMP_SLOT,
     55 	then the 4 reserved entries were not generated and our index is 4
     56 	entries too far, so we frob the rela pointer.
     57 kcah
     58 
     59 hack	netstat ieee1394 address printing.
     60 mdate	14 Nov 2000
     61 who	matt
     62 file	lib/libc/net/getnameinfo.c	: 1.32 : 497 : 503
     63 descr
     64 	Because the current implementation of IP over IEEE1394, the
     65 	fw device address contains more than just the IEEE1394 EUI-64.
     66 	So when printing out IEEE1394 addresses, ignore the extra stuff.
     67 kcah
     68 
     69 hack	xterm vs. libterm
     70 mdate	01 Aug 2000
     71 who	jdc
     72 file	xsrc/xc/programs/xterm/main.c	: 1.2 : 3609 : 3614
     73 pr	10383
     74 descr
     75 	In order to extend the termcap string over 1023 bytes, a ZZ entry was
     76 	introduced to point to a memory location containing the full entry.
     77 	Without this hack, xterm will export a termcap containing the ZZ
     78 	entry, which will then be ignored by libterm.  As xterm modifies the
     79 	exported termcap, this would cause those modifications to be ignored.
     80 kcah
     81 
     82 hack	gcc-sh3-sed
     83 mdate	23 Apr 2002
     84 who	thorpej
     85 file	usr.bin/sed/Makefile	: 1.9 : 9 : 13
     86 descr
     87 	The in-tree GCC 2.95.3-based compiler ICEs when building
     88 	with optimization for SuperH.  Hack is to biuld with -O0.
     89 kcah
     90 
     91 hack	gcc-unsigned-compare
     92 cdate	09 Mar 2002
     93 mdate	18 Mar 2002
     94 who	bjh21
     95 port	arm
     96 file	dist/bind/lib/nameser/ns_parse.c : 1.3
     97 file	dist/dhcp/minires/ns_parse.c : 1.3
     98 file	dist/dhcp/omapip/result.c : 1.2
     99 file	dist/dhcp/server/failover.c : 1.3
    100 file	gnu/dist/gawk/eval.c : 1.4
    101 file	gnu/dist/toolchain/bfd/bfd.c : 1.2
    102 file	gnu/dist/toolchain/bfd/format.c : 1.2
    103 file	gnu/dist/toolchain/gdb/target.c : 1.2
    104 file	sys/kern/vfs_subr.c : 1.172
    105 descr	When checking that a potentially-unsigned enum is >= 0, assign it
    106 	to an int first.  This is necessary to avoid "comparison is always
    107 	true" warnings with -fshort-enums.  Casting to an int really should
    108 	be enough, but turns out not to be.
    109 kcah
    110 
    111 hack	wi-at-big-endian-bus
    112 cdate	15 Mar 2002
    113 who	martin
    114 file	dev/ic/wireg.h
    115 descr	Add an option to access the underlying bus in big endian byte order
    116 	to work around deficiencies in bus_space_{read,write}_* macros.
    117 	Those don't allow the implementation of a proper pcmcia bus space
    118 	tag.
    119 kcah
    120 
    121 hack	gcc-vax-libbz2
    122 mdate	27 Jun 2002
    123 who	thorpej
    124 port	vax
    125 file	lib/libbz2/Makefile
    126 descr
    127 	libbz2 is mis-compiled with optimization with GCC 2.95.3
    128 	on VAX.  -O0 works around this problem.
    129 kcah
    130 
    131 hack	egcs-pc532-ip6_mroute
    132 cdate	09 Jul 2002
    133 who	simonb
    134 port	pc532
    135 file	sys/arch/pc532/conf/Makefile.pc532 : 1.70
    136 file	sys/arch/pc532/conf/files.pc532 : 1.47
    137 descr
    138 	egcs 1.1.2 gets an "internal error--insn does not satisfy its
    139 	constraints" error compiling ip6_mroute.c with -O2 or greater.
    140 	-O1 works around this problem.
    141 kcah
    142 
    143 hack	SuperH SH5 Toolchain Bugs
    144 cdate	11 Jul 2002
    145 who	scw
    146 port	sh5
    147 file	usr.sbin/ndbootd/ndbootd.c : 1.6
    148 file	usr.sbin/traceroute/traceroute.c : 1.48
    149 descr
    150 	The SuperH SH5 toolchain (2.97-sh5-010522) gets an internal
    151 	compiler error when assigning a bit-wise inverted value
    152 	under some circumstances.
    153 	Work around it by splitting the statement into two.
    154 kcah
    155 
    156 hack	vax Toolchain bug
    157 cdate	28 Mar 2003
    158 who	he
    159 port	vax
    160 file	sys/arch/vax/vax/intvec.S : 1.5
    161 descr
    162 	Workaround for PR toolchain/20924.  The assembler apparently
    163 	tries to range-check byte offsets when it doesn't have
    164 	sufficient information to make that decision.
    165 	Workaround uses `brw' instead of `brb' instruction.
    166 kcah
    167 
    168 hack	specific knowledge of colours in curses code
    169 cdate	Sun Apr  6 11:05:24 BST 2003
    170 who	jdc
    171 port	all
    172 file	lib/libcurses/color.c : r1.24
    173 descr
    174 	Swap red/blue and yellow/cyan colours for COLOR_OTHER.
    175 	Fix is to enhance libtermcap to understand terminfo-style % sequences.
    176 	See also:
    177 	    http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html
    178 kcah
    179 
    180 hack	SuperH SH5 Toolchain Bugs
    181 cdate	17 May 2003
    182 who	scw
    183 port	sh5
    184 file	lib/libpthread/pthread_lock.c : 1.7
    185 descr
    186 	The SuperH SH5 toolchain generates incorrect PIC code when faced
    187 	with a symbol which is declared extern, but has local scope due
    188 	to being defined within an asm() statement (without being declared
    189 	.globl in that statement). Work around it by adding the .globl.
    190 kcah
    191 
    192 hack	Compensation for differing types of LINUX_USRSTACK and USRSTACK
    193 cdate	21 Aug 2003
    194 who	he
    195 file	sys/miscfs/procfs/procfs_linux.c : 1.14
    196 descr
    197 	Not all ports have LINUX_USRSTACK and/or USRSTACK defined as
    198 	literals/constants, but refer to variables of a type which is
    199 	not "unsigned long", causing compilation of procfs_linux.c to
    200 	fail with "makes integer from pointer without a cast".  This
    201 	is observed on e.g. the sun3 port.  Ideally the "types" for
    202 	symbols should be consistent across all ports.
    203 kcah
    204 
    205 hack	gcc 3.3.x bug
    206 cdate	Sun Oct 26 01:50:16 UTC 2003
    207 who	lukem
    208 port	MACHINE_ARCH == arm
    209 file	usr.bin/newsyslog/newsyslog.c
    210 pr	22986 23002 23217
    211 descr
    212 	newsyslog fails with
    213 		newsyslog: config line 7: bad flags
    214 	solved when compiled with -fno-gcse-lm
    215 kcah
    216 
    217 hack	gcc-pc532-duffs_device
    218 cdate	Mon Oct 27 07:23:05 UTC 2003
    219 who	simonb
    220 port	pc532
    221 file	sys/arch/pc532/conf/Makefile.pc532 : 1.71
    222 file	sys/arch/pc532/conf/files.pc532 : 1.52
    223 pr	GCC PR optimization/5230
    224 descr
    225 	gcc incorrectly gives an "unreachable code at beginning of switch
    226 	statement" for a Duff's device construct in arch/pc532/dev/ncr.c.
    227 	There is now way to disable just this warning, so -Wno-error is
    228 	turned on for this file.
    229 kcah
    230