HACKS revision 1.194
11.194Schristos# $NetBSD: HACKS,v 1.194 2019/10/30 00:26:54 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.190Smayahack	static linking with libpthread
311.190Smayamdate	7 May 2019
321.190Smayawho	maya
331.190Smayafile	lib/libpthread/Makefile 1.92 -> 1.94
341.190Smayadescr
351.190Smaya	To avoid some libc thread stub functions being picked up
361.190Smaya	in static builds, link pthread as one section.
371.190Smayakcah
381.190Smaya
391.166Schristoshack	gcc-5.3 optimizes memset+malloc -> calloc inside calloc
401.166Schristosmdate	4 May 2016
411.166Schristoswho	christos
421.166Schristosfile	external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5
431.166Schristosdescr
441.166Schristos	resulting in infinite recursion; we prevent this with
451.166Schristos	-fno-builtin-malloc
461.166Schristoskcah
471.166Schristos
481.167Smrghack	turn off tree-vrp for parts of ufs_lookup.c
491.167Smrgmdate	28 April 2016
501.167Smrgwho	mrg christos
511.167Smrgfile	src/sys/ufs/ufs/ufs_lookup.c : 1.144
521.167Smrgpr	51094
531.167Smrgdescr
541.167Smrg	with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir
551.167Smrg	panicks are see.
561.167Smrghcah
571.167Smrg
581.1Slukemhack	netstat ieee1394 address printing.
591.1Slukemmdate	14 Nov 2000
601.1Slukemwho	matt
611.1Slukemfile	lib/libc/net/getnameinfo.c	: 1.32 : 497 : 503
621.1Slukemdescr
631.1Slukem	Because the current implementation of IP over IEEE1394, the
641.1Slukem	fw device address contains more than just the IEEE1394 EUI-64.
651.1Slukem	So when printing out IEEE1394 addresses, ignore the extra stuff.
661.1Slukemkcah
671.1Slukem
681.1Slukemhack	xterm vs. libterm
691.1Slukemmdate	01 Aug 2000
701.1Slukemwho	jdc
711.1Slukemfile	xsrc/xc/programs/xterm/main.c	: 1.2 : 3609 : 3614
721.1Slukempr	10383
731.1Slukemdescr
741.1Slukem	In order to extend the termcap string over 1023 bytes, a ZZ entry was
751.1Slukem	introduced to point to a memory location containing the full entry.
761.1Slukem	Without this hack, xterm will export a termcap containing the ZZ
771.1Slukem	entry, which will then be ignored by libterm.  As xterm modifies the
781.1Slukem	exported termcap, this would cause those modifications to be ignored.
791.1Slukemkcah
801.1Slukem
811.1Slukemhack	wi-at-big-endian-bus
821.1Slukemcdate	15 Mar 2002
831.1Slukemwho	martin
841.1Slukemfile	dev/ic/wireg.h
851.1Slukemdescr	Add an option to access the underlying bus in big endian byte order
861.1Slukem	to work around deficiencies in bus_space_{read,write}_* macros.
871.1Slukem	Those don't allow the implementation of a proper pcmcia bus space
881.1Slukem	tag.
891.1Slukemkcah
901.1Slukem
911.3Sjdchack	specific knowledge of colours in curses code
921.3Sjdccdate	Sun Apr  6 11:05:24 BST 2003
931.3Sjdcwho	jdc
941.3Sjdcfile	lib/libcurses/color.c : r1.24
951.3Sjdcdescr
961.3Sjdc	Swap red/blue and yellow/cyan colours for COLOR_OTHER.
971.3Sjdc	Fix is to enhance libtermcap to understand terminfo-style % sequences.
981.3Sjdc	See also:
991.5Ssalo	    http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html
1001.4Sscwkcah
1011.4Sscw
1021.7Shehack	Compensation for differing types of LINUX_USRSTACK and USRSTACK
1031.7Shecdate	21 Aug 2003
1041.7Shewho	he
1051.7Shefile	sys/miscfs/procfs/procfs_linux.c : 1.14
1061.7Shedescr
1071.7She	Not all ports have LINUX_USRSTACK and/or USRSTACK defined as
1081.7She	literals/constants, but refer to variables of a type which is
1091.7She	not "unsigned long", causing compilation of procfs_linux.c to
1101.7She	fail with "makes integer from pointer without a cast".  This
1111.7She	is observed on e.g. the sun3 port.  Ideally the "types" for
1121.7She	symbols should be consistent across all ports.
1131.25Smrgkcah
1141.25Smrg
1151.80Stsutsuihack	gcc4 wrong uninitialized variable
1161.58Smrgmdate	10 May 2006
1171.58Smrgwho	mrg
1181.58Smrgfile	bin/ksh/eval.c			: 1.6
1191.58Smrgfile	bin/sh/histedit.c		: 1.39
1201.58Smrgfile	bin/sh/parser.c			: 1.60
1211.58Smrgfile	crypto/dist/heimdal/kdc/524.c	: 1.10
1221.58Smrgfile	crypto/dist/ssh/sftp.c		: 1.20
1231.58Smrgfile	crypto/dist/ssh/ssh-keysign.c	: 1.11
1241.58Smrgfile	dist/ipf/lib/hostname.c		: 1.2
1251.58Smrgfile	dist/ipf/tools/ipmon.c		: 1.8
1261.72Smrgfile	dist/ntp/ntpd/ntp_request.c	: 1.4
1271.58Smrgfile	dist/ntp/ntpd/refclock_shm.c	: 1.4
1281.58Smrgfile	dist/ntp/sntp/timing.c		: 1.3
1291.58Smrgfile	dist/pppd/pppstats/pppstats.c	: 1.3
1301.58Smrgfile	dist/smbfs/lib/smb/rap.c	: 1.6
1311.58Smrgfile	dist/tcpdump/print-zephyr.c	: 1.5
1321.68Smrgfile	distrib/utils/sysinst/aout2elf.c : 1.12
1331.58Smrgfile	gnu/libexec/uucp/uucico/uucico.c : 1.6
1341.58Smrgfile	lib/libc/citrus/citrus_csmapper.c : 1.6
1351.58Smrgfile	lib/libc/citrus/citrus_pivot_factory.c : 1.5
1361.58Smrgfile	lib/libc/inet/inet_cidr_ntop.c	: 1.3
1371.58Smrgfile	lib/libc/inet/inet_ntop.c	: 1.3
1381.58Smrgfile	lib/libc/stdio/vfwprintf.c	: 1.8
1391.69Smrgfile	libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20
1401.76Smrgfile	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40
1411.74Smrgfile	libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22
1421.69Smrgfile	libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39
1431.58Smrgfile	libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39
1441.74Smrgfile	libexec/ld.elf_so/arch/vax/mdreloc.c	: 1.21
1451.71Sdanfile	libexec/ld.elf_so/arch/x86_64/mdreloc.c	: 1.27
1461.58Smrgfile	sbin/fsck_ext2fs/dir.c		: 1.19
1471.58Smrgfile	sbin/routed/rtquery/rtquery.c	: 1.18
1481.73Sdanfile	sys/arch/amd64/amd64/pmap.c	: 1.26
1491.79Smrgfile	sys/arch/i386/pci/piixpcib.c	: 1.4
1501.80Stsutsuifile	sys/arch/m68k/m68k/pmap_motorola.c	: 1.4
1511.58Smrgfile	sys/crypto/cast128/cast128.c	: 1.9
1521.58Smrgfile	sys/ddb/db_command.c		: 1.86
1531.68Smrgfile	sys/dev/cardbus/cardbus_map.c	: 1.21
1541.58Smrgfile	sys/dev/fss.c			: 1.25
1551.69Smrgfile	sys/dev/ic/igsfb.c		: 1.39
1561.68Smrgfile	sys/dev/ic/mb86950.c		: 1.5
1571.58Smrgfile	sys/dev/ic/midway.c		: 1.71
1581.68Smrgfile	sys/dev/kttcp.c			: 1.18
1591.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1601.68Smrgfile	sys/dev/pci/cmpci.c		: 1.31
1611.58Smrgfile	sys/dev/pci/machfb.c		: 1.45
1621.68Smrgfile	sys/dev/usb/ohci.c		: 1.174
1631.68Smrgfile	sys/dev/usb/uhci.c		: 1.196
1641.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1651.58Smrgfile	sys/dist/ipf/netinet/ip_nat.c	: 1.10
1661.58Smrgfile	sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8
1671.58Smrgfile	sys/dist/pf/net/pf.c		: 1.22
1681.59Smrgfile	sys/fs/udf/udf_vnops.c		: 1.4
1691.58Smrgfile	sys/kern/kern_sig.c		: 1.219
1701.58Smrgfile	sys/kern/tty.c			: 1.181
1711.58Smrgfile	sys/net/bpf.c			: 1.116
1721.58Smrgfile	sys/net/zlib.c			: 1.26
1731.68Smrgfile	sys/netccitt/if_x25subr.c	: 1.37
1741.58Smrgfile	sys/netinet/in.c		: 1.107
1751.58Smrgfile	sys/netsmb/smb_smb.c		: 1.27
1761.58Smrgfile	sys/netsmb/smb_trantcp.c	: 1.22
1771.58Smrgfile	sys/nfs/nfs_serv.c		: 1.108
1781.58Smrgfile	sys/nfs/nfs_socket.c		: 1.129
1791.58Smrgfile	sys/nfs/nfs_syscalls.c		: 1.91
1801.58Smrgfile	sys/ufs/lfs/lfs_vfsops.c	: 1.207 [also (char *)]
1811.58Smrgfile	usr.bin/ftp/ftp.c		: 1.140
1821.58Smrgfile	usr.bin/find/function.c		: 1.54
1831.58Smrgfile	usr.bin/mail/tty.c		: 1.20
1841.100Stsutsuifile	usr.bin/msgc/msg_sys.def	: 1.33-1.34
1851.58Smrgfile	usr.bin/nl/nl.c			: 1.7
1861.58Smrgfile	usr.bin/systat/keyboard.c	: 1.23
1871.58Smrgfile	usr.bin/usbhidctl/usbhid.c	: 1.29
1881.58Smrgfile	usr.bin/vi/cl/cl_read.c		: 1.5
1891.58Smrgfile	usr.bin/vi/ex/ex_cscope.c	: 1.12
1901.58Smrgfile	usr.bin/vi/ex/ex_tag.c		: 1.19
1911.58Smrgfile	usr.bin/vi/vi/v_txt.c		: 1.15
1921.58Smrgfile	usr.sbin/altq/altqstat/qdisc_rio.c : 1.4
1931.58Smrgfile	usr.sbin/cron/do_command.c	: 1.19
1941.58Smrgfile	usr.sbin/timed/timed/slave.c	: 1.15
1951.58Smrgdescr
1961.58Smrg	GCC 4.1 gets many uninitialised variable warnings wrong.  We should
1971.58Smrg	really audit all the old hacks like this when older compilers are
1981.58Smrg	removed from the tree, as many are probably no longer required.
1991.65Schristos	The problem is that it does not recognize initialization via function
2001.65Schristos	call pointer. I.e.
2011.65Schristos		int p;
2021.65Schristos		foo(&p);
2031.65Schristos	does not mark p as initialized.
2041.58Smrgkcah
2051.58Smrg
2061.59Smrghack	gcc4 pointer sign and strict aliasing problems
2071.59Smrgmdate	10 May 2006
2081.59Smrgwho	mrg
2091.59Smrgfile	bin/ed/Makefile			: 1.33
2101.68Smrgfile	distrib/utils/sysinst/Makefile.inc : 1.44
2111.91Smartinfile	distrib/utils/x_dhclient/Makefile : 1.15
2121.60Smrgfile	games/bcd/Makefile		: 1.5
2131.60Smrgfile	games/dab/Makefile		: 1.5
2141.60Smrgfile	games/larn/Makefile		: 1.17
2151.60Smrgfile	games/pom/Makefile		: 1.5
2161.60Smrgfile	lib/libasn1/Makefile		: 1.26
2171.60Smrgfile	lib/libcrypt/Makefile		: 1.17
2181.60Smrgfile	lib/libgssapi/Makefile		: 1.16
2191.60Smrgfile	lib/libhdb/Makefile		: 1.20
2201.60Smrgfile	lib/libkadm5clnt/Makefile	: 1.21
2211.60Smrgfile	lib/libkadm5srv/Makefile	: 1.25
2221.60Smrgfile	lib/libkrb5/Makefile		: 1.35
2231.60Smrgfile	lib/libssh/Makefile		: 1.6
2241.60Smrgfile	lib/libtelnet/Makefile		: 1.26
2251.60Smrgfile	libexec/getty/Makefile		: 1.14
2261.60Smrgfile	libexec/kadmind/Makefile	: 1.19
2271.60Smrgfile	libexec/kpasswdd/Makefile	: 1.14
2281.60Smrgfile	sbin/atactl/Makefile		: 1.3
2291.60Smrgfile	sbin/cgdconfig/Makefile		: 1.7
2301.60Smrgfile	sbin/clri/Makefile		: 1.13
2311.60Smrgfile	sbin/dkctl/Makefile		: 1.4
2321.60Smrgfile	sbin/dump/Makefile		: 1.33
2331.60Smrgfile	sbin/fdisk/Makefile		: 1.35
2341.60Smrgfile	sbin/fsck_ext2fs/Makefile	: 1.11
2351.60Smrgfile	sbin/fsck_ffs/Makefile		: 1.29
2361.60Smrgfile	sbin/fsdb/Makefile		: 1.18
2371.60Smrgfile	sbin/mount_smbfs/Makefile	: 1.4
2381.60Smrgfile	sbin/newfs/Makefile		: 1.30
2391.60Smrgfile	sbin/newfs_sysvbfs/Makefile	: 1.2
2401.60Smrgfile	sbin/restore/Makefile		: 1.23
2411.60Smrgfile	sbin/veriexecctl/Makefile	: 1.11
2421.64Smrgfile	sys/lib/libsa/Makefile		: 1.59
2431.68Smrgfile	sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24
2441.59Smrgfile	usr.bin/awk/Makefile		: 1.9
2451.64Smrgfile	usr.bin/crontab/Makefile	: 1.24
2461.60Smrgfile	usr.bin/ctags/Makefile		: 1.8
2471.61Smrgfile	usr.bin/gzip/Makefile		: 1.10
2481.60Smrgfile	usr.bin/ssh/sftp/Makefile	: 1.10
2491.60Smrgfile	usr.bin/ssh/ssh/Makefile	: 1.25
2501.59Smrgfile	usr.bin/vi/build/Makefile	: 1.26
2511.60Smrgfile	usr.bin/telnet/Makefile		: 1.40
2521.60Smrgfile	usr.bin/tn3270/tn3270/Makefile	: 1.36
2531.60Smrgfile	usr.bin/tr/Makefile		: 1.4
2541.59Smrgfile	usr.sbin/amd/amd/Makefile	: 1.27
2551.59Smrgfile	usr.sbin/amd/amq/Makefile	: 1.14
2561.59Smrgfile	usr.sbin/amd/libamu/Makefile	: 1.20
2571.59Smrgfile	usr.sbin/amd/pawd/Makefile	: 1.5
2581.59Smrgfile	usr.sbin/bind/Makefile.inc	: 1.22
2591.60Smrgfile	usr.sbin/bind/libdns/Makefile	: 1.3
2601.60Smrgfile	usr.sbin/bind/named/Makefile	: 1.17
2611.60Smrgfile	usr.sbin/bootp/bootptest/Makefile : 1.2
2621.60Smrgfile	usr.sbin/chrtbl/Makefile	: 1.6
2631.60Smrgfile	usr.sbin/cron/Makefile		: 1.12
2641.59Smrgfile	usr.sbin/dhcp/Makefile.inc	: 1.20
2651.60Smrgfile	usr.sbin/hprop/Makefile		: 1.13
2661.60Smrgfile	usr.sbin/installboot/Makefile	: 1.35
2671.59Smrgfile	usr.sbin/ipf/ipftest/Makefile	: 1.32
2681.59Smrgfile	usr.sbin/isdn/isdnd/Makefile	: 1.6
2691.59Smrgfile	usr.sbin/isdn/isdnmonitor/Makefile : 1.3
2701.59Smrgfile	usr.sbin/isdn/isdntel/Makefile	: 1.2
2711.59Smrgfile	usr.sbin/isdn/isdntrace/Makefile : 126
2721.61Smrgfile	usr.sbin/mopd/common/Makefile	: 1.10
2731.61Smrgfile	usr.sbin/mopd/mopd/Makefile	: 1.9
2741.61Smrgfile	usr.sbin/mopd/mopprobe/Makefile	: 1.7
2751.60Smrgfile	usr.sbin/makefs/Makefile	: 1.17
2761.60Smrgfile	usr.sbin/mscdlabel/Makefile	: 1.5
2771.60Smrgfile	usr.sbin/pkg_install/add/Makefile : 1.7
2781.60Smrgfile	usr.sbin/pkg_install/create/Makefile : 1.5
2791.60Smrgfile	usr.sbin/pkg_install/lib/Makefile : 1.28
2801.59Smrgfile	usr.sbin/ntp/ntpd/Makefile	: 1.10/1.11
2811.59Smrgfile	usr.sbin/ntp/ntptime/Makefile	: 1.4/1.5
2821.59Smrgfile	usr.sbin/pppd/Makefile.inc	: 1.3
2831.59Smrgfile	usr.sbin/pppd/pppd/Makefile	: 1.38
2841.60Smrgfile	usr.sbin/rarpd/Makefile		: 1.10
2851.59Smrgfile	usr.sbin/rbootd/Makefile	: 1.10
2861.60Smrgfile	usr.sbin/rpc.pcnfsd/Makefile	: 1.17
2871.60Smrgfile	usr.sbin/tcpdump/Makefile	: 1.42
2881.59Smrgdescr
2891.59Smrg	GCC 4.1 warns on pointer sign comparision/assignments and lots of
2901.59Smrg	code does not conform.  For now we use -Wno-pointer-sign and
2911.59Smrg	-fno-strict-aliasing.
2921.59Smrgkcah
2931.59Smrg
2941.145Schristoshack	disable ctf for gcc-4.8 build
2951.145Schristosmdate	April 3 2014
2961.146Swizwho	christos
2971.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.frontend	: 1.4
2981.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.backend	: 1.5
2991.145Schristosdescr
3001.145Schristos	nbctfconvert -g -L VERSION -g fold-const.o
3011.145Schristos	ERROR: fold-const.c: failed to get mapping for tid 79154 \
3021.145Schristos		((null)) <13532>
3031.145Schristoskcak
3041.145Schristos
3051.121Schristoshack	emacs aborting on exit (libgcc issue)
3061.121Schristosmdate	7 November 2011
3071.121Schristoswho	christos
3081.121Schristosfile	external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2
3091.121Schristosdescr
3101.121Schristos	GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit
3111.121Schristos	to do just that. If the symbol requested is not found, then it aborts.
3121.121Schristos	emacs 23.3 triggers this assertion. For now disable aborting, and
3131.121Schristos	silently ignore.
3141.121Schristoskcah
3151.121Schristos
3161.105Sagchack	cross-building hack on Darwin
3171.105Sagcmdate	20 July 2008
3181.105Sagcwho	agc
3191.105Sagcfile	src/distrib/common/Makefile.mdset	: 1.33
3201.105Sagcdescr
3211.105Sagc	Darwin has problems with getopt() when used in mdsetimage -v,
3221.105Sagc	due to the difference between BSD and libiberty() getopt
3231.105Sagc	implementations, more fully described in
3241.105Sagc	http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html
3251.105Sagc	and the subsequent thread.  For just now, we just have an ugly
3261.105Sagc	workaround not to call mdsetimage with the -v argument on Darwin
3271.105Sagckcah
3281.105Sagc
3291.109Sveegohack	avoid rebuilding asn1 libraries
3301.109Sveegomdate	03 August 2008
3311.109Sveegowho	veego
3321.109Sveegofile	src/crypto/dist/heimdal/lib/asn1/gen.c	: 1.10
3331.109Sveegofile	src/lib/libasn1/Makefile	: 1.32
3341.109Sveegofile	src/lib/libhdb/Makefile	: 1.23
3351.109Sveegofile	src/lib/libgssapi/Makefile	: 1.20
3361.109Sveegofile	src/lib/libhx509/Makefile	: 1.3
3371.109Sveegopr	9702 39185
3381.109Sveegodescr
3391.109Sveego	asn1_compile does not check if generated header files do not have to
3401.109Sveego	be rebuild.
3411.109Sveego	Generate .hx files and copy it in the Makefiles if they changed.
3421.109Sveegokcah
3431.109Sveego
3441.144Stronhack	Disable fortification for /usr/bin/makeinfo
3451.144Stroncdata	24 Mar 2014
3461.144Stronwho	tron
3471.186Smayafile	src/external/gpl2/texinfo/bin/makeinfo/Makefile	: 1.1
3481.144Stronpr	N/A
3491.144Strondescr
3501.144Stron	If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3
3511.144Stron	it fails to process certain texinfo files, e.g. "cl.texi"
3521.144Stron	included in the Emacs 24.3 distribution.
3531.144Stronkcah
3541.144Stron
3551.147Stronhack	Disable Stack Smash Protection for /usr/X11R7/bin/xauth
3561.147Stroncdata	05 Apr 2014
3571.147Stronwho	tron
3581.147Stronfile	src/external/mit/xorg/bin/xauth/Makefile	: 1.4
3591.147Stronpr	N/A
3601.147Strondescr
3611.147Stron	If "xauth" is compile with "USE_SSP" set to "yes" it fails
3621.147Stron	mysteriously with an error message like this:
3631.147Stron
3641.147Stron	/usr/X11R7/bin/xauth:  file /foo/bar/.Xauthority does not exist
3651.147Stron	/usr/X11R7/bin/xauth:  unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority
3661.147Stron
3671.147Stron	The compiler seems to get confused about the two filename variables
3681.147Stron	used in the link(2) system call.
3691.147Stronkcah
3701.147Stron
3711.162Spookahack	g++ 5.x barfs on volatile in constexpr initializers
3721.162Spookacdata	27 Aug 2015
3731.160Spookawho	pooka
3741.162Spookafile	src/lib/libpthread/pthread_types.h	: 1.17
3751.160Spookapr	lib/49989
3761.160Spookadescr
3771.160Spooka	Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER
3781.160Spooka	in C++ results in:
3791.160Spooka		error: temporary of non-literal type '__pthread_mutex_st'
3801.160Spooka		in a constant expression
3811.160Spooka		constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
3821.160Spooka		[...]
3831.160Spooka		include/pthread_types.h:101:8: note: '__pthread_mutex_st' is
3841.160Spooka		not literal because:
3851.160Spooka		struct __pthread_mutex_st {
3861.160Spooka		^
3871.160Spooka		include/pthread_types.h:103:17: note:   non-static data
3881.160Spooka		member '__pthread_mutex_st::ptm_errorcheck' has volatile type
3891.160Spooka		pthread_spin_t ptm_errorcheck;
3901.160Spookakcah
3911.160Spooka
3921.163Schristoshack	libm cabs{,f,l} and g++
3931.163Schristoscdata	11 Jan 2016
3941.163Schristoswho	christos
3951.163Schristospr	lib/50646
3961.163Schristosfile	src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2
3971.163Schristosfile	src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2
3981.163Schristosdescr
3991.163Schristos	Our cabs and cabsf have a different argument format on some architectures
4001.163Schristos	and for that we have created in libm/compat_cabs{,f}.c. The standard
4011.163Schristos	versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in
4021.163Schristos	<complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they
4031.163Schristos	translate by default to cabs{,f,l} which gets defined to cabs{,f} (the
4041.163Schristos	wrong function) and an undefined cabsl. I've changed <complex> to use
4051.163Schristos	the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is
4061.163Schristos	still broken.
4071.163Schristoskcah
4081.163Schristos
4091.21Smycroftport	vax
4101.21Smycroft
4111.102Stsutsui	hack	gcc4/vax ICE
4121.102Stsutsui	cdate	
4131.102Stsutsui	who	tsutsui
4141.102Stsutsui	file	sys/arch/vax/conf/Makefile.vax
4151.102Stsutsui	descr
4161.102Stsutsui		GCC4 on vax gets ICE on compiling sys/ddb/db_command.c.
4171.102Stsutsui		-fno-tree-ter prevents it so add it to COPTS.
4181.102Stsutsui	kcah
4191.102Stsutsui
4201.81Smrg	hack	gcc4/vax compiler crash
4211.81Smrg	cdate	Fri Jun 30 22:39:12 PDT 2006
4221.81Smrg	who	mrg
4231.81Smrg	file	bin/csh/Makefile	: 1.27
4241.81Smrg	file	lib/i18n_module/UTF7/Makefile	: 1.2
4251.81Smrg	descr
4261.81Smrg		GCC4 on vax crashes.  -O0 stops it happening so far...
4271.81Smrg	kcah
4281.81Smrg
4291.54She	hack	declare boolean_t in two IPF user-mode programs
4301.54She	cdate	Tue Mar  7 19:19:20 CET 2006
4311.54She	who	he
4321.54She	file	dist/ipf/ipsend/iptests.c : 1.8
4331.54She		dist/ipf/ipsend/sock.c : 1.7
4341.54She	descr
4351.54She		The IPF user-mode programs ipsend and iptest first
4361.54She		include <sys/types.h> without _KERNEL defined, and
4371.54She		later include <sys/file.h> with _KERNEL defined.
4381.54She		This causes a build failure when building for vax,
4391.54She		since <sys/device.h> ends up being included without
4401.54She		bollean_t being defined by <sys/types.h>.
4411.54She		Build failure and further details documented in
4421.54She		PR#32907.
4431.54She	kcah
4441.54She
4451.104Sgmcgarry	hack	pcc 0.9.9 large string literals
4461.104Sgmcgarry	cdat	8 July 2008
4471.104Sgmcgarry	who	gmcgarry
4481.104Sgmcgarry	file	sys/conf/param.c : 1.58
4491.104Sgmcgarry	descr
4501.104Sgmcgarry		Workaround for pcc 0.9.9 not handling large string literals
4511.104Sgmcgarry		which causes kernels with 'options INCLUDE_CONFIG_FILE' to
4521.104Sgmcgarry		fail compilation.
4531.104Sgmcgarry		There is a proposal on the pcc mailing list to stuff config
4541.104Sgmcgarry		file in ELF section.
4551.104Sgmcgarry	kcah
4561.104Sgmcgarry
4571.107Smrg	hack	xorg warnings
4581.129Schristos	cdat	30 July 2008, 3 June, 2013
4591.107Smrg	who	mrg
4601.108Smrg	file	external/mit/xorg/lib/libSM/Makefile : 1.2
4611.129Schristos		external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10
4621.107Smrg		external/mit/xorg/lib/libXext/Makefile : 1.2
4631.107Smrg		external/mit/xorg/lib/libXfont/Makefile : 1.2
4641.107Smrg	descr
4651.107Smrg		Disable several warnings or use -Wno-error across Xorg sources
4661.107Smrg		while we get them working
4671.107Smrg	kcah
4681.107Smrg
4691.112Schristos	hack	32 bit time leftovers
4701.112Schristos	cdat	11 January 2009
4711.112Schristos	who	christos
4721.112Schristos	file	lib/libc/time/localtime.c : 1.41
4731.112Schristos		lib/libc/time/zic.c : 1.23
4741.112Schristos	descr
4751.112Schristos		The timezone compiled files still contain 32 bit time_t
4761.112Schristos		quantities. I did not want to version the files because
4771.112Schristos		the ``parser'' is too ugly for words. What needs to be
4781.112Schristos		done, is to rewrite the parser from scratch also to avoid
4791.112Schristos		potential core-dumps from parsing invalid files.
4801.112Schristos	kcah
4811.112Schristos
4821.112Schristos	hack	32 bit time leftovers
4831.112Schristos	cdat	11 January 2009
4841.112Schristos	who	christos
4851.112Schristos	file	various
4861.112Schristos	descr
4871.113Ssketch		Many filesystem on-disk formats have 32 bit times.
4881.112Schristos	kcah
4891.112Schristos
4901.141Schristos	hack	gcc 4.5 fsdb miscompile
4911.140Schristos	date	Sat Nov  9 11:03:02 EST 2013
4921.140Schristos	who	christos
4931.141Schristos	file	src/sbin/fsdb/Makefile : 1.36 (and earlier)
4941.140Schristos	descr
4951.140Schristos		src/sbin/fsdb/fsdb.c: In function 'findblk':
4961.140Schristos		src/sbin/fsdb/fsdb.c:610:1: error: unrecognizable insn:
4971.140Schristos		(insn 941 940 942 134 src/sbin/fsdb/fsdb.c:589 (set (reg:SI 604)
4981.140Schristos		    (subreg:SI (mem/s/j:DI (plus:SI (mult:SI (reg:SI 602)
4991.140Schristos                        (const_int 8 [0x8]))
5001.140Schristos                    (reg/f:SI 601)) [0 curinode.99_378->dp2.di_ib S8 A32]) 4)) \
5011.140Schristos			-1 (nil))
5021.140Schristos		src/sbin/fsdb/fsdb.c:610:1: internal compiler error: in \
5031.140Schristos		extract_insn, at recog.c:2103
5041.140Schristos	kcah
5051.140Schristos
5061.141Schristos	hack	gcc 4.8 gcc miscompiles
5071.141Schristos	date	Sat Nov  9 16:35:18 EST 2013
5081.141Schristos	who	christos
5091.141Schristos	file	distrib/utils/x_ping/Makefile
5101.141Schristos	file	distrib/vax/miniroot/Makefile.inc
5111.141Schristos	file	distrib/vax/ramdisk/Makefile
5121.141Schristos	file	external/gpl3/gdb/lib/libdecnumber/Makefile
5131.141Schristos	file	sbin/fsdb/Makefile
5141.141Schristos	file	sbin/newfs_ext2fs/Makefile
5151.141Schristos	file	sbin/ping/Makefile
5161.141Schristos	file	usr.sbin/lmcconfig/Makefile
5171.141Schristos	file	usr.sbin/mtrace/Makefile
5181.141Schristos	descr
5191.141Schristos		external/gpl3/gcc/dist/gcc/expmed.c:2781:1:
5201.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5211.141Schristos		external/gpl3/gcc/dist/gcc/recog.c:770:1:
5221.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5231.141Schristos		external/gpl3/gcc/dist/libdecnumber/decNumber.c:7214:3:
5241.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5251.141Schristos		sbin/ping/ping.c:679:1:
5261.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5271.141Schristos		sbin/newfs_ext2fs/mke2fs.c:681:1:
5281.141Schristos		internal compiler error: in reload_combine_note_use,
5291.141Schristos		at postreload.c:1561
5301.141Schristos		external/gpl3/gdb/dist/libdecnumber/decNumber.c:7214:3:
5311.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5321.141Schristos		usr.sbin/lmcconfig/lmcconfig.c:939:3:
5331.141Schristos		internal compiler error: in reload_combine_note_use,
5341.141Schristos		at postreload.c:1561
5351.141Schristos		usr.sbin/mtrace/mtrace.c:1655:1:
5361.141Schristos		internal compiler error: in change_address_1, at emit-rtl.c:2019
5371.141Schristos	kcah
5381.141Schristos
5391.178Srin	hack	gcc 5.4 cc1 miscompile
5401.178Srin	date	Tue Feb 14 07:19:57 JST 2017
5411.178Srin	who	rin
5421.178Srin	pr	port-vax/51967
5431.178Srin	file	external/gpl3/gcc/usr.bin/backend/Makefile : 1.35
5441.178Srin	descr
5451.178Srin		cc1 aborts due to SIGILL when compiling the sample code attached
5461.178Srin		to the PR. As a workaround, compile dse.c with -O0.
5471.178Srin	kcah
5481.178Srin
5491.179Srin	hack	libssh miscompile
5501.182Srin	cdate	Tue Feb 14 17:58:06 JST 2017
5511.182Srin	mdate	Tue Feb 14 18:57:39 JST 2017
5521.179Srin	who	rin
5531.179Srin	file	crypto/external/bsd/openssh/lib/Makefile : 1.20
5541.179Srin	descr
5551.182Srin		poly1305.c and umac.c are miscompiled, which results in login
5561.182Srin		failure to/from external hosts via ssh.
5571.179Srin	kcah
5581.179Srin
5591.180Srin	hack	mandoc miscompile
5601.180Srin	date	Tue Feb 14 18:03:05 JST 2017
5611.180Srin	who	rin
5621.180Srin	file	external/bsd/mdocml/lib/libmandoc/Makefile : 1.8
5631.180Srin	descr
5641.180Srin		mandoc(1) receives SIGILL in in_line_argn() from mdoc_macro.c.
5651.180Srin	kcah
5661.180Srin
5671.183Srin	hack	libX11 miscompile
5681.183Srin	date	Thu Feb 16 10:00:22 JST 2017
5691.183Srin	who	rin
5701.183Srin	file	src/external/mit/xorg/lib/libX11/Makefile.libx11 : 1.18
5711.183Srin	descr
5721.183Srin		lcWrap.c is miscompiled, which results in input failure via XIM.
5731.184Srin		Besides, some clients, e.g., pkgsrc/x11/kterm, receive SIGSEGV.
5741.183Srin	kcah
5751.183Srin
5761.21Smycroftport	arm
5771.21Smycroft
5781.21Smycroft	hack	gcc-unsigned-compare
5791.21Smycroft	cdate	09 Mar 2002
5801.21Smycroft	mdate	18 Mar 2002
5811.21Smycroft	who	bjh21
5821.21Smycroft	file	dist/bind/lib/nameser/ns_parse.c : 1.3
5831.21Smycroft	file	dist/dhcp/minires/ns_parse.c : 1.3
5841.21Smycroft	file	dist/dhcp/omapip/result.c : 1.2
5851.21Smycroft	file	dist/dhcp/server/failover.c : 1.3
5861.21Smycroft	file	gnu/dist/toolchain/bfd/bfd.c : 1.2
5871.21Smycroft	file	gnu/dist/toolchain/bfd/format.c : 1.2
5881.21Smycroft	file	gnu/dist/toolchain/gdb/target.c : 1.2
5891.21Smycroft	file	sys/kern/vfs_subr.c : 1.172
5901.21Smycroft	descr	When checking that a potentially-unsigned enum is >= 0, assign
5911.21Smycroft		it to an int first.  This is necessary to avoid "comparison is
5921.21Smycroft		always true" warnings with -fshort-enums.  Casting to an int
5931.21Smycroft		really should be enough, but turns out not to be.
5941.21Smycroft	kcah
5951.21Smycroft
5961.122Stsutsui	hack	gcc-4.5 arm CNAME hostname lookup failure on
5971.122Stsutsui		certain DNS environment (probably -ftree-ter problem)
5981.122Stsutsui	cdate	Sat Dec 24 04:59:00 UTC 2011
5991.122Stsutsui	mdate	
6001.122Stsutsui	who	tsutsui
6011.122Stsutsui	file	lib/libc/net/Makefile.inc 1.79
6021.122Stsutsui	descr	Hostname lookup against CNAMEs by some commands fails
6031.122Stsutsui		on certain DNS environments if lib/libc/net/gethnamaddr.c
6041.122Stsutsui		(ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc)
6051.122Stsutsui		are compiled with -O2, even though nslookup(1) against
6061.122Stsutsui		the same CNAME returns proper hostname.
6071.122Stsutsui		They works properly if compiled with -O2 -fno-tree-ter.
6081.122Stsutsui		Also -O2 fails but -O2 -fno-tree-ter works on the following
6091.122Stsutsui		test case in gcc bugzilla:
6101.122Stsutsui		http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4
6111.122Stsutsui	kcah
6121.122Stsutsui
6131.124Smsaitoh	hack	gcc-4.5 arm without -fno-tree-vrp generate broken code
6141.124Smsaitoh	cdate	Wed Nov 14 13:02:02 JST 2012
6151.124Smsaitoh	who	msaitoh
6161.124Smsaitoh	file	lib/libc/softfloat/Makefile.inc
6171.124Smsaitoh	pr	46953
6181.124Smsaitoh	regress	src/tests/lib/libm/t_cbrt
6191.124Smsaitoh	regress	src/tests/lib/libm/t_ceil
6201.124Smsaitoh	regress	src/tests/lib/libm/t_exp
6211.124Smsaitoh	regress	src/tests/lib/libm/t_log
6221.124Smsaitoh	regress	src/tests/lib/libm/t_scalbn
6231.124Smsaitoh	regress	src/tests/lib/libm/t_sinh
6241.124Smsaitoh	regress	src/tests/lib/libm/t_sqrt
6251.124Smsaitoh	descr	Gcc has a bug in tree optimization. For adddf3,
6261.124Smsaitoh		-INF + -INF returns 0 without -fno-tree-vrp.
6271.124Smsaitoh		Debugging with -fdump-tree-all shows that
6281.124Smsaitoh		softfloat.c.021t.cleanup_cfg is ok but softfloat.c.023t.ssa
6291.124Smsaitoh		is broken.
6301.124Smsaitoh	kcah
6311.21Smycroft
6321.21Smycroftport	sh3
6331.21Smycroft
6341.74Smrg	hack	gcc4-sh3-bz2
6351.103Stsutsui	cdate	Sun May 21 03:34:57 UTC 2006
6361.103Stsutsui	mdate	Fri May 16 13:13:00 UTC 2008
6371.103Stsutsui	who	mrg, tsutsui
6381.74Smrg	file	lib/libbz2/Makefile	: 1.10
6391.74Smrg	descr
6401.74Smrg		The in-tree GCC 4.1-based compiler generated too-far
6411.103Stsutsui		pc-relative addresses.  Hack is to build with
6421.103Stsutsui		-fno-loop-optimize.
6431.74Smrg	kcah
6441.74Smrg
6451.96Smrgport	m68000
6461.79Smrg
6471.96Smrg	hack	gcc4-m68000
6481.102Stsutsui	cdate	Fri Feb  8 10:29:37 PST 2008
6491.102Stsutsui	mdate	Sun May  4 15:37:19 UTC 2008
6501.99Stsutsui	who	mrg, tsutsui
6511.96Smrg	file	rescue/Makefile	: 1.21
6521.99Stsutsui	file	sbin/dump_lfs/Makefile	: 1.9
6531.101Stsutsui	file	sbin/fsck_ffs/Makefile	: 1.35
6541.101Stsutsui	file	sbin/fsdb/Makefile	: 1.22
6551.101Stsutsui	file	share/mk/sys.mk	: 1.96
6561.99Stsutsui	file	usr.sbin/ndbootd/Makefile	: 1.5
6571.95Smrg	descr
6581.101Stsutsui		Several internal compiler errors with gcc -O1
6591.101Stsutsui		around 64bit integer arithmetic.
6601.99Stsutsui		This hack uses -O1 and adds some -fno-tree-foo options
6611.99Stsutsui		to avoid the problem.
6621.101Stsutsui		This might be related with GCC Bugzilla Bug 32424.
6631.95Smrg	kcah
6641.95Smrg
6651.141Schristosport	m68k,sh3,vax
6661.135Schristos
6671.135Schristos	hack	gcc-4.8.1
6681.135Schristos	cdate	Wed Nov  6 20:41:35 EST 2013
6691.135Schristos	who	christos
6701.141Schristos	file	src/external/gpl3/gcc/libstdc++-v3/Makefile : 1.6
6711.135Schristos	descr
6721.135Schristos		compile hashtable_c++0x.cc with -O2 instead of -Os to
6731.135Schristos		produce missing instantiation of std::lower_bound expansion
6741.135Schristos		for unsigned long.
6751.135Schristos	kcah
6761.22Smrg
6771.116Smrgport	sparc
6781.116Smrg
6791.116Smrg	hack	avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3
6801.116Smrg	cdate	Sun Aug 14 19:26:48 PDT 2011
6811.116Smrg	who	mrg
6821.116Smrg	file	sys/arch/sparc64/sparc/cpu.c : 1.234
6831.116Smrg	file	sys/arch/sparc64/sparc/cpuvar.h : 1.90
6841.116Smrg	file	sys/arch/sparc64/sparc/genassym.cf : 1.67
6851.116Smrg	file	sys/arch/sparc64/sparc/locore.s : 1.265
6861.116Smrg	descr
6871.116Smrg		Something is wrong with GCC 4.5.3 and the savefpstate IPI.
6881.116Smrg		Post newlock2 there was a bug where a lock was reduced from
6891.116Smrg		IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI
6901.116Smrg		would crash due to NULL IPI.  This was fixed by re-using the
6911.116Smrg		right IPL value.  However, GCC 4.5.3 build kernels have the
6921.116Smrg		same problems.  For now, the hack is re-instated.
6931.116Smrg	kcah
6941.116Smrg
6951.116Smrg
6961.51Ssimonbport	mips
6971.51Ssimonb
6981.51Ssimonb	hack	mips-shared-linker-load-address
6991.51Ssimonb	cdate	Fri Oct  7 08:33:10 UTC 2005
7001.51Ssimonb	who	simonb
7011.51Ssimonb	file	src/sys/kern/exec_elf32.c : 1.107
7021.51Ssimonb	descr
7031.51Ssimonb		With COMPAT_16 or previous enabled (which enables
7041.51Ssimonb		ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will
7051.51Ssimonb		load and run at address 0.  The check to fix this in
7061.51Ssimonb		rev 1.107 only checks the first psection of the ELF
7071.51Ssimonb		executable, which may not be loadable.  A more correct
7081.51Ssimonb		fix is to check the first loadable psection instead of
7091.51Ssimonb		just the first psection.
7101.51Ssimonb	kcah
7111.54She
7121.85Smartin	hack	mips-duplicate-ras-end-label
7131.85Smartin	cdate	Sat Sep  2 23:29:42 2006
7141.85Smartin	who	martin
7151.92Schs	file	src/regress/sys/kern/ras/ras3/Makefile : 1.3
7161.85Smartin	descr
7171.85Smartin		Add -fno-reorder-blocks to CFLAGS to avoid duplicate
7181.85Smartin		labels by duplicated __asm output from RAS_END()
7191.85Smartin		macro.
7201.85Smartin	kcah
7211.85Smartin
7221.106Slukem	hack	mips-mcount-assembler-warning
7231.106Slukem	cdate	Tue Jul 29 14:16:52 UTC 2008
7241.106Slukem	who	lukem
7251.106Slukem	file	src/lib/libc/gmon/Makefile.inc : 1.8
7261.106Slukem	descr
7271.106Slukem		Workaround for PR port-mips/39192.
7281.106Slukem		common/lib/libc/gmon/mcount.c generates a (fatal)
7291.106Slukem		assembler warning on MIPS:
7301.106Slukem			Warning: No .cprestore pseudo-op used in PIC code
7311.106Slukem		Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings
7321.106Slukem	kcah
7331.106Slukem
7341.82Schristosport	i386
7351.82Schristos
7361.84Sdrochner	hack	use volatile intermediate variable to enforce rounding
7371.84Sdrochner	cdate	Tue Aug  1 22:15:55 MEST 2006
7381.84Sdrochner	who	drochner
7391.84Sdrochner	file	src/lib/libm/src/lrintf.c : 1.4
7401.84Sdrochner	file	src/lib/libm/src/s_rintf.c : 1.8
7411.84Sdrochner	descr
7421.84Sdrochner		gcc-4 does subsequent operations on "float" values within
7431.84Sdrochner		the i387 FPU without rounding the intermediate results
7441.84Sdrochner	kcah
7451.110Smacallan
7461.148Schristosport	x86
7471.148Schristos	hack	turn off optimization for biosdisk_ll.c because otherwise
7481.148Schristos		we are pass the wrong arguments to biosdisk_read(). 
7491.148Schristos		$ cd /usr/src/sys/arch/i386/floppies/bootflopp-com
7501.148Schristos		$ qemu-system-i386 -nographic -fda boot-com1.fs -boot a
7511.148Schristos	who	christos
7521.148Schristos	file	src/sys/arch/i386/stand/lib/Makefile : 1.38
7531.148Schristos	descr
7541.148Schristos		Turning on DISK_DEBUG shows the problem. We should find
7551.148Schristos		out which option is causing this.
7561.148Schristos	hcah
7571.148Schristos
7581.110Smacallanport	powerpc
7591.110Smacallan
7601.110Smacallan	hack	avoid using __builtin_return_address(0) because it fails in
7611.110Smacallan		Xorg's module loader
7621.110Smacallan	cdate	Sat Sep 27 03:52:05 UTC 2008
7631.110Smacallan	who	macallan
7641.110Smacallan	file	src/libexec/ld.elf_so/rtld.c : 1.121
7651.110Smacallan	descr
7661.110Smacallan		workaround for PR port-macppc/37812
7671.110Smacallan	kcah
7681.110Smacallan
7691.115Smatt	hack	define TARGET_SECURE_PLT and HAVE_AS_TLS because when
7701.115Smatt		building the native compiler via build.sh those don't defined
7711.115Smatt		properly.
7721.115Smatt	cdate	Sat Mar 12 08:00:00 UTC 2011
7731.115Smatt	who	matt
7741.115Smatt	file	src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h
7751.115Smatt	descr
7761.115Smatt		see above
7771.115Smatt	kcah
7781.117Schristos
7791.117Schristosport	powerpc64
7801.117Schristos
7811.117Schristos	hack	include _errno.c in libposix so that __errno resolves. It
7821.117Schristos		should resolve from libc's errno, but somehow it does not.
7831.117Schristos		Linker bug?
7841.117Schristos	cdate	Thu Oct 27 13:19:47 EDT 2011
7851.117Schristos	who	christos
7861.117Schristos	file	src/lib/libposix/Makefile: 1.15
7871.118Schristos	file	src/lib/librt/Makefile: 1.14
7881.117Schristos	descr
7891.117Schristos		workaround for:
7901.117Schristos		    libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \
7911.117Schristos		    R_PPC64_REL24 relocation against symbol `.__errno'
7921.117Schristos	kcah
7931.119Schristos
7941.119Schristos	hack	rename data() function in mdocml to avoid redefined error.
7951.119Schristos		Compiler/Assembler bug?
7961.119Schristos	cdate	Sat Oct 29 11:16:01 EDT 2011
7971.119Schristos	who	christos
7981.119Schristos	file	src/external/bsd/mdocml/tbl_data.c: 1.2
7991.119Schristos	descr
8001.119Schristos		workaround for:
8011.119Schristos		    {standard input}: Assembler messages:
8021.119Schristos		    {standard input}:105: Error: symbol `.data' is already \
8031.119Schristos		    defined
8041.119Schristos	kcah
8051.120Schristos
8061.120Schristosport	emips
8071.120Schristos
8081.120Schristos	hack	Add nop between ctc1 and mtc0 to avoid assembler internal
8091.120Schristos		error
8101.120Schristos	cdate	Sat Oct 29 16:57:34 EDT 2011
8111.120Schristos	who	christos
8121.120Schristos	file	src/sys/arch/mips/mips/mips_fpu.c: 1.7
8131.120Schristos	descr
8141.120Schristos		workaround for:
8151.120Schristos		    {standard input}: Assembler messages:
8161.120Schristos		    {standard input}:730: Internal error!
8171.120Schristos		    Assertion failure in append_insn at /usr/src/external/gpl3/\
8181.120Schristos		    binutils/dist/gas/config/tc-mips.c line 2910.
8191.120Schristos	kcah
8201.125Smartin
8211.125Smartinport	ia64
8221.125Smartin
8231.157Smartin	hack	libgcc unwind dummy function
8241.157Smartin	cdate	Fri Apr 17 14:31:03 CEST 2015
8251.157Smartin	who	martin
8261.157Smartin	file	src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4
8271.157Smartin	descr
8281.157Smartin		Add an empty _Unwind_FindTableEntry() implementation.
8291.157Smartin		In the end we will use our libc stuff, and this should
8301.157Smartin		go away again.
8311.157Smartin	kcah
8321.157Smartin
8331.128Schristosport	x68k
8341.127Smartin
8351.128Schristos	hack	compiler error with gcc 4.5.x
8361.128Schristos	cdate	Fri May 24 13:23:01 EDT 2013
8371.128Schristos	who	christos
8381.128Schristos	file	src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17
8391.128Schristos		xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11
8401.128Schristos	descr
8411.128Schristos		workaround for:
8421.128Schristos		internal compiler error: in cselib_record_set, at cselib.c:1999
8431.128Schristos	kcah
8441.130Sjoerg
8451.130Sjoerghack	fallback to /usr/bin/clang-cpp in rpcgen
8461.130Sjoergcdate	Wed Jun  5 15:49:27 CEST 2013
8471.130Sjoergwho	joerg
8481.130Sjoergfile	src/usr.bin/rpcgen/rpc_main.c
8491.130Sjoergdescr
8501.136Sjoerg	It is undecided which compiler owns /usr/bin/cpp and whether it should
8511.130Sjoerg	exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box,
8521.130Sjoerg	if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback.
8531.130Sjoerg	This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable.
8541.130Sjoergkcah
8551.131Sskrll
8561.155Sskrllport	hppa
8571.131Sskrll
8581.131Sskrll	hack	compiler error with gcc 4.5.x
8591.131Sskrll	cdate	Tue Jul 23 07:42:28 BST 2013
8601.131Sskrll	who	skrll
8611.133Sskrll	file	src/sys/lib/libkern/Makefile.libkern: 1.26
8621.133Sskrll	descr
8631.133Sskrll		workaround for unanalysed codegen bug affecting md5c.c.
8641.133Sskrll	kcah
8651.149Smacallan
8661.155Sskrll	hack	gdb vs _rtld_debug_state problem
8671.155Sskrll	cdate	Thu Mar  5 09:49:53 UTC 2015
8681.155Sskrll	who	skrll
8691.155Sskrll	file	src/libexec/ld.elf_so/rtld.c: 1.175
8701.155Sskrll	descr
8711.155Sskrll		workaround for problem where gdb misses the breakpoint on
8721.155Sskrll		_rtld_debug_state when the function is only the
8731.155Sskrll		bv,n %r0(%rp) instruction - the nullify seems to
8741.155Sskrll		confuse something
8751.155Sskrll	kcah
8761.155Sskrll
8771.149Smacallanport	mips64*
8781.149Smacallanhack	compiler crashes on mips64* with optimization enabled
8791.149Smacallancdate	Tue May 13 18:46:48 UTC 2014
8801.149Smacallanwho	macallan
8811.149Smacallanfile	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6
8821.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5
8831.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6
8841.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5
8851.149Smacallandescr	workaround for n32 gcc doing unaligned 64bit accesses when optimizing
8861.149Smacallanpr	48696
8871.149Smacallankcah
8881.150Smartin
8891.150Smartinport	vax
8901.150Smartinhack	compile boot with -O1
8911.150Smartincdate	Sat May 24 09:40:58 CEST 2014
8921.150Smartinwho	martin
8931.150Smartinfile	src/sys/arch/vax/boot/boot/Makefile: 1.41
8941.150Smartindescr	/boot does not work when compiled with -O2 and gcc 4.8
8951.150Smartinkcah
8961.150Smartin
8971.191Schristosport	vax
8981.191Schristoshack	compile nir.c in gallium with -O1
8991.191Schristoscdate	Mon Oct 28 14:39:35 EDT 2019
9001.191Schristoswho	christos
9011.191Schristosfile	/cvsroot/src/external/mit/xorg/lib/gallium/Makefile 1.36
9021.191Schristosdescr	gallium does not compile.
9031.191Schristoskcah
9041.191Schristos
9051.192Schristosport	aarch64
9061.192Schristoshack	compile ex_filter.c in vi with -O0
9071.192Schristoscdate	Mon Oct 28 14:39:35 EDT 2019
9081.192Schristoswho	christos
9091.192Schristosfile	/cvsroot/src/external/bsd/nvi/usr.bin/nvi/Makefile 1.20
9101.192Schristosdescr	":%! sort" core-dumps, tm is NULL but was not NULL on entry.
9111.192Schristoskcah
9121.192Schristos
9131.193Schristosport	sh3
9141.193Schristoshack	compile parse.c in battlestar with -Wno-restrict
9151.193Schristoscdate	Mon Oct 28 14:39:35 EDT 2019
9161.193Schristoswho	christos
9171.193Schristosfile	/cvsroot/src/games/battlestar/Makefile 1.11
9181.193Schristosdescr	fails to compile, confused by char words[][];
9191.193Schristos	strcpy(words[n - 1], words[n + 1]);
9201.193Schristoskcah
9211.193Schristos
9221.194Schristosport	sh3
9231.194Schristoshack	compile ddns.c in dhcpcd with no-stringop-overflow
9241.194Schristoscdate	Tue Oct 29 20:25:59 EDT 2019
9251.194Schristoswho	christos
9261.194Schristosfile	/cvsroot/src/external/mpl/dhcp/bin/server/Makefile 1.2
9271.194Schristosdescr	fails to compile, confused by builtin_object_size in strcat(p, ".in..")
9281.194Schristoskcah
9291.194Schristos
9301.156Smattport	arm
9311.156Smatthack	avoid using labels in a 12-bit constant.
9321.156Smattwho	matt
9331.156Smattfile	crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2
9341.156Smattdescr	workaround for clang misassembling an instruction
9351.156Smattkcah
9361.177Schristos
9371.177Schristosport	sparc64
9381.177Schristoshack	during profiling with -m32 (and ASLR) labels are not generated
9391.177Schristos	consistently
9401.177Schristoswho	christos
9411.177Schristosfile	/cvsroot/src/crypto/external/bsd/heimdal/lib/libasn1/Makefile: 1.4
9421.177Schristosdesc 	asn1_krb5_asn1.po does not produce the same results during successive
9431.177Schristos	compilation runs; it is bimodal. Turning optimization to -O0 fixes
9441.177Schristos	the issue
9451.177Schristoskcah
9461.187Sscole
9471.187Sscoleport	ia64
9481.187Sscolehack	ski emulator crashes
9491.187Sscolewho	scole
9501.187Sscolefile	/cvsroot/src/sys/external/bsd/acpica/dist/tables/tbxfload.c: 1.6
9511.187Sscoledesc
9521.187Sscole	ski emulator crashes during acpi detection.  Added a check for
9531.187Sscole	uninitialized index.  Submitted a request for change with upstream
9541.187Sscole	mailing list, but never got a response
9551.187Sscolekcah
9561.189Schristos
9571.189Schristosport	vax
9581.189Schristoshack	compile rtld.c with -O0
9591.189Schristoscdate	Wed Apr  3 17:38:38 EDT 2019
9601.189Schristoswho	christos
9611.189Schristosfile	src/libexec/ld.elf_so/Makefile: 1.141
9621.189Schristosdescr	Disable optimization for rtld.c on the vax with gcc-7. Crashes on the
9631.189Schristos	second pass loop with elm == 0xffffffff
9641.189Schristoskcah
965