HACKS revision 1.166
11.166Schristos# $NetBSD: HACKS,v 1.166 2016/05/04 22:42:40 christos Exp $
21.1Slukem#
31.1Slukem# This file is intended to document workarounds for currently unsolved
41.1Slukem# (mostly) compiler bugs.
51.1Slukem#
61.1Slukem# Format:
71.1Slukem#   hack		title
81.1Slukem#   cdate		creation date
91.1Slukem#   mdate		mod date
101.1Slukem#   who			responsible developer
111.1Slukem#   port		...
121.1Slukem#  	  affected ports, space separated, if not "all"
131.1Slukem#   file		affected file : revision : line from : line to
141.1Slukem#  	  affected files and revision and line numbers describing hack
151.1Slukem#  	  multiple lines if necessary.
161.1Slukem#   pr			NNNN ...
171.1Slukem#  	  problem reports this hack works around, if known. Space
181.1Slukem#  	  separated.
191.1Slukem#   regress		src/regress/directory/where/test/found
201.1Slukem#  	  regression test directories, if available.
211.1Slukem#   descr
221.1Slukem#  	  insert short informal description (multi-line). (Longer ones
231.1Slukem#  	  should be in the PR database. More formal descriptions might
241.1Slukem#  	  be in the regress tree. See above).
251.1Slukem#   kcah
261.1Slukem#  	  closing bracket.
271.1Slukem#
281.1Slukem# this is a comment.
291.1Slukem
301.166Schristoshack	gcc-5.3 optimizes memset+malloc -> calloc inside calloc
311.166Schristosmdate	4 May 2016
321.166Schristoswho	christos
331.166Schristosfile	external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5
341.166Schristosdescr
351.166Schristos	resulting in infinite recursion; we prevent this with
361.166Schristos	-fno-builtin-malloc
371.166Schristoskcah
381.166Schristos
391.1Slukemhack	netstat ieee1394 address printing.
401.1Slukemmdate	14 Nov 2000
411.1Slukemwho	matt
421.1Slukemfile	lib/libc/net/getnameinfo.c	: 1.32 : 497 : 503
431.1Slukemdescr
441.1Slukem	Because the current implementation of IP over IEEE1394, the
451.1Slukem	fw device address contains more than just the IEEE1394 EUI-64.
461.1Slukem	So when printing out IEEE1394 addresses, ignore the extra stuff.
471.1Slukemkcah
481.1Slukem
491.1Slukemhack	xterm vs. libterm
501.1Slukemmdate	01 Aug 2000
511.1Slukemwho	jdc
521.1Slukemfile	xsrc/xc/programs/xterm/main.c	: 1.2 : 3609 : 3614
531.1Slukempr	10383
541.1Slukemdescr
551.1Slukem	In order to extend the termcap string over 1023 bytes, a ZZ entry was
561.1Slukem	introduced to point to a memory location containing the full entry.
571.1Slukem	Without this hack, xterm will export a termcap containing the ZZ
581.1Slukem	entry, which will then be ignored by libterm.  As xterm modifies the
591.1Slukem	exported termcap, this would cause those modifications to be ignored.
601.1Slukemkcah
611.1Slukem
621.1Slukemhack	wi-at-big-endian-bus
631.1Slukemcdate	15 Mar 2002
641.1Slukemwho	martin
651.1Slukemfile	dev/ic/wireg.h
661.1Slukemdescr	Add an option to access the underlying bus in big endian byte order
671.1Slukem	to work around deficiencies in bus_space_{read,write}_* macros.
681.1Slukem	Those don't allow the implementation of a proper pcmcia bus space
691.1Slukem	tag.
701.1Slukemkcah
711.1Slukem
721.3Sjdchack	specific knowledge of colours in curses code
731.3Sjdccdate	Sun Apr  6 11:05:24 BST 2003
741.3Sjdcwho	jdc
751.3Sjdcfile	lib/libcurses/color.c : r1.24
761.3Sjdcdescr
771.3Sjdc	Swap red/blue and yellow/cyan colours for COLOR_OTHER.
781.3Sjdc	Fix is to enhance libtermcap to understand terminfo-style % sequences.
791.3Sjdc	See also:
801.5Ssalo	    http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html
811.4Sscwkcah
821.4Sscw
831.7Shehack	Compensation for differing types of LINUX_USRSTACK and USRSTACK
841.7Shecdate	21 Aug 2003
851.7Shewho	he
861.7Shefile	sys/miscfs/procfs/procfs_linux.c : 1.14
871.7Shedescr
881.7She	Not all ports have LINUX_USRSTACK and/or USRSTACK defined as
891.7She	literals/constants, but refer to variables of a type which is
901.7She	not "unsigned long", causing compilation of procfs_linux.c to
911.7She	fail with "makes integer from pointer without a cast".  This
921.7She	is observed on e.g. the sun3 port.  Ideally the "types" for
931.7She	symbols should be consistent across all ports.
941.25Smrgkcah
951.25Smrg
961.37Sjunyounghack	gcc-strict-aliasing
971.37Sjunyoungcdate	6 August 2004
981.37Sjunyoungwho	junyoung
991.37Sjunyoungpr	26516
1001.37Sjunyoungfile	src/usr.sbin/racoon/racoon/Makefile : 1.21
1011.37Sjunyoungdescr
1021.37Sjunyoung	GCC issues a warning "dereferencing type-punned pointer will break
1031.37Sjunyoung	strict-aliasing rules" when compiling
1041.37Sjunyoung	crypto/dist/kame/racoon/crypto/openssl.c with -O[23s]. Note that this
1051.38Sjunyoung	is due to use of type casting in a non-standard way in the code and
1061.38Sjunyoung	not a compiler bug. Once a new release of KAME with a proper fix
1071.38Sjunyoung	applied is imported this should be backed out.
1081.37Sjunyoungkcah
1091.37Sjunyoung
1101.80Stsutsuihack	gcc4 wrong uninitialized variable
1111.58Smrgmdate	10 May 2006
1121.58Smrgwho	mrg
1131.58Smrgfile	bin/ksh/eval.c			: 1.6
1141.58Smrgfile	bin/sh/histedit.c		: 1.39
1151.58Smrgfile	bin/sh/parser.c			: 1.60
1161.58Smrgfile	crypto/dist/heimdal/kdc/524.c	: 1.10
1171.58Smrgfile	crypto/dist/ssh/sftp.c		: 1.20
1181.58Smrgfile	crypto/dist/ssh/ssh-keysign.c	: 1.11
1191.58Smrgfile	dist/ipf/lib/hostname.c		: 1.2
1201.58Smrgfile	dist/ipf/tools/ipmon.c		: 1.8
1211.72Smrgfile	dist/ntp/ntpd/ntp_request.c	: 1.4
1221.58Smrgfile	dist/ntp/ntpd/refclock_shm.c	: 1.4
1231.58Smrgfile	dist/ntp/sntp/timing.c		: 1.3
1241.58Smrgfile	dist/pppd/pppstats/pppstats.c	: 1.3
1251.58Smrgfile	dist/smbfs/lib/smb/rap.c	: 1.6
1261.58Smrgfile	dist/tcpdump/print-zephyr.c	: 1.5
1271.68Smrgfile	distrib/utils/sysinst/aout2elf.c : 1.12
1281.58Smrgfile	gnu/libexec/uucp/uucico/uucico.c : 1.6
1291.58Smrgfile	lib/libc/citrus/citrus_csmapper.c : 1.6
1301.58Smrgfile	lib/libc/citrus/citrus_pivot_factory.c : 1.5
1311.58Smrgfile	lib/libc/inet/inet_cidr_ntop.c	: 1.3
1321.58Smrgfile	lib/libc/inet/inet_ntop.c	: 1.3
1331.58Smrgfile	lib/libc/stdio/vfwprintf.c	: 1.8
1341.69Smrgfile	libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20
1351.76Smrgfile	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40
1361.74Smrgfile	libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22
1371.69Smrgfile	libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39
1381.58Smrgfile	libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39
1391.74Smrgfile	libexec/ld.elf_so/arch/vax/mdreloc.c	: 1.21
1401.71Sdanfile	libexec/ld.elf_so/arch/x86_64/mdreloc.c	: 1.27
1411.58Smrgfile	sbin/fsck_ext2fs/dir.c		: 1.19
1421.58Smrgfile	sbin/routed/rtquery/rtquery.c	: 1.18
1431.73Sdanfile	sys/arch/amd64/amd64/pmap.c	: 1.26
1441.79Smrgfile	sys/arch/i386/pci/piixpcib.c	: 1.4
1451.80Stsutsuifile	sys/arch/m68k/m68k/pmap_motorola.c	: 1.4
1461.58Smrgfile	sys/crypto/cast128/cast128.c	: 1.9
1471.58Smrgfile	sys/ddb/db_command.c		: 1.86
1481.68Smrgfile	sys/dev/cardbus/cardbus_map.c	: 1.21
1491.58Smrgfile	sys/dev/fss.c			: 1.25
1501.69Smrgfile	sys/dev/ic/igsfb.c		: 1.39
1511.68Smrgfile	sys/dev/ic/mb86950.c		: 1.5
1521.58Smrgfile	sys/dev/ic/midway.c		: 1.71
1531.68Smrgfile	sys/dev/kttcp.c			: 1.18
1541.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1551.68Smrgfile	sys/dev/pci/cmpci.c		: 1.31
1561.58Smrgfile	sys/dev/pci/machfb.c		: 1.45
1571.68Smrgfile	sys/dev/usb/ohci.c		: 1.174
1581.68Smrgfile	sys/dev/usb/uhci.c		: 1.196
1591.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1601.58Smrgfile	sys/dist/ipf/netinet/ip_nat.c	: 1.10
1611.58Smrgfile	sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8
1621.58Smrgfile	sys/dist/pf/net/pf.c		: 1.22
1631.59Smrgfile	sys/fs/udf/udf_vnops.c		: 1.4
1641.58Smrgfile	sys/kern/kern_sig.c		: 1.219
1651.58Smrgfile	sys/kern/tty.c			: 1.181
1661.58Smrgfile	sys/net/bpf.c			: 1.116
1671.58Smrgfile	sys/net/zlib.c			: 1.26
1681.68Smrgfile	sys/netccitt/if_x25subr.c	: 1.37
1691.58Smrgfile	sys/netinet/in.c		: 1.107
1701.58Smrgfile	sys/netsmb/smb_smb.c		: 1.27
1711.58Smrgfile	sys/netsmb/smb_trantcp.c	: 1.22
1721.58Smrgfile	sys/nfs/nfs_serv.c		: 1.108
1731.58Smrgfile	sys/nfs/nfs_socket.c		: 1.129
1741.58Smrgfile	sys/nfs/nfs_syscalls.c		: 1.91
1751.58Smrgfile	sys/ufs/lfs/lfs_vfsops.c	: 1.207 [also (char *)]
1761.58Smrgfile	usr.bin/ftp/ftp.c		: 1.140
1771.58Smrgfile	usr.bin/find/function.c		: 1.54
1781.58Smrgfile	usr.bin/mail/tty.c		: 1.20
1791.100Stsutsuifile	usr.bin/msgc/msg_sys.def	: 1.33-1.34
1801.58Smrgfile	usr.bin/nl/nl.c			: 1.7
1811.58Smrgfile	usr.bin/systat/keyboard.c	: 1.23
1821.58Smrgfile	usr.bin/usbhidctl/usbhid.c	: 1.29
1831.58Smrgfile	usr.bin/vi/cl/cl_read.c		: 1.5
1841.58Smrgfile	usr.bin/vi/ex/ex_cscope.c	: 1.12
1851.58Smrgfile	usr.bin/vi/ex/ex_tag.c		: 1.19
1861.58Smrgfile	usr.bin/vi/vi/v_txt.c		: 1.15
1871.58Smrgfile	usr.sbin/altq/altqstat/qdisc_rio.c : 1.4
1881.58Smrgfile	usr.sbin/cron/do_command.c	: 1.19
1891.58Smrgfile	usr.sbin/timed/timed/slave.c	: 1.15
1901.58Smrgdescr
1911.58Smrg	GCC 4.1 gets many uninitialised variable warnings wrong.  We should
1921.58Smrg	really audit all the old hacks like this when older compilers are
1931.58Smrg	removed from the tree, as many are probably no longer required.
1941.65Schristos	The problem is that it does not recognize initialization via function
1951.65Schristos	call pointer. I.e.
1961.65Schristos		int p;
1971.65Schristos		foo(&p);
1981.65Schristos	does not mark p as initialized.
1991.58Smrgkcah
2001.58Smrg
2011.59Smrghack	gcc4 pointer sign and strict aliasing problems
2021.59Smrgmdate	10 May 2006
2031.59Smrgwho	mrg
2041.59Smrgfile	bin/ed/Makefile			: 1.33
2051.68Smrgfile	distrib/utils/sysinst/Makefile.inc : 1.44
2061.91Smartinfile	distrib/utils/x_dhclient/Makefile : 1.15
2071.60Smrgfile	games/bcd/Makefile		: 1.5
2081.60Smrgfile	games/dab/Makefile		: 1.5
2091.60Smrgfile	games/larn/Makefile		: 1.17
2101.60Smrgfile	games/pom/Makefile		: 1.5
2111.60Smrgfile	lib/libasn1/Makefile		: 1.26
2121.60Smrgfile	lib/libcrypt/Makefile		: 1.17
2131.60Smrgfile	lib/libgssapi/Makefile		: 1.16
2141.60Smrgfile	lib/libhdb/Makefile		: 1.20
2151.60Smrgfile	lib/libkadm5clnt/Makefile	: 1.21
2161.60Smrgfile	lib/libkadm5srv/Makefile	: 1.25
2171.60Smrgfile	lib/libkrb5/Makefile		: 1.35
2181.60Smrgfile	lib/libssh/Makefile		: 1.6
2191.60Smrgfile	lib/libtelnet/Makefile		: 1.26
2201.60Smrgfile	libexec/getty/Makefile		: 1.14
2211.60Smrgfile	libexec/kadmind/Makefile	: 1.19
2221.60Smrgfile	libexec/kpasswdd/Makefile	: 1.14
2231.60Smrgfile	sbin/atactl/Makefile		: 1.3
2241.60Smrgfile	sbin/cgdconfig/Makefile		: 1.7
2251.60Smrgfile	sbin/clri/Makefile		: 1.13
2261.60Smrgfile	sbin/dkctl/Makefile		: 1.4
2271.60Smrgfile	sbin/dump/Makefile		: 1.33
2281.60Smrgfile	sbin/fdisk/Makefile		: 1.35
2291.60Smrgfile	sbin/fsck_ext2fs/Makefile	: 1.11
2301.60Smrgfile	sbin/fsck_ffs/Makefile		: 1.29
2311.60Smrgfile	sbin/fsdb/Makefile		: 1.18
2321.60Smrgfile	sbin/mount_smbfs/Makefile	: 1.4
2331.60Smrgfile	sbin/newfs/Makefile		: 1.30
2341.60Smrgfile	sbin/newfs_sysvbfs/Makefile	: 1.2
2351.60Smrgfile	sbin/restore/Makefile		: 1.23
2361.60Smrgfile	sbin/veriexecctl/Makefile	: 1.11
2371.64Smrgfile	sys/lib/libsa/Makefile		: 1.59
2381.68Smrgfile	sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24
2391.59Smrgfile	usr.bin/awk/Makefile		: 1.9
2401.64Smrgfile	usr.bin/crontab/Makefile	: 1.24
2411.60Smrgfile	usr.bin/ctags/Makefile		: 1.8
2421.61Smrgfile	usr.bin/gzip/Makefile		: 1.10
2431.60Smrgfile	usr.bin/ssh/sftp/Makefile	: 1.10
2441.60Smrgfile	usr.bin/ssh/ssh/Makefile	: 1.25
2451.59Smrgfile	usr.bin/vi/build/Makefile	: 1.26
2461.60Smrgfile	usr.bin/telnet/Makefile		: 1.40
2471.60Smrgfile	usr.bin/tn3270/tn3270/Makefile	: 1.36
2481.60Smrgfile	usr.bin/tr/Makefile		: 1.4
2491.59Smrgfile	usr.sbin/amd/amd/Makefile	: 1.27
2501.59Smrgfile	usr.sbin/amd/amq/Makefile	: 1.14
2511.59Smrgfile	usr.sbin/amd/libamu/Makefile	: 1.20
2521.59Smrgfile	usr.sbin/amd/pawd/Makefile	: 1.5
2531.59Smrgfile	usr.sbin/bind/Makefile.inc	: 1.22
2541.60Smrgfile	usr.sbin/bind/libdns/Makefile	: 1.3
2551.60Smrgfile	usr.sbin/bind/named/Makefile	: 1.17
2561.60Smrgfile	usr.sbin/bootp/bootptest/Makefile : 1.2
2571.60Smrgfile	usr.sbin/chrtbl/Makefile	: 1.6
2581.60Smrgfile	usr.sbin/cron/Makefile		: 1.12
2591.59Smrgfile	usr.sbin/dhcp/Makefile.inc	: 1.20
2601.59Smrgfile	usr.sbin/dumplfs/Makefile	: 1.11
2611.60Smrgfile	usr.sbin/hprop/Makefile		: 1.13
2621.60Smrgfile	usr.sbin/installboot/Makefile	: 1.35
2631.59Smrgfile	usr.sbin/ipf/ipftest/Makefile	: 1.32
2641.59Smrgfile	usr.sbin/isdn/isdnd/Makefile	: 1.6
2651.59Smrgfile	usr.sbin/isdn/isdnmonitor/Makefile : 1.3
2661.59Smrgfile	usr.sbin/isdn/isdntel/Makefile	: 1.2
2671.59Smrgfile	usr.sbin/isdn/isdntrace/Makefile : 126
2681.61Smrgfile	usr.sbin/mopd/common/Makefile	: 1.10
2691.61Smrgfile	usr.sbin/mopd/mopd/Makefile	: 1.9
2701.61Smrgfile	usr.sbin/mopd/mopprobe/Makefile	: 1.7
2711.60Smrgfile	usr.sbin/makefs/Makefile	: 1.17
2721.60Smrgfile	usr.sbin/mscdlabel/Makefile	: 1.5
2731.60Smrgfile	usr.sbin/pkg_install/add/Makefile : 1.7
2741.60Smrgfile	usr.sbin/pkg_install/create/Makefile : 1.5
2751.60Smrgfile	usr.sbin/pkg_install/lib/Makefile : 1.28
2761.59Smrgfile	usr.sbin/ntp/ntpd/Makefile	: 1.10/1.11
2771.59Smrgfile	usr.sbin/ntp/ntptime/Makefile	: 1.4/1.5
2781.59Smrgfile	usr.sbin/pppd/Makefile.inc	: 1.3
2791.59Smrgfile	usr.sbin/pppd/pppd/Makefile	: 1.38
2801.60Smrgfile	usr.sbin/rarpd/Makefile		: 1.10
2811.59Smrgfile	usr.sbin/rbootd/Makefile	: 1.10
2821.60Smrgfile	usr.sbin/rpc.pcnfsd/Makefile	: 1.17
2831.59Smrgfile	usr.sbin/rtadvd/Makefile	: 1.9
2841.60Smrgfile	usr.sbin/tcpdump/Makefile	: 1.42
2851.59Smrgfile	usr.sbin/wiconfig/Makefile	: 1.3
2861.59Smrgdescr
2871.59Smrg	GCC 4.1 warns on pointer sign comparision/assignments and lots of
2881.59Smrg	code does not conform.  For now we use -Wno-pointer-sign and
2891.59Smrg	-fno-strict-aliasing.
2901.59Smrgkcah
2911.59Smrg
2921.145Schristoshack	disable ctf for gcc-4.8 build
2931.145Schristosmdate	April 3 2014
2941.146Swizwho	christos
2951.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.frontend	: 1.4
2961.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.backend	: 1.5
2971.145Schristosdescr
2981.145Schristos	nbctfconvert -g -L VERSION -g fold-const.o
2991.145Schristos	ERROR: fold-const.c: failed to get mapping for tid 79154 \
3001.145Schristos		((null)) <13532>
3011.145Schristoskcak
3021.145Schristos
3031.121Schristoshack	emacs aborting on exit (libgcc issue)
3041.121Schristosmdate	7 November 2011
3051.121Schristoswho	christos
3061.121Schristosfile	external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2
3071.121Schristosdescr
3081.121Schristos	GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit
3091.121Schristos	to do just that. If the symbol requested is not found, then it aborts.
3101.121Schristos	emacs 23.3 triggers this assertion. For now disable aborting, and
3111.121Schristos	silently ignore.
3121.121Schristoskcah
3131.121Schristos
3141.105Sagchack	cross-building hack on Darwin
3151.105Sagcmdate	20 July 2008
3161.105Sagcwho	agc
3171.105Sagcfile	src/distrib/common/Makefile.mdset	: 1.33
3181.105Sagcdescr
3191.105Sagc	Darwin has problems with getopt() when used in mdsetimage -v,
3201.105Sagc	due to the difference between BSD and libiberty() getopt
3211.105Sagc	implementations, more fully described in
3221.105Sagc	http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html
3231.105Sagc	and the subsequent thread.  For just now, we just have an ugly
3241.105Sagc	workaround not to call mdsetimage with the -v argument on Darwin
3251.105Sagckcah
3261.105Sagc
3271.109Sveegohack	avoid rebuilding asn1 libraries
3281.109Sveegomdate	03 August 2008
3291.109Sveegowho	veego
3301.109Sveegofile	src/crypto/dist/heimdal/lib/asn1/gen.c	: 1.10
3311.109Sveegofile	src/lib/libasn1/Makefile	: 1.32
3321.109Sveegofile	src/lib/libhdb/Makefile	: 1.23
3331.109Sveegofile	src/lib/libgssapi/Makefile	: 1.20
3341.109Sveegofile	src/lib/libhx509/Makefile	: 1.3
3351.109Sveegopr	9702 39185
3361.109Sveegodescr
3371.109Sveego	asn1_compile does not check if generated header files do not have to
3381.109Sveego	be rebuild.
3391.109Sveego	Generate .hx files and copy it in the Makefiles if they changed.
3401.109Sveegokcah
3411.109Sveego
3421.111Stsutsuihack	avoid gcc4 -O1 bug in loop optimize
3431.111Stsutsuicdate	29 November 2008
3441.111Stsutsuiwho	tsutsui
3451.111Stsutsuifile	src/sbin/ifconfig/Makefile	: 1.39
3461.111Stsutsuipr	40036 40066
3471.111Stsutsuidescr
3481.111Stsutsui	gcc -O1 seems to generate wrong code in loop optimize so that
3491.111Stsutsui	ifconfig lo0 inet6 doesn't return error even if a kernel
3501.111Stsutsui	doesn't have IPv6 support. (see the above PRs for details)
3511.111Stsutsui	For workaround, specify -fno-loop-optimize on m68000,
3521.111Stsutsui	which uses -O1 by default.
3531.111Stsutsuikcah
3541.111Stsutsui
3551.114Schristoshack	MKPIE ldscript for /usr.sbin/crash
3561.114Schristoscdate	22 April 2010
3571.114Schristoswho	christos
3581.114Schristosfile	src/usr.sbin/crash/Makefile	: 1.5
3591.114Schristosfile	src/usr.sbin/crash/ldscript.crash	: 1.1
3601.114Schristospr	N/A
3611.114Schristosdescr
3621.114Schristos	fixed in binutils-2.20.1. Linking with MKPIE=yes causes overlapping
3631.114Schristos	sections
3641.114Schristoskcah
3651.114Schristos
3661.144Stronhack	Disable fortification for /usr/bin/makeinfo
3671.144Stroncdata	24 Mar 2014
3681.144Stronwho	tron
3691.144Stronfile	src/gnu/usr.bin/texinfo/makeinfo/Makefile	: 1.8
3701.144Stronpr	N/A
3711.144Strondescr
3721.144Stron	If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3
3731.144Stron	it fails to process certain texinfo files, e.g. "cl.texi"
3741.144Stron	included in the Emacs 24.3 distribution.
3751.144Stronkcah
3761.144Stron
3771.147Stronhack	Disable Stack Smash Protection for /usr/X11R7/bin/xauth
3781.147Stroncdata	05 Apr 2014
3791.147Stronwho	tron
3801.147Stronfile	src/external/mit/xorg/bin/xauth/Makefile	: 1.4
3811.147Stronpr	N/A
3821.147Strondescr
3831.147Stron	If "xauth" is compile with "USE_SSP" set to "yes" it fails
3841.147Stron	mysteriously with an error message like this:
3851.147Stron
3861.147Stron	/usr/X11R7/bin/xauth:  file /foo/bar/.Xauthority does not exist
3871.147Stron	/usr/X11R7/bin/xauth:  unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority
3881.147Stron
3891.147Stron	The compiler seems to get confused about the two filename variables
3901.147Stron	used in the link(2) system call.
3911.147Stronkcah
3921.147Stron
3931.162Spookahack	g++ 5.x barfs on volatile in constexpr initializers
3941.162Spookacdata	27 Aug 2015
3951.160Spookawho	pooka
3961.162Spookafile	src/lib/libpthread/pthread_types.h	: 1.17
3971.160Spookapr	lib/49989
3981.160Spookadescr
3991.160Spooka	Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER
4001.160Spooka	in C++ results in:
4011.160Spooka		error: temporary of non-literal type '__pthread_mutex_st'
4021.160Spooka		in a constant expression
4031.160Spooka		constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
4041.160Spooka		[...]
4051.160Spooka		include/pthread_types.h:101:8: note: '__pthread_mutex_st' is
4061.160Spooka		not literal because:
4071.160Spooka		struct __pthread_mutex_st {
4081.160Spooka		^
4091.160Spooka		include/pthread_types.h:103:17: note:   non-static data
4101.160Spooka		member '__pthread_mutex_st::ptm_errorcheck' has volatile type
4111.160Spooka		pthread_spin_t ptm_errorcheck;
4121.160Spookakcah
4131.160Spooka
4141.163Schristoshack	libm cabs{,f,l} and g++
4151.163Schristoscdata	11 Jan 2016
4161.163Schristoswho	christos
4171.163Schristospr	lib/50646
4181.163Schristosfile	src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2
4191.163Schristosfile	src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2
4201.163Schristosdescr
4211.163Schristos	Our cabs and cabsf have a different argument format on some architectures
4221.163Schristos	and for that we have created in libm/compat_cabs{,f}.c. The standard
4231.163Schristos	versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in
4241.163Schristos	<complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they
4251.163Schristos	translate by default to cabs{,f,l} which gets defined to cabs{,f} (the
4261.163Schristos	wrong function) and an undefined cabsl. I've changed <complex> to use
4271.163Schristos	the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is
4281.163Schristos	still broken.
4291.163Schristoskcah
4301.163Schristos
4311.21Smycroftport	vax
4321.21Smycroft
4331.102Stsutsui	hack	gcc4/vax ICE
4341.102Stsutsui	cdate	
4351.102Stsutsui	who	tsutsui
4361.102Stsutsui	file	sys/arch/vax/conf/Makefile.vax
4371.102Stsutsui	descr
4381.102Stsutsui		GCC4 on vax gets ICE on compiling sys/ddb/db_command.c.
4391.102Stsutsui		-fno-tree-ter prevents it so add it to COPTS.
4401.102Stsutsui	kcah
4411.102Stsutsui
4421.81Smrg	hack	gcc4/vax compiler crash
4431.81Smrg	cdate	Fri Jun 30 22:39:12 PDT 2006
4441.81Smrg	who	mrg
4451.81Smrg	file	bin/csh/Makefile	: 1.27
4461.81Smrg	file	lib/i18n_module/UTF7/Makefile	: 1.2
4471.81Smrg	descr
4481.81Smrg		GCC4 on vax crashes.  -O0 stops it happening so far...
4491.81Smrg	kcah
4501.81Smrg
4511.21Smycroft	hack	vax Toolchain bug
4521.21Smycroft	cdate	28 Mar 2003
4531.21Smycroft	who	he
4541.21Smycroft	file	sys/arch/vax/vax/intvec.S : 1.5
4551.21Smycroft	descr
4561.21Smycroft		Workaround for PR toolchain/20924.  The assembler apparently
4571.21Smycroft		tries to range-check byte offsets when it doesn't have
4581.21Smycroft		sufficient information to make that decision.
4591.21Smycroft		Workaround uses `brw' instead of `brb' instruction.
4601.23She	kcah
4611.23She
4621.54She	hack	declare boolean_t in two IPF user-mode programs
4631.54She	cdate	Tue Mar  7 19:19:20 CET 2006
4641.54She	who	he
4651.54She	file	dist/ipf/ipsend/iptests.c : 1.8
4661.54She		dist/ipf/ipsend/sock.c : 1.7
4671.54She	descr
4681.54She		The IPF user-mode programs ipsend and iptest first
4691.54She		include <sys/types.h> without _KERNEL defined, and
4701.54She		later include <sys/file.h> with _KERNEL defined.
4711.54She		This causes a build failure when building for vax,
4721.54She		since <sys/device.h> ends up being included without
4731.54She		bollean_t being defined by <sys/types.h>.
4741.54She		Build failure and further details documented in
4751.54She		PR#32907.
4761.54She	kcah
4771.54She
4781.104Sgmcgarry	hack	pcc 0.9.9 large string literals
4791.104Sgmcgarry	cdat	8 July 2008
4801.104Sgmcgarry	who	gmcgarry
4811.104Sgmcgarry	file	sys/conf/param.c : 1.58
4821.104Sgmcgarry	descr
4831.104Sgmcgarry		Workaround for pcc 0.9.9 not handling large string literals
4841.104Sgmcgarry		which causes kernels with 'options INCLUDE_CONFIG_FILE' to
4851.104Sgmcgarry		fail compilation.
4861.104Sgmcgarry		There is a proposal on the pcc mailing list to stuff config
4871.104Sgmcgarry		file in ELF section.
4881.104Sgmcgarry	kcah
4891.104Sgmcgarry
4901.107Smrg	hack	xorg warnings
4911.129Schristos	cdat	30 July 2008, 3 June, 2013
4921.107Smrg	who	mrg
4931.108Smrg	file	external/mit/xorg/lib/libSM/Makefile : 1.2
4941.129Schristos		external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10
4951.107Smrg		external/mit/xorg/lib/libXext/Makefile : 1.2
4961.107Smrg		external/mit/xorg/lib/libXfont/Makefile : 1.2
4971.107Smrg	descr
4981.107Smrg		Disable several warnings or use -Wno-error across Xorg sources
4991.107Smrg		while we get them working
5001.107Smrg	kcah
5011.107Smrg
5021.112Schristos	hack	32 bit time leftovers
5031.112Schristos	cdat	11 January 2009
5041.112Schristos	who	christos
5051.112Schristos	file	lib/libc/time/localtime.c : 1.41
5061.112Schristos		lib/libc/time/zic.c : 1.23
5071.112Schristos	descr
5081.112Schristos		The timezone compiled files still contain 32 bit time_t
5091.112Schristos		quantities. I did not want to version the files because
5101.112Schristos		the ``parser'' is too ugly for words. What needs to be
5111.112Schristos		done, is to rewrite the parser from scratch also to avoid
5121.112Schristos		potential core-dumps from parsing invalid files.
5131.112Schristos	kcah
5141.112Schristos
5151.112Schristos	hack	32 bit time leftovers
5161.112Schristos	cdat	11 January 2009
5171.112Schristos	who	christos
5181.112Schristos	file	various
5191.112Schristos	descr
5201.113Ssketch		Many filesystem on-disk formats have 32 bit times.
5211.112Schristos	kcah
5221.112Schristos
5231.141Schristos	hack	gcc 4.5 fsdb miscompile
5241.140Schristos	date	Sat Nov  9 11:03:02 EST 2013
5251.140Schristos	who	christos
5261.141Schristos	file	src/sbin/fsdb/Makefile : 1.36 (and earlier)
5271.140Schristos	descr
5281.140Schristos		src/sbin/fsdb/fsdb.c: In function 'findblk':
5291.140Schristos		src/sbin/fsdb/fsdb.c:610:1: error: unrecognizable insn:
5301.140Schristos		(insn 941 940 942 134 src/sbin/fsdb/fsdb.c:589 (set (reg:SI 604)
5311.140Schristos		    (subreg:SI (mem/s/j:DI (plus:SI (mult:SI (reg:SI 602)
5321.140Schristos                        (const_int 8 [0x8]))
5331.140Schristos                    (reg/f:SI 601)) [0 curinode.99_378->dp2.di_ib S8 A32]) 4)) \
5341.140Schristos			-1 (nil))
5351.140Schristos		src/sbin/fsdb/fsdb.c:610:1: internal compiler error: in \
5361.140Schristos		extract_insn, at recog.c:2103
5371.140Schristos	kcah
5381.140Schristos
5391.141Schristos	hack	gcc 4.8 gcc miscompiles
5401.141Schristos	date	Sat Nov  9 16:35:18 EST 2013
5411.141Schristos	who	christos
5421.141Schristos	file	distrib/utils/x_ping/Makefile
5431.141Schristos	file	distrib/vax/miniroot/Makefile.inc
5441.141Schristos	file	distrib/vax/ramdisk/Makefile
5451.141Schristos	file	external/gpl3/gdb/lib/libdecnumber/Makefile
5461.141Schristos	file	sbin/fsdb/Makefile
5471.141Schristos	file	sbin/newfs_ext2fs/Makefile
5481.141Schristos	file	sbin/ping/Makefile
5491.141Schristos	file	usr.sbin/lmcconfig/Makefile
5501.141Schristos	file	usr.sbin/mtrace/Makefile
5511.141Schristos	descr
5521.141Schristos		external/gpl3/gcc/dist/gcc/expmed.c:2781:1:
5531.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5541.141Schristos		external/gpl3/gcc/dist/gcc/recog.c:770:1:
5551.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5561.141Schristos		external/gpl3/gcc/dist/libdecnumber/decNumber.c:7214:3:
5571.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5581.141Schristos		sbin/ping/ping.c:679:1:
5591.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5601.141Schristos		sbin/newfs_ext2fs/mke2fs.c:681:1:
5611.141Schristos		internal compiler error: in reload_combine_note_use,
5621.141Schristos		at postreload.c:1561
5631.141Schristos		external/gpl3/gdb/dist/libdecnumber/decNumber.c:7214:3:
5641.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5651.141Schristos		usr.sbin/lmcconfig/lmcconfig.c:939:3:
5661.141Schristos		internal compiler error: in reload_combine_note_use,
5671.141Schristos		at postreload.c:1561
5681.141Schristos		usr.sbin/mtrace/mtrace.c:1655:1:
5691.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5701.141Schristos	kcah
5711.141Schristos
5721.21Smycroftport	arm
5731.21Smycroft
5741.21Smycroft	hack	gcc-unsigned-compare
5751.21Smycroft	cdate	09 Mar 2002
5761.21Smycroft	mdate	18 Mar 2002
5771.21Smycroft	who	bjh21
5781.21Smycroft	file	dist/bind/lib/nameser/ns_parse.c : 1.3
5791.21Smycroft	file	dist/dhcp/minires/ns_parse.c : 1.3
5801.21Smycroft	file	dist/dhcp/omapip/result.c : 1.2
5811.21Smycroft	file	dist/dhcp/server/failover.c : 1.3
5821.21Smycroft	file	gnu/dist/toolchain/bfd/bfd.c : 1.2
5831.21Smycroft	file	gnu/dist/toolchain/bfd/format.c : 1.2
5841.21Smycroft	file	gnu/dist/toolchain/gdb/target.c : 1.2
5851.21Smycroft	file	sys/kern/vfs_subr.c : 1.172
5861.21Smycroft	descr	When checking that a potentially-unsigned enum is >= 0, assign
5871.21Smycroft		it to an int first.  This is necessary to avoid "comparison is
5881.21Smycroft		always true" warnings with -fshort-enums.  Casting to an int
5891.21Smycroft		really should be enough, but turns out not to be.
5901.21Smycroft	kcah
5911.21Smycroft
5921.122Stsutsui	hack	gcc-4.5 arm CNAME hostname lookup failure on
5931.122Stsutsui		certain DNS environment (probably -ftree-ter problem)
5941.122Stsutsui	cdate	Sat Dec 24 04:59:00 UTC 2011
5951.122Stsutsui	mdate	
5961.122Stsutsui	who	tsutsui
5971.122Stsutsui	file	lib/libc/net/Makefile.inc 1.79
5981.122Stsutsui	descr	Hostname lookup against CNAMEs by some commands fails
5991.122Stsutsui		on certain DNS environments if lib/libc/net/gethnamaddr.c
6001.122Stsutsui		(ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc)
6011.122Stsutsui		are compiled with -O2, even though nslookup(1) against
6021.122Stsutsui		the same CNAME returns proper hostname.
6031.122Stsutsui		They works properly if compiled with -O2 -fno-tree-ter.
6041.122Stsutsui		Also -O2 fails but -O2 -fno-tree-ter works on the following
6051.122Stsutsui		test case in gcc bugzilla:
6061.122Stsutsui		http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4
6071.122Stsutsui	kcah
6081.122Stsutsui
6091.124Smsaitoh	hack	gcc-4.5 arm without -fno-tree-vrp generate broken code
6101.124Smsaitoh	cdate	Wed Nov 14 13:02:02 JST 2012
6111.124Smsaitoh	who	msaitoh
6121.124Smsaitoh	file	lib/libc/softfloat/Makefile.inc
6131.124Smsaitoh	pr	46953
6141.124Smsaitoh	regress	src/tests/lib/libm/t_cbrt
6151.124Smsaitoh	regress	src/tests/lib/libm/t_ceil
6161.124Smsaitoh	regress	src/tests/lib/libm/t_exp
6171.124Smsaitoh	regress	src/tests/lib/libm/t_log
6181.124Smsaitoh	regress	src/tests/lib/libm/t_scalbn
6191.124Smsaitoh	regress	src/tests/lib/libm/t_sinh
6201.124Smsaitoh	regress	src/tests/lib/libm/t_sqrt
6211.124Smsaitoh	descr	Gcc has a bug in tree optimization. For adddf3,
6221.124Smsaitoh		-INF + -INF returns 0 without -fno-tree-vrp.
6231.124Smsaitoh		Debugging with -fdump-tree-all shows that
6241.124Smsaitoh		softfloat.c.021t.cleanup_cfg is ok but softfloat.c.023t.ssa
6251.124Smsaitoh		is broken.
6261.124Smsaitoh	kcah
6271.21Smycroft
6281.21Smycroftport	sh3
6291.21Smycroft
6301.74Smrg	hack	gcc4-sh3-bz2
6311.103Stsutsui	cdate	Sun May 21 03:34:57 UTC 2006
6321.103Stsutsui	mdate	Fri May 16 13:13:00 UTC 2008
6331.103Stsutsui	who	mrg, tsutsui
6341.74Smrg	file	lib/libbz2/Makefile	: 1.10
6351.74Smrg	descr
6361.74Smrg		The in-tree GCC 4.1-based compiler generated too-far
6371.103Stsutsui		pc-relative addresses.  Hack is to build with
6381.103Stsutsui		-fno-loop-optimize.
6391.74Smrg	kcah
6401.74Smrg
6411.138Schristosport	sh3eb
6421.137Schristos	hack	gcc4.8.1
6431.137Schristos	cdate	Thu Nov  7 16:31:23 EST 2013
6441.137Schristos	who	christos
6451.137Schristos	file	src/sys/rump/net/lib/libnetbt/Makefile	: 1.2
6461.137Schristos	desrc
6471.138Schristos		for profiling
6481.137Schristos		compile l2cap_signal.c with -O0 to avoid:
6491.137Schristos		./netbt/l2cap_signal.c:36:
6501.137Schristos		/p/netbsd/cvsroot/src/sys/rump/net/lib/libnetbt/../../../../\
6511.137Schristos		netbt/l2cap_signal.c: In function 'l2cap_recv_signal':
6521.137Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
6531.137Schristos		impossible reload
6541.137Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
6551.137Schristos	kcah
6561.21Smycroft
6571.138Schristosport	sh3el
6581.138Schristos	hack	gcc4.8.1
6591.138Schristos	cdate	Fri Nov  8 19:27:01 EST 2013
6601.138Schristos	who	christos
6611.138Schristos	file	src/external/bsd/libevent/lib/libevent/Makefile	: 1.2
6621.138Schristos	desrc
6631.138Schristos		for profiling
6641.138Schristos		compile evdns.c with -O0 to avoid:
6651.138Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
6661.138Schristos		impossible reload
6671.138Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
6681.138Schristos	kcah
6691.139Schristos	
6701.139Schristos	hack	gcc4.8.1
6711.139Schristos	cdate	Fri Nov  8 19:34:48 EST 2013
6721.139Schristos	who	christos
6731.139Schristos	file	src/usr.sbin/racoon/Makefile	: 1.27
6741.139Schristos	desrc
6751.139Schristos		for profiling
6761.139Schristos		compile ipsec_doi.c with -O0 to avoid:
6771.139Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
6781.139Schristos		impossible reload
6791.139Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
6801.139Schristos	kcah
6811.138Schristos
6821.96Smrgport	m68000
6831.79Smrg
6841.96Smrg	hack	gcc4-m68000
6851.102Stsutsui	cdate	Fri Feb  8 10:29:37 PST 2008
6861.102Stsutsui	mdate	Sun May  4 15:37:19 UTC 2008
6871.99Stsutsui	who	mrg, tsutsui
6881.96Smrg	file	rescue/Makefile	: 1.21
6891.99Stsutsui	file	sbin/dump_lfs/Makefile	: 1.9
6901.101Stsutsui	file	sbin/fsck_ffs/Makefile	: 1.35
6911.101Stsutsui	file	sbin/fsdb/Makefile	: 1.22
6921.101Stsutsui	file	share/mk/sys.mk	: 1.96
6931.99Stsutsui	file	usr.sbin/ndbootd/Makefile	: 1.5
6941.95Smrg	descr
6951.101Stsutsui		Several internal compiler errors with gcc -O1
6961.101Stsutsui		around 64bit integer arithmetic.
6971.99Stsutsui		This hack uses -O1 and adds some -fno-tree-foo options
6981.99Stsutsui		to avoid the problem.
6991.101Stsutsui		This might be related with GCC Bugzilla Bug 32424.
7001.95Smrg	kcah
7011.95Smrg
7021.141Schristosport	m68k,sh3,vax
7031.135Schristos
7041.135Schristos	hack	gcc-4.8.1
7051.135Schristos	cdate	Wed Nov  6 20:41:35 EST 2013
7061.135Schristos	who	christos
7071.141Schristos	file	src/external/gpl3/gcc/libstdc++-v3/Makefile : 1.6
7081.135Schristos	descr
7091.135Schristos		compile hashtable_c++0x.cc with -O2 instead of -Os to
7101.135Schristos		produce missing instantiation of std::lower_bound expansion
7111.135Schristos		for unsigned long.
7121.135Schristos	kcah
7131.22Smrg
7141.116Smrgport	sparc
7151.116Smrg
7161.116Smrg	hack	avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3
7171.116Smrg	cdate	Sun Aug 14 19:26:48 PDT 2011
7181.116Smrg	who	mrg
7191.116Smrg	file	sys/arch/sparc64/sparc/cpu.c : 1.234
7201.116Smrg	file	sys/arch/sparc64/sparc/cpuvar.h : 1.90
7211.116Smrg	file	sys/arch/sparc64/sparc/genassym.cf : 1.67
7221.116Smrg	file	sys/arch/sparc64/sparc/locore.s : 1.265
7231.116Smrg	descr
7241.116Smrg		Something is wrong with GCC 4.5.3 and the savefpstate IPI.
7251.116Smrg		Post newlock2 there was a bug where a lock was reduced from
7261.116Smrg		IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI
7271.116Smrg		would crash due to NULL IPI.  This was fixed by re-using the
7281.116Smrg		right IPL value.  However, GCC 4.5.3 build kernels have the
7291.116Smrg		same problems.  For now, the hack is re-instated.
7301.116Smrg	kcah
7311.116Smrg
7321.116Smrg
7331.51Ssimonbport	mips
7341.51Ssimonb
7351.51Ssimonb	hack	mips-shared-linker-load-address
7361.51Ssimonb	cdate	Fri Oct  7 08:33:10 UTC 2005
7371.51Ssimonb	who	simonb
7381.51Ssimonb	file	src/sys/kern/exec_elf32.c : 1.107
7391.51Ssimonb	descr
7401.51Ssimonb		With COMPAT_16 or previous enabled (which enables
7411.51Ssimonb		ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will
7421.51Ssimonb		load and run at address 0.  The check to fix this in
7431.51Ssimonb		rev 1.107 only checks the first psection of the ELF
7441.51Ssimonb		executable, which may not be loadable.  A more correct
7451.51Ssimonb		fix is to check the first loadable psection instead of
7461.51Ssimonb		just the first psection.
7471.51Ssimonb	kcah
7481.54She
7491.85Smartin	hack	mips-duplicate-ras-end-label
7501.85Smartin	cdate	Sat Sep  2 23:29:42 2006
7511.85Smartin	who	martin
7521.92Schs	file	src/regress/sys/kern/ras/ras3/Makefile : 1.3
7531.85Smartin	descr
7541.85Smartin		Add -fno-reorder-blocks to CFLAGS to avoid duplicate
7551.85Smartin		labels by duplicated __asm output from RAS_END()
7561.85Smartin		macro.
7571.85Smartin	kcah
7581.85Smartin
7591.106Slukem	hack	mips-mcount-assembler-warning
7601.106Slukem	cdate	Tue Jul 29 14:16:52 UTC 2008
7611.106Slukem	who	lukem
7621.106Slukem	file	src/lib/libc/gmon/Makefile.inc : 1.8
7631.106Slukem	descr
7641.106Slukem		Workaround for PR port-mips/39192.
7651.106Slukem		common/lib/libc/gmon/mcount.c generates a (fatal)
7661.106Slukem		assembler warning on MIPS:
7671.106Slukem			Warning: No .cprestore pseudo-op used in PIC code
7681.106Slukem		Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings
7691.106Slukem	kcah
7701.106Slukem
7711.82Schristosport	i386
7721.82Schristos
7731.84Sdrochner	hack	use volatile intermediate variable to enforce rounding
7741.84Sdrochner	cdate	Tue Aug  1 22:15:55 MEST 2006
7751.84Sdrochner	who	drochner
7761.84Sdrochner	file	src/lib/libm/src/lrintf.c : 1.4
7771.84Sdrochner	file	src/lib/libm/src/s_rintf.c : 1.8
7781.84Sdrochner	descr
7791.84Sdrochner		gcc-4 does subsequent operations on "float" values within
7801.84Sdrochner		the i387 FPU without rounding the intermediate results
7811.84Sdrochner	kcah
7821.110Smacallan
7831.148Schristosport	x86
7841.148Schristos	hack	turn off optimization for biosdisk_ll.c because otherwise
7851.148Schristos		we are pass the wrong arguments to biosdisk_read(). 
7861.148Schristos		$ cd /usr/src/sys/arch/i386/floppies/bootflopp-com
7871.148Schristos		$ qemu-system-i386 -nographic -fda boot-com1.fs -boot a
7881.148Schristos	who	christos
7891.148Schristos	file	src/sys/arch/i386/stand/lib/Makefile : 1.38
7901.148Schristos	descr
7911.148Schristos		Turning on DISK_DEBUG shows the problem. We should find
7921.148Schristos		out which option is causing this.
7931.148Schristos	hcah
7941.148Schristos
7951.165Smrg	hack	turn off -ftree-vrp for ufs_lookup.c
7961.165Smrg	who	mrg
7971.165Smrg	file	src/sys/arch/amd64/conf/Makefile.amd64 : 1.54
7981.165Smrg	descr
7991.165Smrg		with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir
8001.165Smrg		panicks are see.  see PR 51094.
8011.165Smrg	hcah
8021.165Smrg
8031.110Smacallanport	powerpc
8041.110Smacallan
8051.110Smacallan	hack	avoid using __builtin_return_address(0) because it fails in
8061.110Smacallan		Xorg's module loader
8071.110Smacallan	cdate	Sat Sep 27 03:52:05 UTC 2008
8081.110Smacallan	who	macallan
8091.110Smacallan	file	src/libexec/ld.elf_so/rtld.c : 1.121
8101.110Smacallan	descr
8111.110Smacallan		workaround for PR port-macppc/37812
8121.110Smacallan	kcah
8131.110Smacallan
8141.115Smatt	hack	define TARGET_SECURE_PLT and HAVE_AS_TLS because when
8151.115Smatt		building the native compiler via build.sh those don't defined
8161.115Smatt		properly.
8171.115Smatt	cdate	Sat Mar 12 08:00:00 UTC 2011
8181.115Smatt	who	matt
8191.115Smatt	file	src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h
8201.115Smatt	descr
8211.115Smatt		see above
8221.115Smatt	kcah
8231.117Schristos
8241.117Schristosport	powerpc64
8251.117Schristos
8261.117Schristos	hack	include _errno.c in libposix so that __errno resolves. It
8271.117Schristos		should resolve from libc's errno, but somehow it does not.
8281.117Schristos		Linker bug?
8291.117Schristos	cdate	Thu Oct 27 13:19:47 EDT 2011
8301.117Schristos	who	christos
8311.117Schristos	file	src/lib/libposix/Makefile: 1.15
8321.118Schristos	file	src/lib/librt/Makefile: 1.14
8331.117Schristos	descr
8341.117Schristos		workaround for:
8351.117Schristos		    libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \
8361.117Schristos		    R_PPC64_REL24 relocation against symbol `.__errno'
8371.117Schristos	kcah
8381.119Schristos
8391.119Schristos	hack	rename data() function in mdocml to avoid redefined error.
8401.119Schristos		Compiler/Assembler bug?
8411.119Schristos	cdate	Sat Oct 29 11:16:01 EDT 2011
8421.119Schristos	who	christos
8431.119Schristos	file	src/external/bsd/mdocml/tbl_data.c: 1.2
8441.119Schristos	descr
8451.119Schristos		workaround for:
8461.119Schristos		    {standard input}: Assembler messages:
8471.119Schristos		    {standard input}:105: Error: symbol `.data' is already \
8481.119Schristos		    defined
8491.119Schristos	kcah
8501.120Schristos
8511.120Schristosport	emips
8521.120Schristos
8531.120Schristos	hack	Add nop between ctc1 and mtc0 to avoid assembler internal
8541.120Schristos		error
8551.120Schristos	cdate	Sat Oct 29 16:57:34 EDT 2011
8561.120Schristos	who	christos
8571.120Schristos	file	src/sys/arch/mips/mips/mips_fpu.c: 1.7
8581.120Schristos	descr
8591.120Schristos		workaround for:
8601.120Schristos		    {standard input}: Assembler messages:
8611.120Schristos		    {standard input}:730: Internal error!
8621.120Schristos		    Assertion failure in append_insn at /usr/src/external/gpl3/\
8631.120Schristos		    binutils/dist/gas/config/tc-mips.c line 2910.
8641.120Schristos	kcah
8651.125Smartin
8661.125Smartinport	ia64
8671.125Smartin
8681.125Smartin	hack	libc hesiod.c file does not compile with -O2 (internal
8691.125Smartin		compiler error in gcc 4.5.3)
8701.125Smartin	cdate	Thu Dec 27 08:05:43 CET 2012
8711.125Smartin	who	martin
8721.125Smartin	file	src/lib/libc/net/Makefile.inc: 1.82
8731.125Smartin	descr
8741.125Smartin		workaround for:
8751.125Smartin		{standard input}: Assembler messages:
8761.125Smartin		{standard input}:1507: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 15
8771.125Smartin		{standard input}:1506: Warning: This is the location of the conflicting usage
8781.125Smartin		{standard input}: Error: 2 warnings, treating warnings as errors
8791.125Smartin	kcah
8801.125Smartin
8811.126Smartin	hack	libelf libelf_extended.c compiler error in gcc 4.5.3
8821.126Smartin	cdate	Thu Dec 27 09:05:51 CET 2012
8831.126Smartin	who	martin
8841.126Smartin	file	src/external/bsd/libelf/lib/Makefile: 1.3
8851.126Smartin	descr
8861.126Smartin		workaround for:
8871.126Smartin		{standard input}: Assembler messages:
8881.126Smartin		{standard input}:87: Warning: Use of 'adds' may violate RAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
8891.126Smartin		{standard input}:87: Warning: Only the first path encountering the conflict is reported
8901.126Smartin		{standard input}:85: Warning: This is the location of the conflicting usage
8911.126Smartin	kcah
8921.126Smartin
8931.127Smartin	hack	compiler error with gcc 4.5.x
8941.127Smartin	cdate	Thu Dec 27 15:15:25 CET 2012
8951.127Smartin	who	martin
8961.127Smartin	file	src/crypto/external/bsd/netpgp/lib/verify/Makefile: 1.5
8971.127Smartin	descr
8981.127Smartin		workaround for:
8991.127Smartin		{standard input}: Assembler messages:
9001.127Smartin		{standard input}:22979: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8
9011.127Smartin		{standard input}:22978: Warning: This is the location of the conflicting usage
9021.127Smartin	kcah
9031.127Smartin
9041.157Smartin	hack	libgcc unwind dummy function
9051.157Smartin	cdate	Fri Apr 17 14:31:03 CEST 2015
9061.157Smartin	who	martin
9071.157Smartin	file	src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4
9081.157Smartin	descr
9091.157Smartin		Add an empty _Unwind_FindTableEntry() implementation.
9101.157Smartin		In the end we will use our libc stuff, and this should
9111.157Smartin		go away again.
9121.157Smartin	kcah
9131.157Smartin
9141.128Schristosport	x68k
9151.127Smartin
9161.128Schristos	hack	compiler error with gcc 4.5.x
9171.128Schristos	cdate	Fri May 24 13:23:01 EDT 2013
9181.128Schristos	who	christos
9191.128Schristos	file	src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17
9201.128Schristos		xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11
9211.128Schristos	descr
9221.128Schristos		workaround for:
9231.128Schristos		internal compiler error: in cselib_record_set, at cselib.c:1999
9241.128Schristos	kcah
9251.130Sjoerg
9261.130Sjoerghack	fallback to /usr/bin/clang-cpp in rpcgen
9271.130Sjoergcdate	Wed Jun  5 15:49:27 CEST 2013
9281.130Sjoergwho	joerg
9291.130Sjoergfile	src/usr.bin/rpcgen/rpc_main.c
9301.130Sjoergdescr
9311.136Sjoerg	It is undecided which compiler owns /usr/bin/cpp and whether it should
9321.130Sjoerg	exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box,
9331.130Sjoerg	if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback.
9341.130Sjoerg	This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable.
9351.130Sjoergkcah
9361.131Sskrll
9371.155Sskrllport	hppa
9381.131Sskrll
9391.131Sskrll	hack	compiler error with gcc 4.5.x
9401.131Sskrll	cdate	Tue Jul 23 07:42:28 BST 2013
9411.131Sskrll	who	skrll
9421.133Sskrll	file	src/sys/lib/libkern/Makefile.libkern: 1.26
9431.133Sskrll	descr
9441.133Sskrll		workaround for unanalysed codegen bug affecting md5c.c.
9451.133Sskrll	kcah
9461.149Smacallan
9471.155Sskrll	hack	gdb vs _rtld_debug_state problem
9481.155Sskrll	cdate	Thu Mar  5 09:49:53 UTC 2015
9491.155Sskrll	who	skrll
9501.155Sskrll	file	src/libexec/ld.elf_so/rtld.c: 1.175
9511.155Sskrll	descr
9521.155Sskrll		workaround for problem where gdb misses the breakpoint on
9531.155Sskrll		_rtld_debug_state when the function is only the
9541.155Sskrll		bv,n %r0(%rp) instruction - the nullify seems to
9551.155Sskrll		confuse something
9561.155Sskrll	kcah
9571.155Sskrll
9581.149Smacallanport	mips64*
9591.149Smacallanhack	compiler crashes on mips64* with optimization enabled
9601.149Smacallancdate	Tue May 13 18:46:48 UTC 2014
9611.149Smacallanwho	macallan
9621.149Smacallanfile	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6
9631.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5
9641.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6
9651.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5
9661.149Smacallandescr	workaround for n32 gcc doing unaligned 64bit accesses when optimizing
9671.149Smacallanpr	48696
9681.149Smacallankcah
9691.150Smartin
9701.150Smartinport	vax
9711.150Smartinhack	compile boot with -O1
9721.150Smartincdate	Sat May 24 09:40:58 CEST 2014
9731.150Smartinwho	martin
9741.150Smartinfile	src/sys/arch/vax/boot/boot/Makefile: 1.41
9751.150Smartindescr	/boot does not work when compiled with -O2 and gcc 4.8
9761.150Smartinkcah
9771.150Smartin
9781.156Smattport	arm
9791.156Smatthack	avoid using labels in a 12-bit constant.
9801.156Smattwho	matt
9811.156Smattfile	crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2
9821.156Smattdescr	workaround for clang misassembling an instruction
9831.156Smattkcah
984