HACKS revision 1.167
11.167Smrg# $NetBSD: HACKS,v 1.167 2016/05/10 19:32:47 mrg 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.167Smrghack	gcc-5.3 miscompiles crt* leading to ctor/dtor related crashes
311.167Smrgmdate	10 May 2016
321.167Smrgwho	mrg martin
331.167Smrgfile	lib/csu/common/Makefile.inc : 1.26, 1.27, 1.31
341.167Smrgdescr
351.167Smrg	GCC assumes non-constant data is constant and assumes that it
361.167Smrg	can generate direct calls out of the ctor/dtor space, which
371.167Smrg	generally breaks their usage.  On SPARC, an explicit call to
381.167Smrg	0 is generated as "clr %g1; call %g1", for example.
391.167Smrg
401.167Smrg	Compiling with -O1 fixes this problem.
411.167Smrgpr	51121
421.167Smrgkcah
431.167Smrg
441.166Schristoshack	gcc-5.3 optimizes memset+malloc -> calloc inside calloc
451.166Schristosmdate	4 May 2016
461.166Schristoswho	christos
471.166Schristosfile	external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5
481.166Schristosdescr
491.166Schristos	resulting in infinite recursion; we prevent this with
501.166Schristos	-fno-builtin-malloc
511.166Schristoskcah
521.166Schristos
531.167Smrghack	turn off tree-vrp for parts of ufs_lookup.c
541.167Smrgmdate	28 April 2016
551.167Smrgwho	mrg christos
561.167Smrgfile	src/sys/ufs/ufs/ufs_lookup.c : 1.144
571.167Smrgpr	51094
581.167Smrgdescr
591.167Smrg	with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir
601.167Smrg	panicks are see.
611.167Smrghcah
621.167Smrg
631.1Slukemhack	netstat ieee1394 address printing.
641.1Slukemmdate	14 Nov 2000
651.1Slukemwho	matt
661.1Slukemfile	lib/libc/net/getnameinfo.c	: 1.32 : 497 : 503
671.1Slukemdescr
681.1Slukem	Because the current implementation of IP over IEEE1394, the
691.1Slukem	fw device address contains more than just the IEEE1394 EUI-64.
701.1Slukem	So when printing out IEEE1394 addresses, ignore the extra stuff.
711.1Slukemkcah
721.1Slukem
731.1Slukemhack	xterm vs. libterm
741.1Slukemmdate	01 Aug 2000
751.1Slukemwho	jdc
761.1Slukemfile	xsrc/xc/programs/xterm/main.c	: 1.2 : 3609 : 3614
771.1Slukempr	10383
781.1Slukemdescr
791.1Slukem	In order to extend the termcap string over 1023 bytes, a ZZ entry was
801.1Slukem	introduced to point to a memory location containing the full entry.
811.1Slukem	Without this hack, xterm will export a termcap containing the ZZ
821.1Slukem	entry, which will then be ignored by libterm.  As xterm modifies the
831.1Slukem	exported termcap, this would cause those modifications to be ignored.
841.1Slukemkcah
851.1Slukem
861.1Slukemhack	wi-at-big-endian-bus
871.1Slukemcdate	15 Mar 2002
881.1Slukemwho	martin
891.1Slukemfile	dev/ic/wireg.h
901.1Slukemdescr	Add an option to access the underlying bus in big endian byte order
911.1Slukem	to work around deficiencies in bus_space_{read,write}_* macros.
921.1Slukem	Those don't allow the implementation of a proper pcmcia bus space
931.1Slukem	tag.
941.1Slukemkcah
951.1Slukem
961.3Sjdchack	specific knowledge of colours in curses code
971.3Sjdccdate	Sun Apr  6 11:05:24 BST 2003
981.3Sjdcwho	jdc
991.3Sjdcfile	lib/libcurses/color.c : r1.24
1001.3Sjdcdescr
1011.3Sjdc	Swap red/blue and yellow/cyan colours for COLOR_OTHER.
1021.3Sjdc	Fix is to enhance libtermcap to understand terminfo-style % sequences.
1031.3Sjdc	See also:
1041.5Ssalo	    http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html
1051.4Sscwkcah
1061.4Sscw
1071.7Shehack	Compensation for differing types of LINUX_USRSTACK and USRSTACK
1081.7Shecdate	21 Aug 2003
1091.7Shewho	he
1101.7Shefile	sys/miscfs/procfs/procfs_linux.c : 1.14
1111.7Shedescr
1121.7She	Not all ports have LINUX_USRSTACK and/or USRSTACK defined as
1131.7She	literals/constants, but refer to variables of a type which is
1141.7She	not "unsigned long", causing compilation of procfs_linux.c to
1151.7She	fail with "makes integer from pointer without a cast".  This
1161.7She	is observed on e.g. the sun3 port.  Ideally the "types" for
1171.7She	symbols should be consistent across all ports.
1181.25Smrgkcah
1191.25Smrg
1201.37Sjunyounghack	gcc-strict-aliasing
1211.37Sjunyoungcdate	6 August 2004
1221.37Sjunyoungwho	junyoung
1231.37Sjunyoungpr	26516
1241.37Sjunyoungfile	src/usr.sbin/racoon/racoon/Makefile : 1.21
1251.37Sjunyoungdescr
1261.37Sjunyoung	GCC issues a warning "dereferencing type-punned pointer will break
1271.37Sjunyoung	strict-aliasing rules" when compiling
1281.37Sjunyoung	crypto/dist/kame/racoon/crypto/openssl.c with -O[23s]. Note that this
1291.38Sjunyoung	is due to use of type casting in a non-standard way in the code and
1301.38Sjunyoung	not a compiler bug. Once a new release of KAME with a proper fix
1311.38Sjunyoung	applied is imported this should be backed out.
1321.37Sjunyoungkcah
1331.37Sjunyoung
1341.80Stsutsuihack	gcc4 wrong uninitialized variable
1351.58Smrgmdate	10 May 2006
1361.58Smrgwho	mrg
1371.58Smrgfile	bin/ksh/eval.c			: 1.6
1381.58Smrgfile	bin/sh/histedit.c		: 1.39
1391.58Smrgfile	bin/sh/parser.c			: 1.60
1401.58Smrgfile	crypto/dist/heimdal/kdc/524.c	: 1.10
1411.58Smrgfile	crypto/dist/ssh/sftp.c		: 1.20
1421.58Smrgfile	crypto/dist/ssh/ssh-keysign.c	: 1.11
1431.58Smrgfile	dist/ipf/lib/hostname.c		: 1.2
1441.58Smrgfile	dist/ipf/tools/ipmon.c		: 1.8
1451.72Smrgfile	dist/ntp/ntpd/ntp_request.c	: 1.4
1461.58Smrgfile	dist/ntp/ntpd/refclock_shm.c	: 1.4
1471.58Smrgfile	dist/ntp/sntp/timing.c		: 1.3
1481.58Smrgfile	dist/pppd/pppstats/pppstats.c	: 1.3
1491.58Smrgfile	dist/smbfs/lib/smb/rap.c	: 1.6
1501.58Smrgfile	dist/tcpdump/print-zephyr.c	: 1.5
1511.68Smrgfile	distrib/utils/sysinst/aout2elf.c : 1.12
1521.58Smrgfile	gnu/libexec/uucp/uucico/uucico.c : 1.6
1531.58Smrgfile	lib/libc/citrus/citrus_csmapper.c : 1.6
1541.58Smrgfile	lib/libc/citrus/citrus_pivot_factory.c : 1.5
1551.58Smrgfile	lib/libc/inet/inet_cidr_ntop.c	: 1.3
1561.58Smrgfile	lib/libc/inet/inet_ntop.c	: 1.3
1571.58Smrgfile	lib/libc/stdio/vfwprintf.c	: 1.8
1581.69Smrgfile	libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20
1591.76Smrgfile	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40
1601.74Smrgfile	libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22
1611.69Smrgfile	libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39
1621.58Smrgfile	libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39
1631.74Smrgfile	libexec/ld.elf_so/arch/vax/mdreloc.c	: 1.21
1641.71Sdanfile	libexec/ld.elf_so/arch/x86_64/mdreloc.c	: 1.27
1651.58Smrgfile	sbin/fsck_ext2fs/dir.c		: 1.19
1661.58Smrgfile	sbin/routed/rtquery/rtquery.c	: 1.18
1671.73Sdanfile	sys/arch/amd64/amd64/pmap.c	: 1.26
1681.79Smrgfile	sys/arch/i386/pci/piixpcib.c	: 1.4
1691.80Stsutsuifile	sys/arch/m68k/m68k/pmap_motorola.c	: 1.4
1701.58Smrgfile	sys/crypto/cast128/cast128.c	: 1.9
1711.58Smrgfile	sys/ddb/db_command.c		: 1.86
1721.68Smrgfile	sys/dev/cardbus/cardbus_map.c	: 1.21
1731.58Smrgfile	sys/dev/fss.c			: 1.25
1741.69Smrgfile	sys/dev/ic/igsfb.c		: 1.39
1751.68Smrgfile	sys/dev/ic/mb86950.c		: 1.5
1761.58Smrgfile	sys/dev/ic/midway.c		: 1.71
1771.68Smrgfile	sys/dev/kttcp.c			: 1.18
1781.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1791.68Smrgfile	sys/dev/pci/cmpci.c		: 1.31
1801.58Smrgfile	sys/dev/pci/machfb.c		: 1.45
1811.68Smrgfile	sys/dev/usb/ohci.c		: 1.174
1821.68Smrgfile	sys/dev/usb/uhci.c		: 1.196
1831.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1841.58Smrgfile	sys/dist/ipf/netinet/ip_nat.c	: 1.10
1851.58Smrgfile	sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8
1861.58Smrgfile	sys/dist/pf/net/pf.c		: 1.22
1871.59Smrgfile	sys/fs/udf/udf_vnops.c		: 1.4
1881.58Smrgfile	sys/kern/kern_sig.c		: 1.219
1891.58Smrgfile	sys/kern/tty.c			: 1.181
1901.58Smrgfile	sys/net/bpf.c			: 1.116
1911.58Smrgfile	sys/net/zlib.c			: 1.26
1921.68Smrgfile	sys/netccitt/if_x25subr.c	: 1.37
1931.58Smrgfile	sys/netinet/in.c		: 1.107
1941.58Smrgfile	sys/netsmb/smb_smb.c		: 1.27
1951.58Smrgfile	sys/netsmb/smb_trantcp.c	: 1.22
1961.58Smrgfile	sys/nfs/nfs_serv.c		: 1.108
1971.58Smrgfile	sys/nfs/nfs_socket.c		: 1.129
1981.58Smrgfile	sys/nfs/nfs_syscalls.c		: 1.91
1991.58Smrgfile	sys/ufs/lfs/lfs_vfsops.c	: 1.207 [also (char *)]
2001.58Smrgfile	usr.bin/ftp/ftp.c		: 1.140
2011.58Smrgfile	usr.bin/find/function.c		: 1.54
2021.58Smrgfile	usr.bin/mail/tty.c		: 1.20
2031.100Stsutsuifile	usr.bin/msgc/msg_sys.def	: 1.33-1.34
2041.58Smrgfile	usr.bin/nl/nl.c			: 1.7
2051.58Smrgfile	usr.bin/systat/keyboard.c	: 1.23
2061.58Smrgfile	usr.bin/usbhidctl/usbhid.c	: 1.29
2071.58Smrgfile	usr.bin/vi/cl/cl_read.c		: 1.5
2081.58Smrgfile	usr.bin/vi/ex/ex_cscope.c	: 1.12
2091.58Smrgfile	usr.bin/vi/ex/ex_tag.c		: 1.19
2101.58Smrgfile	usr.bin/vi/vi/v_txt.c		: 1.15
2111.58Smrgfile	usr.sbin/altq/altqstat/qdisc_rio.c : 1.4
2121.58Smrgfile	usr.sbin/cron/do_command.c	: 1.19
2131.58Smrgfile	usr.sbin/timed/timed/slave.c	: 1.15
2141.58Smrgdescr
2151.58Smrg	GCC 4.1 gets many uninitialised variable warnings wrong.  We should
2161.58Smrg	really audit all the old hacks like this when older compilers are
2171.58Smrg	removed from the tree, as many are probably no longer required.
2181.65Schristos	The problem is that it does not recognize initialization via function
2191.65Schristos	call pointer. I.e.
2201.65Schristos		int p;
2211.65Schristos		foo(&p);
2221.65Schristos	does not mark p as initialized.
2231.58Smrgkcah
2241.58Smrg
2251.59Smrghack	gcc4 pointer sign and strict aliasing problems
2261.59Smrgmdate	10 May 2006
2271.59Smrgwho	mrg
2281.59Smrgfile	bin/ed/Makefile			: 1.33
2291.68Smrgfile	distrib/utils/sysinst/Makefile.inc : 1.44
2301.91Smartinfile	distrib/utils/x_dhclient/Makefile : 1.15
2311.60Smrgfile	games/bcd/Makefile		: 1.5
2321.60Smrgfile	games/dab/Makefile		: 1.5
2331.60Smrgfile	games/larn/Makefile		: 1.17
2341.60Smrgfile	games/pom/Makefile		: 1.5
2351.60Smrgfile	lib/libasn1/Makefile		: 1.26
2361.60Smrgfile	lib/libcrypt/Makefile		: 1.17
2371.60Smrgfile	lib/libgssapi/Makefile		: 1.16
2381.60Smrgfile	lib/libhdb/Makefile		: 1.20
2391.60Smrgfile	lib/libkadm5clnt/Makefile	: 1.21
2401.60Smrgfile	lib/libkadm5srv/Makefile	: 1.25
2411.60Smrgfile	lib/libkrb5/Makefile		: 1.35
2421.60Smrgfile	lib/libssh/Makefile		: 1.6
2431.60Smrgfile	lib/libtelnet/Makefile		: 1.26
2441.60Smrgfile	libexec/getty/Makefile		: 1.14
2451.60Smrgfile	libexec/kadmind/Makefile	: 1.19
2461.60Smrgfile	libexec/kpasswdd/Makefile	: 1.14
2471.60Smrgfile	sbin/atactl/Makefile		: 1.3
2481.60Smrgfile	sbin/cgdconfig/Makefile		: 1.7
2491.60Smrgfile	sbin/clri/Makefile		: 1.13
2501.60Smrgfile	sbin/dkctl/Makefile		: 1.4
2511.60Smrgfile	sbin/dump/Makefile		: 1.33
2521.60Smrgfile	sbin/fdisk/Makefile		: 1.35
2531.60Smrgfile	sbin/fsck_ext2fs/Makefile	: 1.11
2541.60Smrgfile	sbin/fsck_ffs/Makefile		: 1.29
2551.60Smrgfile	sbin/fsdb/Makefile		: 1.18
2561.60Smrgfile	sbin/mount_smbfs/Makefile	: 1.4
2571.60Smrgfile	sbin/newfs/Makefile		: 1.30
2581.60Smrgfile	sbin/newfs_sysvbfs/Makefile	: 1.2
2591.60Smrgfile	sbin/restore/Makefile		: 1.23
2601.60Smrgfile	sbin/veriexecctl/Makefile	: 1.11
2611.64Smrgfile	sys/lib/libsa/Makefile		: 1.59
2621.68Smrgfile	sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24
2631.59Smrgfile	usr.bin/awk/Makefile		: 1.9
2641.64Smrgfile	usr.bin/crontab/Makefile	: 1.24
2651.60Smrgfile	usr.bin/ctags/Makefile		: 1.8
2661.61Smrgfile	usr.bin/gzip/Makefile		: 1.10
2671.60Smrgfile	usr.bin/ssh/sftp/Makefile	: 1.10
2681.60Smrgfile	usr.bin/ssh/ssh/Makefile	: 1.25
2691.59Smrgfile	usr.bin/vi/build/Makefile	: 1.26
2701.60Smrgfile	usr.bin/telnet/Makefile		: 1.40
2711.60Smrgfile	usr.bin/tn3270/tn3270/Makefile	: 1.36
2721.60Smrgfile	usr.bin/tr/Makefile		: 1.4
2731.59Smrgfile	usr.sbin/amd/amd/Makefile	: 1.27
2741.59Smrgfile	usr.sbin/amd/amq/Makefile	: 1.14
2751.59Smrgfile	usr.sbin/amd/libamu/Makefile	: 1.20
2761.59Smrgfile	usr.sbin/amd/pawd/Makefile	: 1.5
2771.59Smrgfile	usr.sbin/bind/Makefile.inc	: 1.22
2781.60Smrgfile	usr.sbin/bind/libdns/Makefile	: 1.3
2791.60Smrgfile	usr.sbin/bind/named/Makefile	: 1.17
2801.60Smrgfile	usr.sbin/bootp/bootptest/Makefile : 1.2
2811.60Smrgfile	usr.sbin/chrtbl/Makefile	: 1.6
2821.60Smrgfile	usr.sbin/cron/Makefile		: 1.12
2831.59Smrgfile	usr.sbin/dhcp/Makefile.inc	: 1.20
2841.59Smrgfile	usr.sbin/dumplfs/Makefile	: 1.11
2851.60Smrgfile	usr.sbin/hprop/Makefile		: 1.13
2861.60Smrgfile	usr.sbin/installboot/Makefile	: 1.35
2871.59Smrgfile	usr.sbin/ipf/ipftest/Makefile	: 1.32
2881.59Smrgfile	usr.sbin/isdn/isdnd/Makefile	: 1.6
2891.59Smrgfile	usr.sbin/isdn/isdnmonitor/Makefile : 1.3
2901.59Smrgfile	usr.sbin/isdn/isdntel/Makefile	: 1.2
2911.59Smrgfile	usr.sbin/isdn/isdntrace/Makefile : 126
2921.61Smrgfile	usr.sbin/mopd/common/Makefile	: 1.10
2931.61Smrgfile	usr.sbin/mopd/mopd/Makefile	: 1.9
2941.61Smrgfile	usr.sbin/mopd/mopprobe/Makefile	: 1.7
2951.60Smrgfile	usr.sbin/makefs/Makefile	: 1.17
2961.60Smrgfile	usr.sbin/mscdlabel/Makefile	: 1.5
2971.60Smrgfile	usr.sbin/pkg_install/add/Makefile : 1.7
2981.60Smrgfile	usr.sbin/pkg_install/create/Makefile : 1.5
2991.60Smrgfile	usr.sbin/pkg_install/lib/Makefile : 1.28
3001.59Smrgfile	usr.sbin/ntp/ntpd/Makefile	: 1.10/1.11
3011.59Smrgfile	usr.sbin/ntp/ntptime/Makefile	: 1.4/1.5
3021.59Smrgfile	usr.sbin/pppd/Makefile.inc	: 1.3
3031.59Smrgfile	usr.sbin/pppd/pppd/Makefile	: 1.38
3041.60Smrgfile	usr.sbin/rarpd/Makefile		: 1.10
3051.59Smrgfile	usr.sbin/rbootd/Makefile	: 1.10
3061.60Smrgfile	usr.sbin/rpc.pcnfsd/Makefile	: 1.17
3071.59Smrgfile	usr.sbin/rtadvd/Makefile	: 1.9
3081.60Smrgfile	usr.sbin/tcpdump/Makefile	: 1.42
3091.59Smrgfile	usr.sbin/wiconfig/Makefile	: 1.3
3101.59Smrgdescr
3111.59Smrg	GCC 4.1 warns on pointer sign comparision/assignments and lots of
3121.59Smrg	code does not conform.  For now we use -Wno-pointer-sign and
3131.59Smrg	-fno-strict-aliasing.
3141.59Smrgkcah
3151.59Smrg
3161.145Schristoshack	disable ctf for gcc-4.8 build
3171.145Schristosmdate	April 3 2014
3181.146Swizwho	christos
3191.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.frontend	: 1.4
3201.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.backend	: 1.5
3211.145Schristosdescr
3221.145Schristos	nbctfconvert -g -L VERSION -g fold-const.o
3231.145Schristos	ERROR: fold-const.c: failed to get mapping for tid 79154 \
3241.145Schristos		((null)) <13532>
3251.145Schristoskcak
3261.145Schristos
3271.121Schristoshack	emacs aborting on exit (libgcc issue)
3281.121Schristosmdate	7 November 2011
3291.121Schristoswho	christos
3301.121Schristosfile	external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2
3311.121Schristosdescr
3321.121Schristos	GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit
3331.121Schristos	to do just that. If the symbol requested is not found, then it aborts.
3341.121Schristos	emacs 23.3 triggers this assertion. For now disable aborting, and
3351.121Schristos	silently ignore.
3361.121Schristoskcah
3371.121Schristos
3381.105Sagchack	cross-building hack on Darwin
3391.105Sagcmdate	20 July 2008
3401.105Sagcwho	agc
3411.105Sagcfile	src/distrib/common/Makefile.mdset	: 1.33
3421.105Sagcdescr
3431.105Sagc	Darwin has problems with getopt() when used in mdsetimage -v,
3441.105Sagc	due to the difference between BSD and libiberty() getopt
3451.105Sagc	implementations, more fully described in
3461.105Sagc	http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html
3471.105Sagc	and the subsequent thread.  For just now, we just have an ugly
3481.105Sagc	workaround not to call mdsetimage with the -v argument on Darwin
3491.105Sagckcah
3501.105Sagc
3511.109Sveegohack	avoid rebuilding asn1 libraries
3521.109Sveegomdate	03 August 2008
3531.109Sveegowho	veego
3541.109Sveegofile	src/crypto/dist/heimdal/lib/asn1/gen.c	: 1.10
3551.109Sveegofile	src/lib/libasn1/Makefile	: 1.32
3561.109Sveegofile	src/lib/libhdb/Makefile	: 1.23
3571.109Sveegofile	src/lib/libgssapi/Makefile	: 1.20
3581.109Sveegofile	src/lib/libhx509/Makefile	: 1.3
3591.109Sveegopr	9702 39185
3601.109Sveegodescr
3611.109Sveego	asn1_compile does not check if generated header files do not have to
3621.109Sveego	be rebuild.
3631.109Sveego	Generate .hx files and copy it in the Makefiles if they changed.
3641.109Sveegokcah
3651.109Sveego
3661.111Stsutsuihack	avoid gcc4 -O1 bug in loop optimize
3671.111Stsutsuicdate	29 November 2008
3681.111Stsutsuiwho	tsutsui
3691.111Stsutsuifile	src/sbin/ifconfig/Makefile	: 1.39
3701.111Stsutsuipr	40036 40066
3711.111Stsutsuidescr
3721.111Stsutsui	gcc -O1 seems to generate wrong code in loop optimize so that
3731.111Stsutsui	ifconfig lo0 inet6 doesn't return error even if a kernel
3741.111Stsutsui	doesn't have IPv6 support. (see the above PRs for details)
3751.111Stsutsui	For workaround, specify -fno-loop-optimize on m68000,
3761.111Stsutsui	which uses -O1 by default.
3771.111Stsutsuikcah
3781.111Stsutsui
3791.114Schristoshack	MKPIE ldscript for /usr.sbin/crash
3801.114Schristoscdate	22 April 2010
3811.114Schristoswho	christos
3821.114Schristosfile	src/usr.sbin/crash/Makefile	: 1.5
3831.114Schristosfile	src/usr.sbin/crash/ldscript.crash	: 1.1
3841.114Schristospr	N/A
3851.114Schristosdescr
3861.114Schristos	fixed in binutils-2.20.1. Linking with MKPIE=yes causes overlapping
3871.114Schristos	sections
3881.114Schristoskcah
3891.114Schristos
3901.144Stronhack	Disable fortification for /usr/bin/makeinfo
3911.144Stroncdata	24 Mar 2014
3921.144Stronwho	tron
3931.144Stronfile	src/gnu/usr.bin/texinfo/makeinfo/Makefile	: 1.8
3941.144Stronpr	N/A
3951.144Strondescr
3961.144Stron	If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3
3971.144Stron	it fails to process certain texinfo files, e.g. "cl.texi"
3981.144Stron	included in the Emacs 24.3 distribution.
3991.144Stronkcah
4001.144Stron
4011.147Stronhack	Disable Stack Smash Protection for /usr/X11R7/bin/xauth
4021.147Stroncdata	05 Apr 2014
4031.147Stronwho	tron
4041.147Stronfile	src/external/mit/xorg/bin/xauth/Makefile	: 1.4
4051.147Stronpr	N/A
4061.147Strondescr
4071.147Stron	If "xauth" is compile with "USE_SSP" set to "yes" it fails
4081.147Stron	mysteriously with an error message like this:
4091.147Stron
4101.147Stron	/usr/X11R7/bin/xauth:  file /foo/bar/.Xauthority does not exist
4111.147Stron	/usr/X11R7/bin/xauth:  unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority
4121.147Stron
4131.147Stron	The compiler seems to get confused about the two filename variables
4141.147Stron	used in the link(2) system call.
4151.147Stronkcah
4161.147Stron
4171.162Spookahack	g++ 5.x barfs on volatile in constexpr initializers
4181.162Spookacdata	27 Aug 2015
4191.160Spookawho	pooka
4201.162Spookafile	src/lib/libpthread/pthread_types.h	: 1.17
4211.160Spookapr	lib/49989
4221.160Spookadescr
4231.160Spooka	Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER
4241.160Spooka	in C++ results in:
4251.160Spooka		error: temporary of non-literal type '__pthread_mutex_st'
4261.160Spooka		in a constant expression
4271.160Spooka		constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
4281.160Spooka		[...]
4291.160Spooka		include/pthread_types.h:101:8: note: '__pthread_mutex_st' is
4301.160Spooka		not literal because:
4311.160Spooka		struct __pthread_mutex_st {
4321.160Spooka		^
4331.160Spooka		include/pthread_types.h:103:17: note:   non-static data
4341.160Spooka		member '__pthread_mutex_st::ptm_errorcheck' has volatile type
4351.160Spooka		pthread_spin_t ptm_errorcheck;
4361.160Spookakcah
4371.160Spooka
4381.163Schristoshack	libm cabs{,f,l} and g++
4391.163Schristoscdata	11 Jan 2016
4401.163Schristoswho	christos
4411.163Schristospr	lib/50646
4421.163Schristosfile	src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2
4431.163Schristosfile	src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2
4441.163Schristosdescr
4451.163Schristos	Our cabs and cabsf have a different argument format on some architectures
4461.163Schristos	and for that we have created in libm/compat_cabs{,f}.c. The standard
4471.163Schristos	versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in
4481.163Schristos	<complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they
4491.163Schristos	translate by default to cabs{,f,l} which gets defined to cabs{,f} (the
4501.163Schristos	wrong function) and an undefined cabsl. I've changed <complex> to use
4511.163Schristos	the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is
4521.163Schristos	still broken.
4531.163Schristoskcah
4541.163Schristos
4551.21Smycroftport	vax
4561.21Smycroft
4571.102Stsutsui	hack	gcc4/vax ICE
4581.102Stsutsui	cdate	
4591.102Stsutsui	who	tsutsui
4601.102Stsutsui	file	sys/arch/vax/conf/Makefile.vax
4611.102Stsutsui	descr
4621.102Stsutsui		GCC4 on vax gets ICE on compiling sys/ddb/db_command.c.
4631.102Stsutsui		-fno-tree-ter prevents it so add it to COPTS.
4641.102Stsutsui	kcah
4651.102Stsutsui
4661.81Smrg	hack	gcc4/vax compiler crash
4671.81Smrg	cdate	Fri Jun 30 22:39:12 PDT 2006
4681.81Smrg	who	mrg
4691.81Smrg	file	bin/csh/Makefile	: 1.27
4701.81Smrg	file	lib/i18n_module/UTF7/Makefile	: 1.2
4711.81Smrg	descr
4721.81Smrg		GCC4 on vax crashes.  -O0 stops it happening so far...
4731.81Smrg	kcah
4741.81Smrg
4751.21Smycroft	hack	vax Toolchain bug
4761.21Smycroft	cdate	28 Mar 2003
4771.21Smycroft	who	he
4781.21Smycroft	file	sys/arch/vax/vax/intvec.S : 1.5
4791.21Smycroft	descr
4801.21Smycroft		Workaround for PR toolchain/20924.  The assembler apparently
4811.21Smycroft		tries to range-check byte offsets when it doesn't have
4821.21Smycroft		sufficient information to make that decision.
4831.21Smycroft		Workaround uses `brw' instead of `brb' instruction.
4841.23She	kcah
4851.23She
4861.54She	hack	declare boolean_t in two IPF user-mode programs
4871.54She	cdate	Tue Mar  7 19:19:20 CET 2006
4881.54She	who	he
4891.54She	file	dist/ipf/ipsend/iptests.c : 1.8
4901.54She		dist/ipf/ipsend/sock.c : 1.7
4911.54She	descr
4921.54She		The IPF user-mode programs ipsend and iptest first
4931.54She		include <sys/types.h> without _KERNEL defined, and
4941.54She		later include <sys/file.h> with _KERNEL defined.
4951.54She		This causes a build failure when building for vax,
4961.54She		since <sys/device.h> ends up being included without
4971.54She		bollean_t being defined by <sys/types.h>.
4981.54She		Build failure and further details documented in
4991.54She		PR#32907.
5001.54She	kcah
5011.54She
5021.104Sgmcgarry	hack	pcc 0.9.9 large string literals
5031.104Sgmcgarry	cdat	8 July 2008
5041.104Sgmcgarry	who	gmcgarry
5051.104Sgmcgarry	file	sys/conf/param.c : 1.58
5061.104Sgmcgarry	descr
5071.104Sgmcgarry		Workaround for pcc 0.9.9 not handling large string literals
5081.104Sgmcgarry		which causes kernels with 'options INCLUDE_CONFIG_FILE' to
5091.104Sgmcgarry		fail compilation.
5101.104Sgmcgarry		There is a proposal on the pcc mailing list to stuff config
5111.104Sgmcgarry		file in ELF section.
5121.104Sgmcgarry	kcah
5131.104Sgmcgarry
5141.107Smrg	hack	xorg warnings
5151.129Schristos	cdat	30 July 2008, 3 June, 2013
5161.107Smrg	who	mrg
5171.108Smrg	file	external/mit/xorg/lib/libSM/Makefile : 1.2
5181.129Schristos		external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10
5191.107Smrg		external/mit/xorg/lib/libXext/Makefile : 1.2
5201.107Smrg		external/mit/xorg/lib/libXfont/Makefile : 1.2
5211.107Smrg	descr
5221.107Smrg		Disable several warnings or use -Wno-error across Xorg sources
5231.107Smrg		while we get them working
5241.107Smrg	kcah
5251.107Smrg
5261.112Schristos	hack	32 bit time leftovers
5271.112Schristos	cdat	11 January 2009
5281.112Schristos	who	christos
5291.112Schristos	file	lib/libc/time/localtime.c : 1.41
5301.112Schristos		lib/libc/time/zic.c : 1.23
5311.112Schristos	descr
5321.112Schristos		The timezone compiled files still contain 32 bit time_t
5331.112Schristos		quantities. I did not want to version the files because
5341.112Schristos		the ``parser'' is too ugly for words. What needs to be
5351.112Schristos		done, is to rewrite the parser from scratch also to avoid
5361.112Schristos		potential core-dumps from parsing invalid files.
5371.112Schristos	kcah
5381.112Schristos
5391.112Schristos	hack	32 bit time leftovers
5401.112Schristos	cdat	11 January 2009
5411.112Schristos	who	christos
5421.112Schristos	file	various
5431.112Schristos	descr
5441.113Ssketch		Many filesystem on-disk formats have 32 bit times.
5451.112Schristos	kcah
5461.112Schristos
5471.141Schristos	hack	gcc 4.5 fsdb miscompile
5481.140Schristos	date	Sat Nov  9 11:03:02 EST 2013
5491.140Schristos	who	christos
5501.141Schristos	file	src/sbin/fsdb/Makefile : 1.36 (and earlier)
5511.140Schristos	descr
5521.140Schristos		src/sbin/fsdb/fsdb.c: In function 'findblk':
5531.140Schristos		src/sbin/fsdb/fsdb.c:610:1: error: unrecognizable insn:
5541.140Schristos		(insn 941 940 942 134 src/sbin/fsdb/fsdb.c:589 (set (reg:SI 604)
5551.140Schristos		    (subreg:SI (mem/s/j:DI (plus:SI (mult:SI (reg:SI 602)
5561.140Schristos                        (const_int 8 [0x8]))
5571.140Schristos                    (reg/f:SI 601)) [0 curinode.99_378->dp2.di_ib S8 A32]) 4)) \
5581.140Schristos			-1 (nil))
5591.140Schristos		src/sbin/fsdb/fsdb.c:610:1: internal compiler error: in \
5601.140Schristos		extract_insn, at recog.c:2103
5611.140Schristos	kcah
5621.140Schristos
5631.141Schristos	hack	gcc 4.8 gcc miscompiles
5641.141Schristos	date	Sat Nov  9 16:35:18 EST 2013
5651.141Schristos	who	christos
5661.141Schristos	file	distrib/utils/x_ping/Makefile
5671.141Schristos	file	distrib/vax/miniroot/Makefile.inc
5681.141Schristos	file	distrib/vax/ramdisk/Makefile
5691.141Schristos	file	external/gpl3/gdb/lib/libdecnumber/Makefile
5701.141Schristos	file	sbin/fsdb/Makefile
5711.141Schristos	file	sbin/newfs_ext2fs/Makefile
5721.141Schristos	file	sbin/ping/Makefile
5731.141Schristos	file	usr.sbin/lmcconfig/Makefile
5741.141Schristos	file	usr.sbin/mtrace/Makefile
5751.141Schristos	descr
5761.141Schristos		external/gpl3/gcc/dist/gcc/expmed.c:2781:1:
5771.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5781.141Schristos		external/gpl3/gcc/dist/gcc/recog.c:770:1:
5791.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5801.141Schristos		external/gpl3/gcc/dist/libdecnumber/decNumber.c:7214:3:
5811.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5821.141Schristos		sbin/ping/ping.c:679:1:
5831.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5841.141Schristos		sbin/newfs_ext2fs/mke2fs.c:681:1:
5851.141Schristos		internal compiler error: in reload_combine_note_use,
5861.141Schristos		at postreload.c:1561
5871.141Schristos		external/gpl3/gdb/dist/libdecnumber/decNumber.c:7214:3:
5881.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5891.141Schristos		usr.sbin/lmcconfig/lmcconfig.c:939:3:
5901.141Schristos		internal compiler error: in reload_combine_note_use,
5911.141Schristos		at postreload.c:1561
5921.141Schristos		usr.sbin/mtrace/mtrace.c:1655:1:
5931.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5941.141Schristos	kcah
5951.141Schristos
5961.21Smycroftport	arm
5971.21Smycroft
5981.21Smycroft	hack	gcc-unsigned-compare
5991.21Smycroft	cdate	09 Mar 2002
6001.21Smycroft	mdate	18 Mar 2002
6011.21Smycroft	who	bjh21
6021.21Smycroft	file	dist/bind/lib/nameser/ns_parse.c : 1.3
6031.21Smycroft	file	dist/dhcp/minires/ns_parse.c : 1.3
6041.21Smycroft	file	dist/dhcp/omapip/result.c : 1.2
6051.21Smycroft	file	dist/dhcp/server/failover.c : 1.3
6061.21Smycroft	file	gnu/dist/toolchain/bfd/bfd.c : 1.2
6071.21Smycroft	file	gnu/dist/toolchain/bfd/format.c : 1.2
6081.21Smycroft	file	gnu/dist/toolchain/gdb/target.c : 1.2
6091.21Smycroft	file	sys/kern/vfs_subr.c : 1.172
6101.21Smycroft	descr	When checking that a potentially-unsigned enum is >= 0, assign
6111.21Smycroft		it to an int first.  This is necessary to avoid "comparison is
6121.21Smycroft		always true" warnings with -fshort-enums.  Casting to an int
6131.21Smycroft		really should be enough, but turns out not to be.
6141.21Smycroft	kcah
6151.21Smycroft
6161.122Stsutsui	hack	gcc-4.5 arm CNAME hostname lookup failure on
6171.122Stsutsui		certain DNS environment (probably -ftree-ter problem)
6181.122Stsutsui	cdate	Sat Dec 24 04:59:00 UTC 2011
6191.122Stsutsui	mdate	
6201.122Stsutsui	who	tsutsui
6211.122Stsutsui	file	lib/libc/net/Makefile.inc 1.79
6221.122Stsutsui	descr	Hostname lookup against CNAMEs by some commands fails
6231.122Stsutsui		on certain DNS environments if lib/libc/net/gethnamaddr.c
6241.122Stsutsui		(ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc)
6251.122Stsutsui		are compiled with -O2, even though nslookup(1) against
6261.122Stsutsui		the same CNAME returns proper hostname.
6271.122Stsutsui		They works properly if compiled with -O2 -fno-tree-ter.
6281.122Stsutsui		Also -O2 fails but -O2 -fno-tree-ter works on the following
6291.122Stsutsui		test case in gcc bugzilla:
6301.122Stsutsui		http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4
6311.122Stsutsui	kcah
6321.122Stsutsui
6331.124Smsaitoh	hack	gcc-4.5 arm without -fno-tree-vrp generate broken code
6341.124Smsaitoh	cdate	Wed Nov 14 13:02:02 JST 2012
6351.124Smsaitoh	who	msaitoh
6361.124Smsaitoh	file	lib/libc/softfloat/Makefile.inc
6371.124Smsaitoh	pr	46953
6381.124Smsaitoh	regress	src/tests/lib/libm/t_cbrt
6391.124Smsaitoh	regress	src/tests/lib/libm/t_ceil
6401.124Smsaitoh	regress	src/tests/lib/libm/t_exp
6411.124Smsaitoh	regress	src/tests/lib/libm/t_log
6421.124Smsaitoh	regress	src/tests/lib/libm/t_scalbn
6431.124Smsaitoh	regress	src/tests/lib/libm/t_sinh
6441.124Smsaitoh	regress	src/tests/lib/libm/t_sqrt
6451.124Smsaitoh	descr	Gcc has a bug in tree optimization. For adddf3,
6461.124Smsaitoh		-INF + -INF returns 0 without -fno-tree-vrp.
6471.124Smsaitoh		Debugging with -fdump-tree-all shows that
6481.124Smsaitoh		softfloat.c.021t.cleanup_cfg is ok but softfloat.c.023t.ssa
6491.124Smsaitoh		is broken.
6501.124Smsaitoh	kcah
6511.21Smycroft
6521.21Smycroftport	sh3
6531.21Smycroft
6541.74Smrg	hack	gcc4-sh3-bz2
6551.103Stsutsui	cdate	Sun May 21 03:34:57 UTC 2006
6561.103Stsutsui	mdate	Fri May 16 13:13:00 UTC 2008
6571.103Stsutsui	who	mrg, tsutsui
6581.74Smrg	file	lib/libbz2/Makefile	: 1.10
6591.74Smrg	descr
6601.74Smrg		The in-tree GCC 4.1-based compiler generated too-far
6611.103Stsutsui		pc-relative addresses.  Hack is to build with
6621.103Stsutsui		-fno-loop-optimize.
6631.74Smrg	kcah
6641.74Smrg
6651.138Schristosport	sh3eb
6661.137Schristos	hack	gcc4.8.1
6671.137Schristos	cdate	Thu Nov  7 16:31:23 EST 2013
6681.137Schristos	who	christos
6691.137Schristos	file	src/sys/rump/net/lib/libnetbt/Makefile	: 1.2
6701.137Schristos	desrc
6711.138Schristos		for profiling
6721.137Schristos		compile l2cap_signal.c with -O0 to avoid:
6731.137Schristos		./netbt/l2cap_signal.c:36:
6741.137Schristos		/p/netbsd/cvsroot/src/sys/rump/net/lib/libnetbt/../../../../\
6751.137Schristos		netbt/l2cap_signal.c: In function 'l2cap_recv_signal':
6761.137Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
6771.137Schristos		impossible reload
6781.137Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
6791.137Schristos	kcah
6801.21Smycroft
6811.138Schristosport	sh3el
6821.138Schristos	hack	gcc4.8.1
6831.138Schristos	cdate	Fri Nov  8 19:27:01 EST 2013
6841.138Schristos	who	christos
6851.138Schristos	file	src/external/bsd/libevent/lib/libevent/Makefile	: 1.2
6861.138Schristos	desrc
6871.138Schristos		for profiling
6881.138Schristos		compile evdns.c with -O0 to avoid:
6891.138Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
6901.138Schristos		impossible reload
6911.138Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
6921.138Schristos	kcah
6931.139Schristos	
6941.139Schristos	hack	gcc4.8.1
6951.139Schristos	cdate	Fri Nov  8 19:34:48 EST 2013
6961.139Schristos	who	christos
6971.139Schristos	file	src/usr.sbin/racoon/Makefile	: 1.27
6981.139Schristos	desrc
6991.139Schristos		for profiling
7001.139Schristos		compile ipsec_doi.c with -O0 to avoid:
7011.139Schristos		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
7021.139Schristos		impossible reload
7031.139Schristos		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
7041.139Schristos	kcah
7051.138Schristos
7061.96Smrgport	m68000
7071.79Smrg
7081.96Smrg	hack	gcc4-m68000
7091.102Stsutsui	cdate	Fri Feb  8 10:29:37 PST 2008
7101.102Stsutsui	mdate	Sun May  4 15:37:19 UTC 2008
7111.99Stsutsui	who	mrg, tsutsui
7121.96Smrg	file	rescue/Makefile	: 1.21
7131.99Stsutsui	file	sbin/dump_lfs/Makefile	: 1.9
7141.101Stsutsui	file	sbin/fsck_ffs/Makefile	: 1.35
7151.101Stsutsui	file	sbin/fsdb/Makefile	: 1.22
7161.101Stsutsui	file	share/mk/sys.mk	: 1.96
7171.99Stsutsui	file	usr.sbin/ndbootd/Makefile	: 1.5
7181.95Smrg	descr
7191.101Stsutsui		Several internal compiler errors with gcc -O1
7201.101Stsutsui		around 64bit integer arithmetic.
7211.99Stsutsui		This hack uses -O1 and adds some -fno-tree-foo options
7221.99Stsutsui		to avoid the problem.
7231.101Stsutsui		This might be related with GCC Bugzilla Bug 32424.
7241.95Smrg	kcah
7251.95Smrg
7261.141Schristosport	m68k,sh3,vax
7271.135Schristos
7281.135Schristos	hack	gcc-4.8.1
7291.135Schristos	cdate	Wed Nov  6 20:41:35 EST 2013
7301.135Schristos	who	christos
7311.141Schristos	file	src/external/gpl3/gcc/libstdc++-v3/Makefile : 1.6
7321.135Schristos	descr
7331.135Schristos		compile hashtable_c++0x.cc with -O2 instead of -Os to
7341.135Schristos		produce missing instantiation of std::lower_bound expansion
7351.135Schristos		for unsigned long.
7361.135Schristos	kcah
7371.22Smrg
7381.116Smrgport	sparc
7391.116Smrg
7401.116Smrg	hack	avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3
7411.116Smrg	cdate	Sun Aug 14 19:26:48 PDT 2011
7421.116Smrg	who	mrg
7431.116Smrg	file	sys/arch/sparc64/sparc/cpu.c : 1.234
7441.116Smrg	file	sys/arch/sparc64/sparc/cpuvar.h : 1.90
7451.116Smrg	file	sys/arch/sparc64/sparc/genassym.cf : 1.67
7461.116Smrg	file	sys/arch/sparc64/sparc/locore.s : 1.265
7471.116Smrg	descr
7481.116Smrg		Something is wrong with GCC 4.5.3 and the savefpstate IPI.
7491.116Smrg		Post newlock2 there was a bug where a lock was reduced from
7501.116Smrg		IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI
7511.116Smrg		would crash due to NULL IPI.  This was fixed by re-using the
7521.116Smrg		right IPL value.  However, GCC 4.5.3 build kernels have the
7531.116Smrg		same problems.  For now, the hack is re-instated.
7541.116Smrg	kcah
7551.116Smrg
7561.116Smrg
7571.51Ssimonbport	mips
7581.51Ssimonb
7591.51Ssimonb	hack	mips-shared-linker-load-address
7601.51Ssimonb	cdate	Fri Oct  7 08:33:10 UTC 2005
7611.51Ssimonb	who	simonb
7621.51Ssimonb	file	src/sys/kern/exec_elf32.c : 1.107
7631.51Ssimonb	descr
7641.51Ssimonb		With COMPAT_16 or previous enabled (which enables
7651.51Ssimonb		ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will
7661.51Ssimonb		load and run at address 0.  The check to fix this in
7671.51Ssimonb		rev 1.107 only checks the first psection of the ELF
7681.51Ssimonb		executable, which may not be loadable.  A more correct
7691.51Ssimonb		fix is to check the first loadable psection instead of
7701.51Ssimonb		just the first psection.
7711.51Ssimonb	kcah
7721.54She
7731.85Smartin	hack	mips-duplicate-ras-end-label
7741.85Smartin	cdate	Sat Sep  2 23:29:42 2006
7751.85Smartin	who	martin
7761.92Schs	file	src/regress/sys/kern/ras/ras3/Makefile : 1.3
7771.85Smartin	descr
7781.85Smartin		Add -fno-reorder-blocks to CFLAGS to avoid duplicate
7791.85Smartin		labels by duplicated __asm output from RAS_END()
7801.85Smartin		macro.
7811.85Smartin	kcah
7821.85Smartin
7831.106Slukem	hack	mips-mcount-assembler-warning
7841.106Slukem	cdate	Tue Jul 29 14:16:52 UTC 2008
7851.106Slukem	who	lukem
7861.106Slukem	file	src/lib/libc/gmon/Makefile.inc : 1.8
7871.106Slukem	descr
7881.106Slukem		Workaround for PR port-mips/39192.
7891.106Slukem		common/lib/libc/gmon/mcount.c generates a (fatal)
7901.106Slukem		assembler warning on MIPS:
7911.106Slukem			Warning: No .cprestore pseudo-op used in PIC code
7921.106Slukem		Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings
7931.106Slukem	kcah
7941.106Slukem
7951.82Schristosport	i386
7961.82Schristos
7971.84Sdrochner	hack	use volatile intermediate variable to enforce rounding
7981.84Sdrochner	cdate	Tue Aug  1 22:15:55 MEST 2006
7991.84Sdrochner	who	drochner
8001.84Sdrochner	file	src/lib/libm/src/lrintf.c : 1.4
8011.84Sdrochner	file	src/lib/libm/src/s_rintf.c : 1.8
8021.84Sdrochner	descr
8031.84Sdrochner		gcc-4 does subsequent operations on "float" values within
8041.84Sdrochner		the i387 FPU without rounding the intermediate results
8051.84Sdrochner	kcah
8061.110Smacallan
8071.148Schristosport	x86
8081.148Schristos	hack	turn off optimization for biosdisk_ll.c because otherwise
8091.148Schristos		we are pass the wrong arguments to biosdisk_read(). 
8101.148Schristos		$ cd /usr/src/sys/arch/i386/floppies/bootflopp-com
8111.148Schristos		$ qemu-system-i386 -nographic -fda boot-com1.fs -boot a
8121.148Schristos	who	christos
8131.148Schristos	file	src/sys/arch/i386/stand/lib/Makefile : 1.38
8141.148Schristos	descr
8151.148Schristos		Turning on DISK_DEBUG shows the problem. We should find
8161.148Schristos		out which option is causing this.
8171.148Schristos	hcah
8181.148Schristos
8191.110Smacallanport	powerpc
8201.110Smacallan
8211.110Smacallan	hack	avoid using __builtin_return_address(0) because it fails in
8221.110Smacallan		Xorg's module loader
8231.110Smacallan	cdate	Sat Sep 27 03:52:05 UTC 2008
8241.110Smacallan	who	macallan
8251.110Smacallan	file	src/libexec/ld.elf_so/rtld.c : 1.121
8261.110Smacallan	descr
8271.110Smacallan		workaround for PR port-macppc/37812
8281.110Smacallan	kcah
8291.110Smacallan
8301.115Smatt	hack	define TARGET_SECURE_PLT and HAVE_AS_TLS because when
8311.115Smatt		building the native compiler via build.sh those don't defined
8321.115Smatt		properly.
8331.115Smatt	cdate	Sat Mar 12 08:00:00 UTC 2011
8341.115Smatt	who	matt
8351.115Smatt	file	src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h
8361.115Smatt	descr
8371.115Smatt		see above
8381.115Smatt	kcah
8391.117Schristos
8401.117Schristosport	powerpc64
8411.117Schristos
8421.117Schristos	hack	include _errno.c in libposix so that __errno resolves. It
8431.117Schristos		should resolve from libc's errno, but somehow it does not.
8441.117Schristos		Linker bug?
8451.117Schristos	cdate	Thu Oct 27 13:19:47 EDT 2011
8461.117Schristos	who	christos
8471.117Schristos	file	src/lib/libposix/Makefile: 1.15
8481.118Schristos	file	src/lib/librt/Makefile: 1.14
8491.117Schristos	descr
8501.117Schristos		workaround for:
8511.117Schristos		    libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \
8521.117Schristos		    R_PPC64_REL24 relocation against symbol `.__errno'
8531.117Schristos	kcah
8541.119Schristos
8551.119Schristos	hack	rename data() function in mdocml to avoid redefined error.
8561.119Schristos		Compiler/Assembler bug?
8571.119Schristos	cdate	Sat Oct 29 11:16:01 EDT 2011
8581.119Schristos	who	christos
8591.119Schristos	file	src/external/bsd/mdocml/tbl_data.c: 1.2
8601.119Schristos	descr
8611.119Schristos		workaround for:
8621.119Schristos		    {standard input}: Assembler messages:
8631.119Schristos		    {standard input}:105: Error: symbol `.data' is already \
8641.119Schristos		    defined
8651.119Schristos	kcah
8661.120Schristos
8671.120Schristosport	emips
8681.120Schristos
8691.120Schristos	hack	Add nop between ctc1 and mtc0 to avoid assembler internal
8701.120Schristos		error
8711.120Schristos	cdate	Sat Oct 29 16:57:34 EDT 2011
8721.120Schristos	who	christos
8731.120Schristos	file	src/sys/arch/mips/mips/mips_fpu.c: 1.7
8741.120Schristos	descr
8751.120Schristos		workaround for:
8761.120Schristos		    {standard input}: Assembler messages:
8771.120Schristos		    {standard input}:730: Internal error!
8781.120Schristos		    Assertion failure in append_insn at /usr/src/external/gpl3/\
8791.120Schristos		    binutils/dist/gas/config/tc-mips.c line 2910.
8801.120Schristos	kcah
8811.125Smartin
8821.125Smartinport	ia64
8831.125Smartin
8841.125Smartin	hack	libc hesiod.c file does not compile with -O2 (internal
8851.125Smartin		compiler error in gcc 4.5.3)
8861.125Smartin	cdate	Thu Dec 27 08:05:43 CET 2012
8871.125Smartin	who	martin
8881.125Smartin	file	src/lib/libc/net/Makefile.inc: 1.82
8891.125Smartin	descr
8901.125Smartin		workaround for:
8911.125Smartin		{standard input}: Assembler messages:
8921.125Smartin		{standard input}:1507: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 15
8931.125Smartin		{standard input}:1506: Warning: This is the location of the conflicting usage
8941.125Smartin		{standard input}: Error: 2 warnings, treating warnings as errors
8951.125Smartin	kcah
8961.125Smartin
8971.126Smartin	hack	libelf libelf_extended.c compiler error in gcc 4.5.3
8981.126Smartin	cdate	Thu Dec 27 09:05:51 CET 2012
8991.126Smartin	who	martin
9001.126Smartin	file	src/external/bsd/libelf/lib/Makefile: 1.3
9011.126Smartin	descr
9021.126Smartin		workaround for:
9031.126Smartin		{standard input}: Assembler messages:
9041.126Smartin		{standard input}:87: Warning: Use of 'adds' may violate RAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
9051.126Smartin		{standard input}:87: Warning: Only the first path encountering the conflict is reported
9061.126Smartin		{standard input}:85: Warning: This is the location of the conflicting usage
9071.126Smartin	kcah
9081.126Smartin
9091.127Smartin	hack	compiler error with gcc 4.5.x
9101.127Smartin	cdate	Thu Dec 27 15:15:25 CET 2012
9111.127Smartin	who	martin
9121.127Smartin	file	src/crypto/external/bsd/netpgp/lib/verify/Makefile: 1.5
9131.127Smartin	descr
9141.127Smartin		workaround for:
9151.127Smartin		{standard input}: Assembler messages:
9161.127Smartin		{standard input}:22979: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8
9171.127Smartin		{standard input}:22978: Warning: This is the location of the conflicting usage
9181.127Smartin	kcah
9191.127Smartin
9201.157Smartin	hack	libgcc unwind dummy function
9211.157Smartin	cdate	Fri Apr 17 14:31:03 CEST 2015
9221.157Smartin	who	martin
9231.157Smartin	file	src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4
9241.157Smartin	descr
9251.157Smartin		Add an empty _Unwind_FindTableEntry() implementation.
9261.157Smartin		In the end we will use our libc stuff, and this should
9271.157Smartin		go away again.
9281.157Smartin	kcah
9291.157Smartin
9301.128Schristosport	x68k
9311.127Smartin
9321.128Schristos	hack	compiler error with gcc 4.5.x
9331.128Schristos	cdate	Fri May 24 13:23:01 EDT 2013
9341.128Schristos	who	christos
9351.128Schristos	file	src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17
9361.128Schristos		xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11
9371.128Schristos	descr
9381.128Schristos		workaround for:
9391.128Schristos		internal compiler error: in cselib_record_set, at cselib.c:1999
9401.128Schristos	kcah
9411.130Sjoerg
9421.130Sjoerghack	fallback to /usr/bin/clang-cpp in rpcgen
9431.130Sjoergcdate	Wed Jun  5 15:49:27 CEST 2013
9441.130Sjoergwho	joerg
9451.130Sjoergfile	src/usr.bin/rpcgen/rpc_main.c
9461.130Sjoergdescr
9471.136Sjoerg	It is undecided which compiler owns /usr/bin/cpp and whether it should
9481.130Sjoerg	exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box,
9491.130Sjoerg	if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback.
9501.130Sjoerg	This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable.
9511.130Sjoergkcah
9521.131Sskrll
9531.155Sskrllport	hppa
9541.131Sskrll
9551.131Sskrll	hack	compiler error with gcc 4.5.x
9561.131Sskrll	cdate	Tue Jul 23 07:42:28 BST 2013
9571.131Sskrll	who	skrll
9581.133Sskrll	file	src/sys/lib/libkern/Makefile.libkern: 1.26
9591.133Sskrll	descr
9601.133Sskrll		workaround for unanalysed codegen bug affecting md5c.c.
9611.133Sskrll	kcah
9621.149Smacallan
9631.155Sskrll	hack	gdb vs _rtld_debug_state problem
9641.155Sskrll	cdate	Thu Mar  5 09:49:53 UTC 2015
9651.155Sskrll	who	skrll
9661.155Sskrll	file	src/libexec/ld.elf_so/rtld.c: 1.175
9671.155Sskrll	descr
9681.155Sskrll		workaround for problem where gdb misses the breakpoint on
9691.155Sskrll		_rtld_debug_state when the function is only the
9701.155Sskrll		bv,n %r0(%rp) instruction - the nullify seems to
9711.155Sskrll		confuse something
9721.155Sskrll	kcah
9731.155Sskrll
9741.149Smacallanport	mips64*
9751.149Smacallanhack	compiler crashes on mips64* with optimization enabled
9761.149Smacallancdate	Tue May 13 18:46:48 UTC 2014
9771.149Smacallanwho	macallan
9781.149Smacallanfile	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6
9791.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5
9801.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6
9811.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5
9821.149Smacallandescr	workaround for n32 gcc doing unaligned 64bit accesses when optimizing
9831.149Smacallanpr	48696
9841.149Smacallankcah
9851.150Smartin
9861.150Smartinport	vax
9871.150Smartinhack	compile boot with -O1
9881.150Smartincdate	Sat May 24 09:40:58 CEST 2014
9891.150Smartinwho	martin
9901.150Smartinfile	src/sys/arch/vax/boot/boot/Makefile: 1.41
9911.150Smartindescr	/boot does not work when compiled with -O2 and gcc 4.8
9921.150Smartinkcah
9931.150Smartin
9941.156Smattport	arm
9951.156Smatthack	avoid using labels in a 12-bit constant.
9961.156Smattwho	matt
9971.156Smattfile	crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2
9981.156Smattdescr	workaround for clang misassembling an instruction
9991.156Smattkcah
1000