HACKS revision 1.249
11.249Srin# $NetBSD: HACKS,v 1.249 2025/04/13 08:19:13 rin 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.207Smaxvhack	llvm needs no-unused-command-line-argument
311.207Smaxvmdate	10 May 2020
321.207Smaxvwho	maxv
331.207Smaxvfile	share/mk/bsd.lib.mk 1.380 -> 1.381
341.207Smaxvdescr
351.207Smaxv	To avoid LLVM warnings when compiling the kernel with special
361.207Smaxv	CFLAGS such as KASAN on amd64 or ARMV83_PAC on aarch64, pass
371.207Smaxv	-Wno-unused-command-line-argument.
381.207Smaxvkcah
391.207Smaxv
401.190Smayahack	static linking with libpthread
411.190Smayamdate	7 May 2019
421.190Smayawho	maya
431.209Schristosfile	src/lib/libpthread/Makefile 1.92 -> 1.94
441.190Smayadescr
451.190Smaya	To avoid some libc thread stub functions being picked up
461.190Smaya	in static builds, link pthread as one section.
471.190Smayakcah
481.190Smaya
491.209Schristoshack	disable optimization for gcc-9.3 in src/lib/libc/gdtoa/strtod.c
501.209Schristosmdate	18 Sep 2020
511.209Schristoswho	christos
521.209Schristosfile    src/lib/libc/gdtoa/strtod.c 1.15 -> 1.16
531.209Schristosdescr
541.209Schristos	See PR/55668, the program there causes infinite loop
551.209Schristoskcah
561.209Schristos
571.166Schristoshack	gcc-5.3 optimizes memset+malloc -> calloc inside calloc
581.166Schristosmdate	4 May 2016
591.166Schristoswho	christos
601.166Schristosfile	external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5
611.166Schristosdescr
621.166Schristos	resulting in infinite recursion; we prevent this with
631.166Schristos	-fno-builtin-malloc
641.166Schristoskcah
651.166Schristos
661.167Smrghack	turn off tree-vrp for parts of ufs_lookup.c
671.167Smrgmdate	28 April 2016
681.167Smrgwho	mrg christos
691.167Smrgfile	src/sys/ufs/ufs/ufs_lookup.c : 1.144
701.167Smrgpr	51094
711.167Smrgdescr
721.167Smrg	with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir
731.167Smrg	panicks are see.
741.167Smrghcah
751.167Smrg
761.1Slukemhack	netstat ieee1394 address printing.
771.1Slukemmdate	14 Nov 2000
781.1Slukemwho	matt
791.1Slukemfile	lib/libc/net/getnameinfo.c	: 1.32 : 497 : 503
801.1Slukemdescr
811.1Slukem	Because the current implementation of IP over IEEE1394, the
821.1Slukem	fw device address contains more than just the IEEE1394 EUI-64.
831.1Slukem	So when printing out IEEE1394 addresses, ignore the extra stuff.
841.1Slukemkcah
851.1Slukem
861.1Slukemhack	xterm vs. libterm
871.1Slukemmdate	01 Aug 2000
881.1Slukemwho	jdc
891.1Slukemfile	xsrc/xc/programs/xterm/main.c	: 1.2 : 3609 : 3614
901.1Slukempr	10383
911.1Slukemdescr
921.1Slukem	In order to extend the termcap string over 1023 bytes, a ZZ entry was
931.1Slukem	introduced to point to a memory location containing the full entry.
941.1Slukem	Without this hack, xterm will export a termcap containing the ZZ
951.1Slukem	entry, which will then be ignored by libterm.  As xterm modifies the
961.1Slukem	exported termcap, this would cause those modifications to be ignored.
971.1Slukemkcah
981.1Slukem
991.1Slukemhack	wi-at-big-endian-bus
1001.1Slukemcdate	15 Mar 2002
1011.1Slukemwho	martin
1021.203Srinfile	dev/ic/wireg.h : 1.20
1031.1Slukemdescr	Add an option to access the underlying bus in big endian byte order
1041.1Slukem	to work around deficiencies in bus_space_{read,write}_* macros.
1051.1Slukem	Those don't allow the implementation of a proper pcmcia bus space
1061.1Slukem	tag.
1071.1Slukemkcah
1081.1Slukem
1091.3Sjdchack	specific knowledge of colours in curses code
1101.3Sjdccdate	Sun Apr  6 11:05:24 BST 2003
1111.3Sjdcwho	jdc
1121.3Sjdcfile	lib/libcurses/color.c : r1.24
1131.3Sjdcdescr
1141.3Sjdc	Swap red/blue and yellow/cyan colours for COLOR_OTHER.
1151.3Sjdc	Fix is to enhance libtermcap to understand terminfo-style % sequences.
1161.3Sjdc	See also:
1171.5Ssalo	    http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html
1181.4Sscwkcah
1191.4Sscw
1201.7Shehack	Compensation for differing types of LINUX_USRSTACK and USRSTACK
1211.7Shecdate	21 Aug 2003
1221.7Shewho	he
1231.7Shefile	sys/miscfs/procfs/procfs_linux.c : 1.14
1241.7Shedescr
1251.7She	Not all ports have LINUX_USRSTACK and/or USRSTACK defined as
1261.7She	literals/constants, but refer to variables of a type which is
1271.7She	not "unsigned long", causing compilation of procfs_linux.c to
1281.7She	fail with "makes integer from pointer without a cast".  This
1291.7She	is observed on e.g. the sun3 port.  Ideally the "types" for
1301.7She	symbols should be consistent across all ports.
1311.25Smrgkcah
1321.25Smrg
1331.80Stsutsuihack	gcc4 wrong uninitialized variable
1341.58Smrgmdate	10 May 2006
1351.58Smrgwho	mrg
1361.58Smrgfile	bin/ksh/eval.c			: 1.6
1371.58Smrgfile	bin/sh/histedit.c		: 1.39
1381.58Smrgfile	bin/sh/parser.c			: 1.60
1391.58Smrgfile	crypto/dist/heimdal/kdc/524.c	: 1.10
1401.58Smrgfile	crypto/dist/ssh/sftp.c		: 1.20
1411.58Smrgfile	crypto/dist/ssh/ssh-keysign.c	: 1.11
1421.58Smrgfile	dist/ipf/lib/hostname.c		: 1.2
1431.58Smrgfile	dist/ipf/tools/ipmon.c		: 1.8
1441.72Smrgfile	dist/ntp/ntpd/ntp_request.c	: 1.4
1451.58Smrgfile	dist/ntp/ntpd/refclock_shm.c	: 1.4
1461.58Smrgfile	dist/ntp/sntp/timing.c		: 1.3
1471.58Smrgfile	dist/pppd/pppstats/pppstats.c	: 1.3
1481.58Smrgfile	dist/tcpdump/print-zephyr.c	: 1.5
1491.68Smrgfile	distrib/utils/sysinst/aout2elf.c : 1.12
1501.58Smrgfile	gnu/libexec/uucp/uucico/uucico.c : 1.6
1511.58Smrgfile	lib/libc/citrus/citrus_csmapper.c : 1.6
1521.58Smrgfile	lib/libc/citrus/citrus_pivot_factory.c : 1.5
1531.58Smrgfile	lib/libc/inet/inet_cidr_ntop.c	: 1.3
1541.58Smrgfile	lib/libc/inet/inet_ntop.c	: 1.3
1551.58Smrgfile	lib/libc/stdio/vfwprintf.c	: 1.8
1561.69Smrgfile	libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20
1571.76Smrgfile	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40
1581.74Smrgfile	libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22
1591.69Smrgfile	libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39
1601.58Smrgfile	libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39
1611.74Smrgfile	libexec/ld.elf_so/arch/vax/mdreloc.c	: 1.21
1621.71Sdanfile	libexec/ld.elf_so/arch/x86_64/mdreloc.c	: 1.27
1631.58Smrgfile	sbin/fsck_ext2fs/dir.c		: 1.19
1641.58Smrgfile	sbin/routed/rtquery/rtquery.c	: 1.18
1651.73Sdanfile	sys/arch/amd64/amd64/pmap.c	: 1.26
1661.79Smrgfile	sys/arch/i386/pci/piixpcib.c	: 1.4
1671.80Stsutsuifile	sys/arch/m68k/m68k/pmap_motorola.c	: 1.4
1681.58Smrgfile	sys/crypto/cast128/cast128.c	: 1.9
1691.58Smrgfile	sys/ddb/db_command.c		: 1.86
1701.68Smrgfile	sys/dev/cardbus/cardbus_map.c	: 1.21
1711.58Smrgfile	sys/dev/fss.c			: 1.25
1721.69Smrgfile	sys/dev/ic/igsfb.c		: 1.39
1731.68Smrgfile	sys/dev/ic/mb86950.c		: 1.5
1741.58Smrgfile	sys/dev/ic/midway.c		: 1.71
1751.68Smrgfile	sys/dev/kttcp.c			: 1.18
1761.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1771.68Smrgfile	sys/dev/pci/cmpci.c		: 1.31
1781.58Smrgfile	sys/dev/pci/machfb.c		: 1.45
1791.68Smrgfile	sys/dev/usb/ohci.c		: 1.174
1801.68Smrgfile	sys/dev/usb/uhci.c		: 1.196
1811.68Smrgfile	sys/dev/rasops/rasops_bitops.h	: 1.9
1821.58Smrgfile	sys/dist/ipf/netinet/ip_nat.c	: 1.10
1831.58Smrgfile	sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8
1841.58Smrgfile	sys/dist/pf/net/pf.c		: 1.22
1851.59Smrgfile	sys/fs/udf/udf_vnops.c		: 1.4
1861.58Smrgfile	sys/kern/kern_sig.c		: 1.219
1871.58Smrgfile	sys/kern/tty.c			: 1.181
1881.58Smrgfile	sys/net/bpf.c			: 1.116
1891.58Smrgfile	sys/net/zlib.c			: 1.26
1901.68Smrgfile	sys/netccitt/if_x25subr.c	: 1.37
1911.58Smrgfile	sys/netinet/in.c		: 1.107
1921.58Smrgfile	sys/nfs/nfs_serv.c		: 1.108
1931.58Smrgfile	sys/nfs/nfs_socket.c		: 1.129
1941.58Smrgfile	sys/nfs/nfs_syscalls.c		: 1.91
1951.58Smrgfile	sys/ufs/lfs/lfs_vfsops.c	: 1.207 [also (char *)]
1961.58Smrgfile	usr.bin/ftp/ftp.c		: 1.140
1971.58Smrgfile	usr.bin/find/function.c		: 1.54
1981.58Smrgfile	usr.bin/mail/tty.c		: 1.20
1991.100Stsutsuifile	usr.bin/msgc/msg_sys.def	: 1.33-1.34
2001.58Smrgfile	usr.bin/nl/nl.c			: 1.7
2011.58Smrgfile	usr.bin/systat/keyboard.c	: 1.23
2021.58Smrgfile	usr.bin/usbhidctl/usbhid.c	: 1.29
2031.58Smrgfile	usr.bin/vi/cl/cl_read.c		: 1.5
2041.58Smrgfile	usr.bin/vi/ex/ex_cscope.c	: 1.12
2051.58Smrgfile	usr.bin/vi/ex/ex_tag.c		: 1.19
2061.58Smrgfile	usr.bin/vi/vi/v_txt.c		: 1.15
2071.58Smrgfile	usr.sbin/altq/altqstat/qdisc_rio.c : 1.4
2081.58Smrgfile	usr.sbin/cron/do_command.c	: 1.19
2091.58Smrgfile	usr.sbin/timed/timed/slave.c	: 1.15
2101.58Smrgdescr
2111.58Smrg	GCC 4.1 gets many uninitialised variable warnings wrong.  We should
2121.58Smrg	really audit all the old hacks like this when older compilers are
2131.58Smrg	removed from the tree, as many are probably no longer required.
2141.65Schristos	The problem is that it does not recognize initialization via function
2151.65Schristos	call pointer. I.e.
2161.65Schristos		int p;
2171.65Schristos		foo(&p);
2181.65Schristos	does not mark p as initialized.
2191.58Smrgkcah
2201.58Smrg
2211.59Smrghack	gcc4 pointer sign and strict aliasing problems
2221.59Smrgmdate	10 May 2006
2231.59Smrgwho	mrg
2241.59Smrgfile	bin/ed/Makefile			: 1.33
2251.68Smrgfile	distrib/utils/sysinst/Makefile.inc : 1.44
2261.91Smartinfile	distrib/utils/x_dhclient/Makefile : 1.15
2271.60Smrgfile	games/bcd/Makefile		: 1.5
2281.60Smrgfile	games/dab/Makefile		: 1.5
2291.60Smrgfile	games/larn/Makefile		: 1.17
2301.60Smrgfile	games/pom/Makefile		: 1.5
2311.60Smrgfile	lib/libasn1/Makefile		: 1.26
2321.60Smrgfile	lib/libcrypt/Makefile		: 1.17
2331.60Smrgfile	lib/libgssapi/Makefile		: 1.16
2341.60Smrgfile	lib/libhdb/Makefile		: 1.20
2351.60Smrgfile	lib/libkadm5clnt/Makefile	: 1.21
2361.60Smrgfile	lib/libkadm5srv/Makefile	: 1.25
2371.60Smrgfile	lib/libkrb5/Makefile		: 1.35
2381.60Smrgfile	lib/libssh/Makefile		: 1.6
2391.60Smrgfile	lib/libtelnet/Makefile		: 1.26
2401.60Smrgfile	libexec/getty/Makefile		: 1.14
2411.60Smrgfile	libexec/kadmind/Makefile	: 1.19
2421.60Smrgfile	libexec/kpasswdd/Makefile	: 1.14
2431.60Smrgfile	sbin/atactl/Makefile		: 1.3
2441.60Smrgfile	sbin/cgdconfig/Makefile		: 1.7
2451.60Smrgfile	sbin/clri/Makefile		: 1.13
2461.60Smrgfile	sbin/dkctl/Makefile		: 1.4
2471.60Smrgfile	sbin/dump/Makefile		: 1.33
2481.60Smrgfile	sbin/fdisk/Makefile		: 1.35
2491.60Smrgfile	sbin/fsck_ext2fs/Makefile	: 1.11
2501.60Smrgfile	sbin/fsck_ffs/Makefile		: 1.29
2511.60Smrgfile	sbin/fsdb/Makefile		: 1.18
2521.60Smrgfile	sbin/newfs/Makefile		: 1.30
2531.60Smrgfile	sbin/newfs_sysvbfs/Makefile	: 1.2
2541.60Smrgfile	sbin/restore/Makefile		: 1.23
2551.60Smrgfile	sbin/veriexecctl/Makefile	: 1.11
2561.64Smrgfile	sys/lib/libsa/Makefile		: 1.59
2571.68Smrgfile	sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24
2581.59Smrgfile	usr.bin/awk/Makefile		: 1.9
2591.64Smrgfile	usr.bin/crontab/Makefile	: 1.24
2601.60Smrgfile	usr.bin/ctags/Makefile		: 1.8
2611.61Smrgfile	usr.bin/gzip/Makefile		: 1.10
2621.60Smrgfile	usr.bin/ssh/sftp/Makefile	: 1.10
2631.60Smrgfile	usr.bin/ssh/ssh/Makefile	: 1.25
2641.59Smrgfile	usr.bin/vi/build/Makefile	: 1.26
2651.60Smrgfile	usr.bin/telnet/Makefile		: 1.40
2661.60Smrgfile	usr.bin/tn3270/tn3270/Makefile	: 1.36
2671.60Smrgfile	usr.bin/tr/Makefile		: 1.4
2681.59Smrgfile	usr.sbin/amd/amd/Makefile	: 1.27
2691.59Smrgfile	usr.sbin/amd/amq/Makefile	: 1.14
2701.59Smrgfile	usr.sbin/amd/libamu/Makefile	: 1.20
2711.59Smrgfile	usr.sbin/amd/pawd/Makefile	: 1.5
2721.59Smrgfile	usr.sbin/bind/Makefile.inc	: 1.22
2731.60Smrgfile	usr.sbin/bind/libdns/Makefile	: 1.3
2741.60Smrgfile	usr.sbin/bind/named/Makefile	: 1.17
2751.60Smrgfile	usr.sbin/bootp/bootptest/Makefile : 1.2
2761.60Smrgfile	usr.sbin/chrtbl/Makefile	: 1.6
2771.60Smrgfile	usr.sbin/cron/Makefile		: 1.12
2781.59Smrgfile	usr.sbin/dhcp/Makefile.inc	: 1.20
2791.60Smrgfile	usr.sbin/hprop/Makefile		: 1.13
2801.60Smrgfile	usr.sbin/installboot/Makefile	: 1.35
2811.59Smrgfile	usr.sbin/ipf/ipftest/Makefile	: 1.32
2821.59Smrgfile	usr.sbin/isdn/isdnd/Makefile	: 1.6
2831.59Smrgfile	usr.sbin/isdn/isdnmonitor/Makefile : 1.3
2841.59Smrgfile	usr.sbin/isdn/isdntel/Makefile	: 1.2
2851.59Smrgfile	usr.sbin/isdn/isdntrace/Makefile : 126
2861.61Smrgfile	usr.sbin/mopd/common/Makefile	: 1.10
2871.61Smrgfile	usr.sbin/mopd/mopd/Makefile	: 1.9
2881.61Smrgfile	usr.sbin/mopd/mopprobe/Makefile	: 1.7
2891.60Smrgfile	usr.sbin/makefs/Makefile	: 1.17
2901.60Smrgfile	usr.sbin/mscdlabel/Makefile	: 1.5
2911.60Smrgfile	usr.sbin/pkg_install/add/Makefile : 1.7
2921.60Smrgfile	usr.sbin/pkg_install/create/Makefile : 1.5
2931.60Smrgfile	usr.sbin/pkg_install/lib/Makefile : 1.28
2941.59Smrgfile	usr.sbin/ntp/ntpd/Makefile	: 1.10/1.11
2951.59Smrgfile	usr.sbin/ntp/ntptime/Makefile	: 1.4/1.5
2961.59Smrgfile	usr.sbin/pppd/Makefile.inc	: 1.3
2971.59Smrgfile	usr.sbin/pppd/pppd/Makefile	: 1.38
2981.60Smrgfile	usr.sbin/rarpd/Makefile		: 1.10
2991.59Smrgfile	usr.sbin/rbootd/Makefile	: 1.10
3001.60Smrgfile	usr.sbin/rpc.pcnfsd/Makefile	: 1.17
3011.60Smrgfile	usr.sbin/tcpdump/Makefile	: 1.42
3021.59Smrgdescr
3031.215Swiz	GCC 4.1 warns on pointer sign comparison/assignments and lots of
3041.59Smrg	code does not conform.  For now we use -Wno-pointer-sign and
3051.59Smrg	-fno-strict-aliasing.
3061.59Smrgkcah
3071.59Smrg
3081.145Schristoshack	disable ctf for gcc-4.8 build
3091.145Schristosmdate	April 3 2014
3101.146Swizwho	christos
3111.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.frontend	: 1.4
3121.145Schristosfile	external/gpl3/gcc/usr.bin/Makefile.backend	: 1.5
3131.145Schristosdescr
3141.145Schristos	nbctfconvert -g -L VERSION -g fold-const.o
3151.145Schristos	ERROR: fold-const.c: failed to get mapping for tid 79154 \
3161.145Schristos		((null)) <13532>
3171.145Schristoskcak
3181.145Schristos
3191.121Schristoshack	emacs aborting on exit (libgcc issue)
3201.121Schristosmdate	7 November 2011
3211.121Schristoswho	christos
3221.121Schristosfile	external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2
3231.121Schristosdescr
3241.121Schristos	GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit
3251.121Schristos	to do just that. If the symbol requested is not found, then it aborts.
3261.121Schristos	emacs 23.3 triggers this assertion. For now disable aborting, and
3271.121Schristos	silently ignore.
3281.121Schristoskcah
3291.121Schristos
3301.105Sagchack	cross-building hack on Darwin
3311.105Sagcmdate	20 July 2008
3321.105Sagcwho	agc
3331.105Sagcfile	src/distrib/common/Makefile.mdset	: 1.33
3341.105Sagcdescr
3351.105Sagc	Darwin has problems with getopt() when used in mdsetimage -v,
3361.105Sagc	due to the difference between BSD and libiberty() getopt
3371.105Sagc	implementations, more fully described in
3381.105Sagc	http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html
3391.105Sagc	and the subsequent thread.  For just now, we just have an ugly
3401.105Sagc	workaround not to call mdsetimage with the -v argument on Darwin
3411.105Sagckcah
3421.105Sagc
3431.109Sveegohack	avoid rebuilding asn1 libraries
3441.109Sveegomdate	03 August 2008
3451.109Sveegowho	veego
3461.109Sveegofile	src/crypto/dist/heimdal/lib/asn1/gen.c	: 1.10
3471.109Sveegofile	src/lib/libasn1/Makefile	: 1.32
3481.109Sveegofile	src/lib/libhdb/Makefile	: 1.23
3491.109Sveegofile	src/lib/libgssapi/Makefile	: 1.20
3501.109Sveegofile	src/lib/libhx509/Makefile	: 1.3
3511.109Sveegopr	9702 39185
3521.109Sveegodescr
3531.109Sveego	asn1_compile does not check if generated header files do not have to
3541.109Sveego	be rebuild.
3551.109Sveego	Generate .hx files and copy it in the Makefiles if they changed.
3561.109Sveegokcah
3571.109Sveego
3581.144Stronhack	Disable fortification for /usr/bin/makeinfo
3591.144Stroncdata	24 Mar 2014
3601.144Stronwho	tron
3611.186Smayafile	src/external/gpl2/texinfo/bin/makeinfo/Makefile	: 1.1
3621.144Stronpr	N/A
3631.144Strondescr
3641.144Stron	If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3
3651.144Stron	it fails to process certain texinfo files, e.g. "cl.texi"
3661.144Stron	included in the Emacs 24.3 distribution.
3671.144Stronkcah
3681.144Stron
3691.147Stronhack	Disable Stack Smash Protection for /usr/X11R7/bin/xauth
3701.147Stroncdata	05 Apr 2014
3711.147Stronwho	tron
3721.147Stronfile	src/external/mit/xorg/bin/xauth/Makefile	: 1.4
3731.147Stronpr	N/A
3741.147Strondescr
3751.147Stron	If "xauth" is compile with "USE_SSP" set to "yes" it fails
3761.147Stron	mysteriously with an error message like this:
3771.147Stron
3781.147Stron	/usr/X11R7/bin/xauth:  file /foo/bar/.Xauthority does not exist
3791.147Stron	/usr/X11R7/bin/xauth:  unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority
3801.147Stron
3811.147Stron	The compiler seems to get confused about the two filename variables
3821.147Stron	used in the link(2) system call.
3831.147Stronkcah
3841.147Stron
3851.162Spookahack	g++ 5.x barfs on volatile in constexpr initializers
3861.162Spookacdata	27 Aug 2015
3871.160Spookawho	pooka
3881.162Spookafile	src/lib/libpthread/pthread_types.h	: 1.17
3891.160Spookapr	lib/49989
3901.160Spookadescr
3911.160Spooka	Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER
3921.160Spooka	in C++ results in:
3931.160Spooka		error: temporary of non-literal type '__pthread_mutex_st'
3941.160Spooka		in a constant expression
3951.160Spooka		constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
3961.160Spooka		[...]
3971.160Spooka		include/pthread_types.h:101:8: note: '__pthread_mutex_st' is
3981.160Spooka		not literal because:
3991.160Spooka		struct __pthread_mutex_st {
4001.160Spooka		^
4011.160Spooka		include/pthread_types.h:103:17: note:   non-static data
4021.160Spooka		member '__pthread_mutex_st::ptm_errorcheck' has volatile type
4031.160Spooka		pthread_spin_t ptm_errorcheck;
4041.160Spookakcah
4051.160Spooka
4061.163Schristoshack	libm cabs{,f,l} and g++
4071.163Schristoscdata	11 Jan 2016
4081.163Schristoswho	christos
4091.163Schristospr	lib/50646
4101.163Schristosfile	src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2
4111.163Schristosfile	src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2
4121.163Schristosdescr
4131.163Schristos	Our cabs and cabsf have a different argument format on some architectures
4141.163Schristos	and for that we have created in libm/compat_cabs{,f}.c. The standard
4151.163Schristos	versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in
4161.163Schristos	<complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they
4171.163Schristos	translate by default to cabs{,f,l} which gets defined to cabs{,f} (the
4181.163Schristos	wrong function) and an undefined cabsl. I've changed <complex> to use
4191.163Schristos	the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is
4201.163Schristos	still broken.
4211.163Schristoskcah
4221.163Schristos
4231.249Srinhack	xorg warnings
4241.249Srincdate	30 July 2008, 3 June, 2013
4251.249Srinwho	mrg
4261.249Srinfile	external/mit/xorg/lib/libSM/Makefile : 1.2
4271.249Srin	external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10
4281.249Srin	external/mit/xorg/lib/libXext/Makefile : 1.2
4291.249Srin	external/mit/xorg/lib/libXfont/Makefile : 1.2
4301.249Srindescr
4311.249Srin	Disable several warnings or use -Wno-error across Xorg sources
4321.249Srin	while we get them working
4331.249Srinkcah
4341.249Srin
4351.249Srinhack	32 bit time leftovers
4361.249Srincdate	11 January 2009
4371.249Srinwho	christos
4381.249Srinfile	lib/libc/time/localtime.c : 1.41
4391.249Srin	lib/libc/time/zic.c : 1.23
4401.249Srindescr
4411.249Srin	The timezone compiled files still contain 32 bit time_t
4421.249Srin	quantities. I did not want to version the files because
4431.249Srin	the ``parser'' is too ugly for words. What needs to be
4441.249Srin	done, is to rewrite the parser from scratch also to avoid
4451.249Srin	potential core-dumps from parsing invalid files.
4461.249Srinkcah
4471.249Srin
4481.249Srinhack	32 bit time leftovers
4491.249Srincdate	11 January 2009
4501.249Srinwho	christos
4511.249Srinfile	various
4521.249Srindescr
4531.249Srin	Many filesystem on-disk formats have 32 bit times.
4541.249Srinkcah
4551.249Srin
4561.249Srin
4571.21Smycroftport	vax
4581.21Smycroft
4591.235Schristos	hack	gcc10/vax ICE
4601.235Schristos	cdate	Sun Jan 22 15:37:56 EST 2023
4611.235Schristos	who	christos
4621.235Schristos	file	external/mit/xorg/lib/fontconfig/src/Makefile : 1.28
4631.235Schristos	descr
4641.235Schristos		Disable optimization on some files
4651.235Schristos	kcah
4661.235Schristos
4671.54She	hack	declare boolean_t in two IPF user-mode programs
4681.54She	cdate	Tue Mar  7 19:19:20 CET 2006
4691.54She	who	he
4701.54She	file	dist/ipf/ipsend/iptests.c : 1.8
4711.54She		dist/ipf/ipsend/sock.c : 1.7
4721.54She	descr
4731.54She		The IPF user-mode programs ipsend and iptest first
4741.54She		include <sys/types.h> without _KERNEL defined, and
4751.54She		later include <sys/file.h> with _KERNEL defined.
4761.54She		This causes a build failure when building for vax,
4771.54She		since <sys/device.h> ends up being included without
4781.54She		bollean_t being defined by <sys/types.h>.
4791.54She		Build failure and further details documented in
4801.54She		PR#32907.
4811.54She	kcah
4821.54She
4831.104Sgmcgarry	hack	pcc 0.9.9 large string literals
4841.104Sgmcgarry	cdat	8 July 2008
4851.104Sgmcgarry	who	gmcgarry
4861.104Sgmcgarry	file	sys/conf/param.c : 1.58
4871.104Sgmcgarry	descr
4881.104Sgmcgarry		Workaround for pcc 0.9.9 not handling large string literals
4891.104Sgmcgarry		which causes kernels with 'options INCLUDE_CONFIG_FILE' to
4901.104Sgmcgarry		fail compilation.
4911.104Sgmcgarry		There is a proposal on the pcc mailing list to stuff config
4921.104Sgmcgarry		file in ELF section.
4931.104Sgmcgarry	kcah
4941.104Sgmcgarry
4951.21Smycroftport	arm
4961.21Smycroft
4971.21Smycroft	hack	gcc-unsigned-compare
4981.21Smycroft	cdate	09 Mar 2002
4991.21Smycroft	mdate	18 Mar 2002
5001.21Smycroft	who	bjh21
5011.21Smycroft	file	dist/bind/lib/nameser/ns_parse.c : 1.3
5021.21Smycroft	file	dist/dhcp/minires/ns_parse.c : 1.3
5031.21Smycroft	file	dist/dhcp/omapip/result.c : 1.2
5041.21Smycroft	file	dist/dhcp/server/failover.c : 1.3
5051.21Smycroft	file	gnu/dist/toolchain/bfd/bfd.c : 1.2
5061.21Smycroft	file	gnu/dist/toolchain/bfd/format.c : 1.2
5071.21Smycroft	file	gnu/dist/toolchain/gdb/target.c : 1.2
5081.21Smycroft	file	sys/kern/vfs_subr.c : 1.172
5091.21Smycroft	descr	When checking that a potentially-unsigned enum is >= 0, assign
5101.21Smycroft		it to an int first.  This is necessary to avoid "comparison is
5111.21Smycroft		always true" warnings with -fshort-enums.  Casting to an int
5121.21Smycroft		really should be enough, but turns out not to be.
5131.21Smycroft	kcah
5141.21Smycroft
5151.122Stsutsui	hack	gcc-4.5 arm CNAME hostname lookup failure on
5161.122Stsutsui		certain DNS environment (probably -ftree-ter problem)
5171.122Stsutsui	cdate	Sat Dec 24 04:59:00 UTC 2011
5181.122Stsutsui	mdate	
5191.122Stsutsui	who	tsutsui
5201.122Stsutsui	file	lib/libc/net/Makefile.inc 1.79
5211.122Stsutsui	descr	Hostname lookup against CNAMEs by some commands fails
5221.122Stsutsui		on certain DNS environments if lib/libc/net/gethnamaddr.c
5231.122Stsutsui		(ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc)
5241.122Stsutsui		are compiled with -O2, even though nslookup(1) against
5251.122Stsutsui		the same CNAME returns proper hostname.
5261.122Stsutsui		They works properly if compiled with -O2 -fno-tree-ter.
5271.122Stsutsui		Also -O2 fails but -O2 -fno-tree-ter works on the following
5281.122Stsutsui		test case in gcc bugzilla:
5291.122Stsutsui		http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4
5301.122Stsutsui	kcah
5311.122Stsutsui
5321.21Smycroftport	sh3
5331.21Smycroft
5341.74Smrg	hack	gcc4-sh3-bz2
5351.103Stsutsui	cdate	Sun May 21 03:34:57 UTC 2006
5361.103Stsutsui	mdate	Fri May 16 13:13:00 UTC 2008
5371.103Stsutsui	who	mrg, tsutsui
5381.74Smrg	file	lib/libbz2/Makefile	: 1.10
5391.74Smrg	descr
5401.74Smrg		The in-tree GCC 4.1-based compiler generated too-far
5411.103Stsutsui		pc-relative addresses.  Hack is to build with
5421.103Stsutsui		-fno-loop-optimize.
5431.74Smrg	kcah
5441.74Smrg
5451.96Smrgport	m68000
5461.79Smrg
5471.96Smrg	hack	gcc4-m68000
5481.102Stsutsui	cdate	Fri Feb  8 10:29:37 PST 2008
5491.102Stsutsui	mdate	Sun May  4 15:37:19 UTC 2008
5501.99Stsutsui	who	mrg, tsutsui
5511.96Smrg	file	rescue/Makefile	: 1.21
5521.99Stsutsui	file	sbin/dump_lfs/Makefile	: 1.9
5531.101Stsutsui	file	sbin/fsck_ffs/Makefile	: 1.35
5541.101Stsutsui	file	sbin/fsdb/Makefile	: 1.22
5551.101Stsutsui	file	share/mk/sys.mk	: 1.96
5561.99Stsutsui	file	usr.sbin/ndbootd/Makefile	: 1.5
5571.95Smrg	descr
5581.101Stsutsui		Several internal compiler errors with gcc -O1
5591.101Stsutsui		around 64bit integer arithmetic.
5601.99Stsutsui		This hack uses -O1 and adds some -fno-tree-foo options
5611.99Stsutsui		to avoid the problem.
5621.101Stsutsui		This might be related with GCC Bugzilla Bug 32424.
5631.95Smrg	kcah
5641.95Smrg
5651.141Schristosport	m68k,sh3,vax
5661.135Schristos
5671.135Schristos	hack	gcc-4.8.1
5681.135Schristos	cdate	Wed Nov  6 20:41:35 EST 2013
5691.249Srin	mdate	2014/05/16 09:36:51
5701.135Schristos	who	christos
5711.249Srin	file	src/external/gpl3/gcc/lib/libstdc++-v3/Makefile : 1.11
5721.135Schristos	descr
5731.249Srin		compile the followings with -fimplicit-templates to
5741.135Schristos		produce missing instantiation of std::lower_bound expansion
5751.249Srin		for unsigned long:
5761.249Srin		- concept-inst.cc
5771.249Srin		- hashtable_c++0x.cc
5781.249Srin		- bitmap_allocator.cc
5791.135Schristos	kcah
5801.22Smrg
5811.116Smrgport	sparc
5821.116Smrg
5831.116Smrg	hack	avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3
5841.116Smrg	cdate	Sun Aug 14 19:26:48 PDT 2011
5851.116Smrg	who	mrg
5861.116Smrg	file	sys/arch/sparc64/sparc/cpu.c : 1.234
5871.116Smrg	file	sys/arch/sparc64/sparc/cpuvar.h : 1.90
5881.116Smrg	file	sys/arch/sparc64/sparc/genassym.cf : 1.67
5891.116Smrg	file	sys/arch/sparc64/sparc/locore.s : 1.265
5901.116Smrg	descr
5911.116Smrg		Something is wrong with GCC 4.5.3 and the savefpstate IPI.
5921.116Smrg		Post newlock2 there was a bug where a lock was reduced from
5931.116Smrg		IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI
5941.116Smrg		would crash due to NULL IPI.  This was fixed by re-using the
5951.116Smrg		right IPL value.  However, GCC 4.5.3 build kernels have the
5961.116Smrg		same problems.  For now, the hack is re-instated.
5971.116Smrg	kcah
5981.116Smrg
5991.116Smrg
6001.51Ssimonbport	mips
6011.51Ssimonb
6021.51Ssimonb	hack	mips-shared-linker-load-address
6031.51Ssimonb	cdate	Fri Oct  7 08:33:10 UTC 2005
6041.51Ssimonb	who	simonb
6051.51Ssimonb	file	src/sys/kern/exec_elf32.c : 1.107
6061.51Ssimonb	descr
6071.51Ssimonb		With COMPAT_16 or previous enabled (which enables
6081.51Ssimonb		ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will
6091.51Ssimonb		load and run at address 0.  The check to fix this in
6101.51Ssimonb		rev 1.107 only checks the first psection of the ELF
6111.51Ssimonb		executable, which may not be loadable.  A more correct
6121.51Ssimonb		fix is to check the first loadable psection instead of
6131.51Ssimonb		just the first psection.
6141.51Ssimonb	kcah
6151.54She
6161.85Smartin	hack	mips-duplicate-ras-end-label
6171.85Smartin	cdate	Sat Sep  2 23:29:42 2006
6181.85Smartin	who	martin
6191.92Schs	file	src/regress/sys/kern/ras/ras3/Makefile : 1.3
6201.85Smartin	descr
6211.85Smartin		Add -fno-reorder-blocks to CFLAGS to avoid duplicate
6221.85Smartin		labels by duplicated __asm output from RAS_END()
6231.85Smartin		macro.
6241.85Smartin	kcah
6251.85Smartin
6261.106Slukem	hack	mips-mcount-assembler-warning
6271.106Slukem	cdate	Tue Jul 29 14:16:52 UTC 2008
6281.106Slukem	who	lukem
6291.106Slukem	file	src/lib/libc/gmon/Makefile.inc : 1.8
6301.106Slukem	descr
6311.106Slukem		Workaround for PR port-mips/39192.
6321.106Slukem		common/lib/libc/gmon/mcount.c generates a (fatal)
6331.106Slukem		assembler warning on MIPS:
6341.106Slukem			Warning: No .cprestore pseudo-op used in PIC code
6351.106Slukem		Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings
6361.106Slukem	kcah
6371.106Slukem
6381.236Smartin	hack	mips-use-binutils-old
6391.236Smartin	cdate	Sun May  7 14:28:55 CEST 2023
6401.236Smartin	who	martin
6411.236Smartin	file	src/share/mk/bsd.own.mk : 1.1311, 1.1308
6421.236Smartin	descr
6431.236Smartin		Use binutils.old for 64bit mips with 32bit userland.
6441.236Smartin		Version 2.39 causes random (cross-) build failures
6451.236Smartin		that are hard to reproduce or analyze.
6461.236Smartin	kcah
6471.236Smartin
6481.82Schristosport	i386
6491.82Schristos
6501.84Sdrochner	hack	use volatile intermediate variable to enforce rounding
6511.84Sdrochner	cdate	Tue Aug  1 22:15:55 MEST 2006
6521.84Sdrochner	who	drochner
6531.84Sdrochner	file	src/lib/libm/src/lrintf.c : 1.4
6541.84Sdrochner	file	src/lib/libm/src/s_rintf.c : 1.8
6551.84Sdrochner	descr
6561.84Sdrochner		gcc-4 does subsequent operations on "float" values within
6571.84Sdrochner		the i387 FPU without rounding the intermediate results
6581.84Sdrochner	kcah
6591.110Smacallan
6601.148Schristosport	x86
6611.148Schristos	hack	turn off optimization for biosdisk_ll.c because otherwise
6621.148Schristos		we are pass the wrong arguments to biosdisk_read(). 
6631.148Schristos		$ cd /usr/src/sys/arch/i386/floppies/bootflopp-com
6641.148Schristos		$ qemu-system-i386 -nographic -fda boot-com1.fs -boot a
6651.203Srin	cdate	Mon Apr 7 21:09:55 2014 UTC
6661.148Schristos	who	christos
6671.148Schristos	file	src/sys/arch/i386/stand/lib/Makefile : 1.38
6681.148Schristos	descr
6691.148Schristos		Turning on DISK_DEBUG shows the problem. We should find
6701.148Schristos		out which option is causing this.
6711.148Schristos	hcah
6721.148Schristos
6731.110Smacallanport	powerpc
6741.110Smacallan
6751.110Smacallan	hack	avoid using __builtin_return_address(0) because it fails in
6761.110Smacallan		Xorg's module loader
6771.110Smacallan	cdate	Sat Sep 27 03:52:05 UTC 2008
6781.110Smacallan	who	macallan
6791.110Smacallan	file	src/libexec/ld.elf_so/rtld.c : 1.121
6801.110Smacallan	descr
6811.110Smacallan		workaround for PR port-macppc/37812
6821.110Smacallan	kcah
6831.110Smacallan
6841.115Smatt	hack	define TARGET_SECURE_PLT and HAVE_AS_TLS because when
6851.115Smatt		building the native compiler via build.sh those don't defined
6861.115Smatt		properly.
6871.115Smatt	cdate	Sat Mar 12 08:00:00 UTC 2011
6881.115Smatt	who	matt
6891.203Srin	file	src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h : 1.7
6901.115Smatt	descr
6911.115Smatt		see above
6921.115Smatt	kcah
6931.117Schristos
6941.117Schristosport	powerpc64
6951.117Schristos
6961.117Schristos	hack	include _errno.c in libposix so that __errno resolves. It
6971.117Schristos		should resolve from libc's errno, but somehow it does not.
6981.117Schristos		Linker bug?
6991.117Schristos	cdate	Thu Oct 27 13:19:47 EDT 2011
7001.117Schristos	who	christos
7011.117Schristos	file	src/lib/libposix/Makefile: 1.15
7021.118Schristos	file	src/lib/librt/Makefile: 1.14
7031.117Schristos	descr
7041.117Schristos		workaround for:
7051.117Schristos		    libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \
7061.117Schristos		    R_PPC64_REL24 relocation against symbol `.__errno'
7071.117Schristos	kcah
7081.119Schristos
7091.119Schristos	hack	rename data() function in mdocml to avoid redefined error.
7101.119Schristos		Compiler/Assembler bug?
7111.119Schristos	cdate	Sat Oct 29 11:16:01 EDT 2011
7121.119Schristos	who	christos
7131.119Schristos	file	src/external/bsd/mdocml/tbl_data.c: 1.2
7141.119Schristos	descr
7151.119Schristos		workaround for:
7161.119Schristos		    {standard input}: Assembler messages:
7171.119Schristos		    {standard input}:105: Error: symbol `.data' is already \
7181.119Schristos		    defined
7191.119Schristos	kcah
7201.120Schristos
7211.120Schristosport	emips
7221.120Schristos
7231.120Schristos	hack	Add nop between ctc1 and mtc0 to avoid assembler internal
7241.120Schristos		error
7251.120Schristos	cdate	Sat Oct 29 16:57:34 EDT 2011
7261.120Schristos	who	christos
7271.120Schristos	file	src/sys/arch/mips/mips/mips_fpu.c: 1.7
7281.120Schristos	descr
7291.120Schristos		workaround for:
7301.120Schristos		    {standard input}: Assembler messages:
7311.120Schristos		    {standard input}:730: Internal error!
7321.120Schristos		    Assertion failure in append_insn at /usr/src/external/gpl3/\
7331.120Schristos		    binutils/dist/gas/config/tc-mips.c line 2910.
7341.120Schristos	kcah
7351.125Smartin
7361.125Smartinport	ia64
7371.125Smartin
7381.157Smartin	hack	libgcc unwind dummy function
7391.157Smartin	cdate	Fri Apr 17 14:31:03 CEST 2015
7401.157Smartin	who	martin
7411.157Smartin	file	src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4
7421.157Smartin	descr
7431.157Smartin		Add an empty _Unwind_FindTableEntry() implementation.
7441.157Smartin		In the end we will use our libc stuff, and this should
7451.157Smartin		go away again.
7461.157Smartin	kcah
7471.157Smartin
7481.128Schristosport	x68k
7491.127Smartin
7501.128Schristos	hack	compiler error with gcc 4.5.x
7511.128Schristos	cdate	Fri May 24 13:23:01 EDT 2013
7521.128Schristos	who	christos
7531.128Schristos	file	src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17
7541.128Schristos		xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11
7551.128Schristos	descr
7561.128Schristos		workaround for:
7571.128Schristos		internal compiler error: in cselib_record_set, at cselib.c:1999
7581.128Schristos	kcah
7591.130Sjoerg
7601.130Sjoerghack	fallback to /usr/bin/clang-cpp in rpcgen
7611.130Sjoergcdate	Wed Jun  5 15:49:27 CEST 2013
7621.130Sjoergwho	joerg
7631.203Srinfile	src/usr.bin/rpcgen/rpc_main.c : 1.35
7641.130Sjoergdescr
7651.136Sjoerg	It is undecided which compiler owns /usr/bin/cpp and whether it should
7661.130Sjoerg	exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box,
7671.130Sjoerg	if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback.
7681.130Sjoerg	This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable.
7691.130Sjoergkcah
7701.131Sskrll
7711.155Sskrllport	hppa
7721.131Sskrll
7731.131Sskrll	hack	compiler error with gcc 4.5.x
7741.131Sskrll	cdate	Tue Jul 23 07:42:28 BST 2013
7751.131Sskrll	who	skrll
7761.133Sskrll	file	src/sys/lib/libkern/Makefile.libkern: 1.26
7771.133Sskrll	descr
7781.133Sskrll		workaround for unanalysed codegen bug affecting md5c.c.
7791.133Sskrll	kcah
7801.149Smacallan
7811.155Sskrll	hack	gdb vs _rtld_debug_state problem
7821.155Sskrll	cdate	Thu Mar  5 09:49:53 UTC 2015
7831.155Sskrll	who	skrll
7841.155Sskrll	file	src/libexec/ld.elf_so/rtld.c: 1.175
7851.155Sskrll	descr
7861.155Sskrll		workaround for problem where gdb misses the breakpoint on
7871.155Sskrll		_rtld_debug_state when the function is only the
7881.155Sskrll		bv,n %r0(%rp) instruction - the nullify seems to
7891.155Sskrll		confuse something
7901.155Sskrll	kcah
7911.155Sskrll
7921.149Smacallanport	mips64*
7931.149Smacallanhack	compiler crashes on mips64* with optimization enabled
7941.149Smacallancdate	Tue May 13 18:46:48 UTC 2014
7951.149Smacallanwho	macallan
7961.149Smacallanfile	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6
7971.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5
7981.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6
7991.149Smacallan	src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5
8001.149Smacallandescr	workaround for n32 gcc doing unaligned 64bit accesses when optimizing
8011.149Smacallanpr	48696
8021.149Smacallankcah
8031.150Smartin
8041.150Smartinport	vax
8051.191Schristoshack	compile nir.c in gallium with -O1
8061.191Schristoscdate	Mon Oct 28 14:39:35 EDT 2019
8071.191Schristoswho	christos
8081.191Schristosfile	/cvsroot/src/external/mit/xorg/lib/gallium/Makefile 1.36
8091.191Schristosdescr	gallium does not compile.
8101.191Schristoskcah
8111.191Schristos
8121.193Schristosport	sh3
8131.193Schristoshack	compile parse.c in battlestar with -Wno-restrict
8141.193Schristoscdate	Mon Oct 28 14:39:35 EDT 2019
8151.193Schristoswho	christos
8161.193Schristosfile	/cvsroot/src/games/battlestar/Makefile 1.11
8171.193Schristosdescr	fails to compile, confused by char words[][];
8181.193Schristos	strcpy(words[n - 1], words[n + 1]);
8191.193Schristoskcah
8201.193Schristos
8211.194Schristosport	sh3
8221.194Schristoshack	compile ddns.c in dhcpcd with no-stringop-overflow
8231.194Schristoscdate	Tue Oct 29 20:25:59 EDT 2019
8241.194Schristoswho	christos
8251.194Schristosfile	/cvsroot/src/external/mpl/dhcp/bin/server/Makefile 1.2
8261.194Schristosdescr	fails to compile, confused by builtin_object_size in strcat(p, ".in..")
8271.194Schristoskcah
8281.194Schristos
8291.156Smattport	arm
8301.156Smatthack	avoid using labels in a 12-bit constant.
8311.203Srincdate	Mon Mar 30 05:26:47 2015 UTC
8321.156Smattwho	matt
8331.156Smattfile	crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2
8341.156Smattdescr	workaround for clang misassembling an instruction
8351.156Smattkcah
8361.177Schristos
8371.177Schristosport	sparc64
8381.177Schristoshack	during profiling with -m32 (and ASLR) labels are not generated
8391.177Schristos	consistently
8401.203Srincdate	Sat Feb 11 04:56:37 2017 UTC
8411.177Schristoswho	christos
8421.177Schristosfile	/cvsroot/src/crypto/external/bsd/heimdal/lib/libasn1/Makefile: 1.4
8431.177Schristosdesc 	asn1_krb5_asn1.po does not produce the same results during successive
8441.177Schristos	compilation runs; it is bimodal. Turning optimization to -O0 fixes
8451.177Schristos	the issue
8461.177Schristoskcah
8471.187Sscole
8481.187Sscoleport	ia64
8491.187Sscolehack	ski emulator crashes
8501.203Srincdate	Sat Apr 8 18:10:43 2017 UTC
8511.187Sscolewho	scole
8521.187Sscolefile	/cvsroot/src/sys/external/bsd/acpica/dist/tables/tbxfload.c: 1.6
8531.187Sscoledesc
8541.187Sscole	ski emulator crashes during acpi detection.  Added a check for
8551.187Sscole	uninitialized index.  Submitted a request for change with upstream
8561.187Sscole	mailing list, but never got a response
8571.187Sscolekcah
8581.189Schristos
8591.197Schristosport	powerpc
8601.199Schristoshack	compile tc.c, logerr.c, ubsan.c with -O0 for clang
8611.197Schristoscdate	Wed Jan 29 17:40:19 EST 2020
8621.197Schristoswho	christos
8631.197Schristosfile	src/external/bsd/atf/lib/libatf-c/Makefile: 1.22
8641.198Schristosfile	src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile: 1.49
8651.199Schristosfile	src/tests/lib/libc/misc/Makefile: 1.5
8661.199Schristos
8671.199Schristosdescr	Disable optimization on tc.c, logerr.c, ubsan.c crashes:
8681.197Schristos	lib/libLLVMCodeGen/../../llvm/../../external/apache2/llvm/lib/..\
8691.197Schristos	/dist/llvm/include/llvm/CodeGen/MachineFrameInfo.h", line 495, \
8701.197Schristos	function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const"
8711.197Schristoskcah
8721.202Srin
8731.208Srinport	m68k
8741.230Srinhack	compile aes_ccm_tag() with -O0
8751.208Srincdate	Mon Aug 10 06:27:29 UTC 2020
8761.230Srinmdate	Wed Aug 10 00:00:00 UTC 2022
8771.208Srinwho	rin
8781.208Srinfile	src/sys/crypto/aes/aes_ccm.c: 1.5
8791.211Srindescr	GCC 9.4 and 8.3 miscompile aes_ccm_tag() for m68k with optimization
8801.211Srin	level -O[12], which results in failure in aes_ccm_selftest().
8811.211Srin	For 9.4, -O0 and -O1 work but -O2 fails for amiga (A1200, 68060) and
8821.211Srin	mac68k (Quadra 840AV, 68040). Whereas -O0 and -O2 work but -O1 fails
8831.211Srin	for sun3 (TME, 68020 emulator) and sun2 (TME, 68010 emulator).
8841.230Srin	aes_ccm_selftest() still fails with GCC 10.4 and -O2.
8851.208Srinkcah
8861.217Schristos
8871.219Smartinport	sh3
8881.219Smartin
8891.219Smartin	hack	gcc9-sh3-lint
8901.219Smartin	cdate	Tue Jun 22 14:59:52 CEST 2021
8911.221Shgutch	mdate	Mon Jul  5 12:34:57 CEST 2021
8921.221Shgutch	who	hgutch
8931.221Shgutch	file	external/gpl3/gcc/dist/gcc/config/sh/sh.md 1.2
8941.221Shgutch		external/gpl3/gcc.old/dist/gcc/config/sh/sh.md 1.11
8951.221Shgutch	descr
8961.221Shgutch		The in-tree gcc 9/gcc 10 crashes with an internal
8971.221Shgutch		invalid opcode exception when using any kind of
8981.221Shgutch		optimization on lex.c in usr.bin/xlint/lint .  This
8991.221Shgutch		was introduced apparently unintendedly in gcc when
9001.221Shgutch		addressing a different issue.  Rather than disabling
9011.221Shgutch		optimization for lex.c, instead revert the change to
9021.221Shgutch		gcc.  The bug report upstream has been updated to
9031.221Shgutch		reflect the exact breakage.
9041.221Shgutch
9051.220Srillig		https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177
9061.219Smartinkcah
9071.223Srin
9081.226Sthorpejport	arm
9091.226Sthorpejhack	compile t_sig_backtrace with -fno-omit-frame-pointer for arm
9101.226Sthorpejcdate	Tue Nov 23 23:24:37 UTC 2021
9111.226Sthorpejmdate	Tue Nov 23 23:24:37 UTC 2021
9121.226Sthorpejwho	thorpej
9131.226Sthorpejfile	src/tests/lib/libexecinfo/Makefile: 1.8
9141.226Sthorpejfile	src/tests/lib/libexecinfo/t_sig_backtrace: 1.2
9151.226Sthorpejdescr	Unit test fails to pass unless t_sig_backtrace.c is compiled
9161.226Sthorpej	with -fno-omit-frame-pointer and -DNOINLINE_HACK.
9171.226Sthorpejkcah
9181.227Smartin
9191.227Smartinhack	alpha gcc error in lint
9201.227Smartincdate	2022/04/10 13:21:34
9211.227Smartinwho	martin
9221.241Smartinport	alpha, vax
9231.241Smartinfile	usr.bin/xlint/Makefile.inc: 1.23, 1.25
9241.227Smartinpr	56789
9251.227Smartindescr
9261.227Smartin	Compiling lint with -ftrapv fails with an internal
9271.227Smartin	gcc compiler error.
9281.228Srillig
9291.228Srillig	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105209
9301.241Smartin
9311.241Smartin	Supposedly fixed in gcc 11 or newer.
9321.227Smartinkcah
9331.231Srin
9341.231Srinhack	compile copy{in,out}() for ibm4xx with -O0 for clang
9351.231Srincdate	Mon Sep 12 08:06:36 UTC 2022
9361.231Srinwho	rin
9371.231Srinport	evbppc
9381.231Srinfile	sys/arch/powerpc/ibm4xx/trap.c: 1.99
9391.231Srindescr
9401.231Srin	clang 13.0.0 miscompiles copy{in,out}() with -O[12]. As a result,
9411.231Srin	kernel cannot execute /sbin/init.
9421.231Srinkcah
9431.237Srin
9441.237Srinhack	Disable secure PLT for alpha
9451.237Srincdate	Fri Jul  7 08:33:25 UTC 2023
9461.237Srinwho	rin
9471.237Srinport	alpha
9481.237Srinfile	src/external/gpl3/binutils/dist/bfd/elf64-alpha.c: 1.11
9491.237Srinpr	port-alpha/57511
9501.237Srindescr
9511.237Srin	Temporally disable secure PLT support, introduced by
9521.237Srin	binutils 2.39 for us. We need its support to ld.elf_so(1).
9531.237Srinkcah
9541.238Srin
9551.238Srinhack	openssl: Disable ec_nistp_64_gcc_128 on aarch64eb
9561.238Srincdate	Sat Jul  8 23:54:27 UTC 2023
9571.238Srinwho	rin
9581.238Srinport	aarch64eb
9591.238Srinfile	src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/ec.inc : 1.4
9601.238Srindescr
9611.238Srin	As described in upstream document:
9621.238Srin	https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-ec_nistp_64_gcc_128
9631.238Srin	This feature (for LP64) does not support big-endian machines.
9641.238Srin	Note that sparc64 does not use this (port-sparc64/57472).
9651.238Srinkcah
9661.240Smrg
9671.240Smrghack	GCC: Disable "-Warray-bounds" for x86 curcpu() and curlwp()
9681.240Smrgcdate	Mon Sep  4 13:59:32 PDT 2023
9691.240Smrgwho	mrg
9701.240Smrgport	i386 amd64
9711.240Smrgfile	src/sys/arch/amd64/include/cpu.h : 1.71
9721.240Smrgfile	src/sys/arch/i386/include/cpu.h : 1.184
9731.240Smrgdescr
9741.240Smrg	These functions trigger eg:
9751.240Smrg	./machine/cpu.h:57:9: error: array subscript 0 is outside array bounds of 'struct cpu_info * const[0]' [-Werror=array-bounds]
9761.240Smrg	   56 |         __asm("movq %%gs:%1, %0" :
9771.240Smrg	and can't easily be worked around.
9781.240Smrgkcah
9791.242Schristos
9801.242Schristoshack	ctfconvert/gcc: disable gcc dwarf-4 generation
9811.242Schristoscdate	Thu Apr  4 19:51:05 EDT 2024
9821.242Schristoswho	christos
9831.242Schristosfile	src/external/mit/xorg/lib/gallium.old/Makefile : 1.9
9841.242Schristosdescr
9851.242Schristos	Some files create dwarf info that our ctfmerge can't handle.
9861.242Schristos	We downgrade dwarf generation to version 3 which works.
9871.242Schristoskcah
9881.243Sriastrad
9891.243Sriastradhack	ia64: work around feclearexcept/fetestexcept compiler bug
9901.243Sriastradcdate	Sun May  5 23:06:10 UTC 2024
9911.243Sriastradwho	riastradh
9921.243Sriastradfile	tests/lib/libm/t_fe_round.c
9931.243Sriastraddescr
9941.243Sriastrad	Without judiciously placed __insn_barrier, we get:
9951.243Sriastrad	/tmp//ccJayu9g.s:2793: Warning: Use of 'mov.m' violates RAW dependency 'AR[FPSR].sf0.flags' (impliedf)
9961.243Sriastrad	/tmp//ccJayu9g.s:2793: Warning: Only the first path encountering the conflict is reported
9971.243Sriastrad	/tmp//ccJayu9g.s:2757: Warning: This is the location of the conflicting usage
9981.243Sriastradkcah
9991.245Smrg
10001.245Smrghack	m68k: work around stack protector m68k compiler bug
10011.245Smrgcdate	Thu Jun  6 15:53:21 PDT 2024
10021.247Srinudate	Sat Aug 17 15:18:30 UTC 2024
10031.245Smrgport	m68k
10041.247Srinwho	mrg, rin
10051.245Smrgfile	lib/libc/stdlib/strsuftoll.c : 1.10
10061.245Smrgfile	lib/libc/citrus/citrus_module.c : 1.14
10071.245Smrgfile	crypto/external/bsd/openssl/lib/libcrypto/blake2.inc : 1.3
10081.247Srinfile	crypto/external/bsd/openssl/lib/libcrypto/sha.inc : 1.8
10091.247Srinfile	external/mit/xorg/lib/freetype/Makefile : 1.26
10101.247Srinfile	external/mit/xorg/lib/gallium/Makefile : 1.56
10111.245Smrgdescr
10121.245Smrg	With GCC 12, strsuftoll() triggers an stack protector issue
10131.245Smrg	that does not appear to be valid.  _citrus_find_getops() does
10141.245Smrg	the same.  They both have minimal stack usage themselves and
10151.245Smrg	I suspect a GCC bug.
10161.247Srin	Other cases are less well studied.
10171.245Smrgkcah
10181.246Sriastrad
10191.246Sriastradhack	gcc: work around alignment limitations in ld.elf_so
10201.246Sriastradcdate	Mon Jun 17 23:35:52 UTC 2024
10211.246Sriastradwho	riastradh
10221.246Sriastradfile	external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors_posix.cpp : 1.4
10231.246Sriastradfile	src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.cpp : 1.4
10241.246Sriastradfile	external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h : 1.5
10251.246Sriastraddescr
10261.246Sriastrad	ld.elf_so only supports 2*pointer-aligned objects (typically
10271.246Sriastrad	8- or 16-byte) in thread-local storage, but tsan expects
10281.246Sriastrad	cacheline-aligned objects (typically >=64-byte).  To work
10291.246Sriastrad	around this, allocate n + 63 bytes and pick whichever pointer
10301.246Sriastrad	in that interval is aligned (PR lib/58349).
10311.246Sriastradkcah
10321.248Snat
10331.248Snathack	binutils: 68lc040 needs support for fpu emulation on some cpus.
10341.248Snatcdate	Thu Apr 3 11:52:14 UTC 2025
10351.248Snatport	m68k
10361.248Snatwho	nat
10371.248Snatfile	external/gpl3/binutils/dist/gas/config/tc-m68k.c : 1.13
10381.248Snatdescr	Early buggy revisions of 68LC040 cpu cannot use fpu emulation without
10391.248Snat	some binutils supprt. Adding NOP before F-LINE instructions.
10401.248Snat	(PR port-mac68k/13078 and binutils PATCH request
10411.248Snat	- https://sourceware.org/pipermail/binutils/2025-March/140270.html)
10421.248Snatkcah
1043