HACKS revision 1.208
11.208Srin# $NetBSD: HACKS,v 1.208 2020/08/10 06:46:27 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.190Smayafile 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.166Schristoshack gcc-5.3 optimizes memset+malloc -> calloc inside calloc 501.166Schristosmdate 4 May 2016 511.166Schristoswho christos 521.166Schristosfile external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5 531.166Schristosdescr 541.166Schristos resulting in infinite recursion; we prevent this with 551.166Schristos -fno-builtin-malloc 561.166Schristoskcah 571.166Schristos 581.167Smrghack turn off tree-vrp for parts of ufs_lookup.c 591.167Smrgmdate 28 April 2016 601.167Smrgwho mrg christos 611.167Smrgfile src/sys/ufs/ufs/ufs_lookup.c : 1.144 621.167Smrgpr 51094 631.167Smrgdescr 641.167Smrg with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir 651.167Smrg panicks are see. 661.167Smrghcah 671.167Smrg 681.1Slukemhack netstat ieee1394 address printing. 691.1Slukemmdate 14 Nov 2000 701.1Slukemwho matt 711.1Slukemfile lib/libc/net/getnameinfo.c : 1.32 : 497 : 503 721.1Slukemdescr 731.1Slukem Because the current implementation of IP over IEEE1394, the 741.1Slukem fw device address contains more than just the IEEE1394 EUI-64. 751.1Slukem So when printing out IEEE1394 addresses, ignore the extra stuff. 761.1Slukemkcah 771.1Slukem 781.1Slukemhack xterm vs. libterm 791.1Slukemmdate 01 Aug 2000 801.1Slukemwho jdc 811.1Slukemfile xsrc/xc/programs/xterm/main.c : 1.2 : 3609 : 3614 821.1Slukempr 10383 831.1Slukemdescr 841.1Slukem In order to extend the termcap string over 1023 bytes, a ZZ entry was 851.1Slukem introduced to point to a memory location containing the full entry. 861.1Slukem Without this hack, xterm will export a termcap containing the ZZ 871.1Slukem entry, which will then be ignored by libterm. As xterm modifies the 881.1Slukem exported termcap, this would cause those modifications to be ignored. 891.1Slukemkcah 901.1Slukem 911.1Slukemhack wi-at-big-endian-bus 921.1Slukemcdate 15 Mar 2002 931.1Slukemwho martin 941.203Srinfile dev/ic/wireg.h : 1.20 951.1Slukemdescr Add an option to access the underlying bus in big endian byte order 961.1Slukem to work around deficiencies in bus_space_{read,write}_* macros. 971.1Slukem Those don't allow the implementation of a proper pcmcia bus space 981.1Slukem tag. 991.1Slukemkcah 1001.1Slukem 1011.3Sjdchack specific knowledge of colours in curses code 1021.3Sjdccdate Sun Apr 6 11:05:24 BST 2003 1031.3Sjdcwho jdc 1041.3Sjdcfile lib/libcurses/color.c : r1.24 1051.3Sjdcdescr 1061.3Sjdc Swap red/blue and yellow/cyan colours for COLOR_OTHER. 1071.3Sjdc Fix is to enhance libtermcap to understand terminfo-style % sequences. 1081.3Sjdc See also: 1091.5Ssalo http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html 1101.4Sscwkcah 1111.4Sscw 1121.7Shehack Compensation for differing types of LINUX_USRSTACK and USRSTACK 1131.7Shecdate 21 Aug 2003 1141.7Shewho he 1151.7Shefile sys/miscfs/procfs/procfs_linux.c : 1.14 1161.7Shedescr 1171.7She Not all ports have LINUX_USRSTACK and/or USRSTACK defined as 1181.7She literals/constants, but refer to variables of a type which is 1191.7She not "unsigned long", causing compilation of procfs_linux.c to 1201.7She fail with "makes integer from pointer without a cast". This 1211.7She is observed on e.g. the sun3 port. Ideally the "types" for 1221.7She symbols should be consistent across all ports. 1231.25Smrgkcah 1241.25Smrg 1251.80Stsutsuihack gcc4 wrong uninitialized variable 1261.58Smrgmdate 10 May 2006 1271.58Smrgwho mrg 1281.58Smrgfile bin/ksh/eval.c : 1.6 1291.58Smrgfile bin/sh/histedit.c : 1.39 1301.58Smrgfile bin/sh/parser.c : 1.60 1311.58Smrgfile crypto/dist/heimdal/kdc/524.c : 1.10 1321.58Smrgfile crypto/dist/ssh/sftp.c : 1.20 1331.58Smrgfile crypto/dist/ssh/ssh-keysign.c : 1.11 1341.58Smrgfile dist/ipf/lib/hostname.c : 1.2 1351.58Smrgfile dist/ipf/tools/ipmon.c : 1.8 1361.72Smrgfile dist/ntp/ntpd/ntp_request.c : 1.4 1371.58Smrgfile dist/ntp/ntpd/refclock_shm.c : 1.4 1381.58Smrgfile dist/ntp/sntp/timing.c : 1.3 1391.58Smrgfile dist/pppd/pppstats/pppstats.c : 1.3 1401.58Smrgfile dist/tcpdump/print-zephyr.c : 1.5 1411.68Smrgfile distrib/utils/sysinst/aout2elf.c : 1.12 1421.58Smrgfile gnu/libexec/uucp/uucico/uucico.c : 1.6 1431.58Smrgfile lib/libc/citrus/citrus_csmapper.c : 1.6 1441.58Smrgfile lib/libc/citrus/citrus_pivot_factory.c : 1.5 1451.58Smrgfile lib/libc/inet/inet_cidr_ntop.c : 1.3 1461.58Smrgfile lib/libc/inet/inet_ntop.c : 1.3 1471.58Smrgfile lib/libc/stdio/vfwprintf.c : 1.8 1481.69Smrgfile libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20 1491.76Smrgfile libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40 1501.74Smrgfile libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22 1511.69Smrgfile libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39 1521.58Smrgfile libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39 1531.74Smrgfile libexec/ld.elf_so/arch/vax/mdreloc.c : 1.21 1541.71Sdanfile libexec/ld.elf_so/arch/x86_64/mdreloc.c : 1.27 1551.58Smrgfile sbin/fsck_ext2fs/dir.c : 1.19 1561.58Smrgfile sbin/routed/rtquery/rtquery.c : 1.18 1571.73Sdanfile sys/arch/amd64/amd64/pmap.c : 1.26 1581.79Smrgfile sys/arch/i386/pci/piixpcib.c : 1.4 1591.80Stsutsuifile sys/arch/m68k/m68k/pmap_motorola.c : 1.4 1601.58Smrgfile sys/crypto/cast128/cast128.c : 1.9 1611.58Smrgfile sys/ddb/db_command.c : 1.86 1621.68Smrgfile sys/dev/cardbus/cardbus_map.c : 1.21 1631.58Smrgfile sys/dev/fss.c : 1.25 1641.69Smrgfile sys/dev/ic/igsfb.c : 1.39 1651.68Smrgfile sys/dev/ic/mb86950.c : 1.5 1661.58Smrgfile sys/dev/ic/midway.c : 1.71 1671.68Smrgfile sys/dev/kttcp.c : 1.18 1681.68Smrgfile sys/dev/rasops/rasops_bitops.h : 1.9 1691.68Smrgfile sys/dev/pci/cmpci.c : 1.31 1701.58Smrgfile sys/dev/pci/machfb.c : 1.45 1711.68Smrgfile sys/dev/usb/ohci.c : 1.174 1721.68Smrgfile sys/dev/usb/uhci.c : 1.196 1731.68Smrgfile sys/dev/rasops/rasops_bitops.h : 1.9 1741.58Smrgfile sys/dist/ipf/netinet/ip_nat.c : 1.10 1751.58Smrgfile sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8 1761.58Smrgfile sys/dist/pf/net/pf.c : 1.22 1771.59Smrgfile sys/fs/udf/udf_vnops.c : 1.4 1781.58Smrgfile sys/kern/kern_sig.c : 1.219 1791.58Smrgfile sys/kern/tty.c : 1.181 1801.58Smrgfile sys/net/bpf.c : 1.116 1811.58Smrgfile sys/net/zlib.c : 1.26 1821.68Smrgfile sys/netccitt/if_x25subr.c : 1.37 1831.58Smrgfile sys/netinet/in.c : 1.107 1841.58Smrgfile sys/nfs/nfs_serv.c : 1.108 1851.58Smrgfile sys/nfs/nfs_socket.c : 1.129 1861.58Smrgfile sys/nfs/nfs_syscalls.c : 1.91 1871.58Smrgfile sys/ufs/lfs/lfs_vfsops.c : 1.207 [also (char *)] 1881.58Smrgfile usr.bin/ftp/ftp.c : 1.140 1891.58Smrgfile usr.bin/find/function.c : 1.54 1901.58Smrgfile usr.bin/mail/tty.c : 1.20 1911.100Stsutsuifile usr.bin/msgc/msg_sys.def : 1.33-1.34 1921.58Smrgfile usr.bin/nl/nl.c : 1.7 1931.58Smrgfile usr.bin/systat/keyboard.c : 1.23 1941.58Smrgfile usr.bin/usbhidctl/usbhid.c : 1.29 1951.58Smrgfile usr.bin/vi/cl/cl_read.c : 1.5 1961.58Smrgfile usr.bin/vi/ex/ex_cscope.c : 1.12 1971.58Smrgfile usr.bin/vi/ex/ex_tag.c : 1.19 1981.58Smrgfile usr.bin/vi/vi/v_txt.c : 1.15 1991.58Smrgfile usr.sbin/altq/altqstat/qdisc_rio.c : 1.4 2001.58Smrgfile usr.sbin/cron/do_command.c : 1.19 2011.58Smrgfile usr.sbin/timed/timed/slave.c : 1.15 2021.58Smrgdescr 2031.58Smrg GCC 4.1 gets many uninitialised variable warnings wrong. We should 2041.58Smrg really audit all the old hacks like this when older compilers are 2051.58Smrg removed from the tree, as many are probably no longer required. 2061.65Schristos The problem is that it does not recognize initialization via function 2071.65Schristos call pointer. I.e. 2081.65Schristos int p; 2091.65Schristos foo(&p); 2101.65Schristos does not mark p as initialized. 2111.58Smrgkcah 2121.58Smrg 2131.59Smrghack gcc4 pointer sign and strict aliasing problems 2141.59Smrgmdate 10 May 2006 2151.59Smrgwho mrg 2161.59Smrgfile bin/ed/Makefile : 1.33 2171.68Smrgfile distrib/utils/sysinst/Makefile.inc : 1.44 2181.91Smartinfile distrib/utils/x_dhclient/Makefile : 1.15 2191.60Smrgfile games/bcd/Makefile : 1.5 2201.60Smrgfile games/dab/Makefile : 1.5 2211.60Smrgfile games/larn/Makefile : 1.17 2221.60Smrgfile games/pom/Makefile : 1.5 2231.60Smrgfile lib/libasn1/Makefile : 1.26 2241.60Smrgfile lib/libcrypt/Makefile : 1.17 2251.60Smrgfile lib/libgssapi/Makefile : 1.16 2261.60Smrgfile lib/libhdb/Makefile : 1.20 2271.60Smrgfile lib/libkadm5clnt/Makefile : 1.21 2281.60Smrgfile lib/libkadm5srv/Makefile : 1.25 2291.60Smrgfile lib/libkrb5/Makefile : 1.35 2301.60Smrgfile lib/libssh/Makefile : 1.6 2311.60Smrgfile lib/libtelnet/Makefile : 1.26 2321.60Smrgfile libexec/getty/Makefile : 1.14 2331.60Smrgfile libexec/kadmind/Makefile : 1.19 2341.60Smrgfile libexec/kpasswdd/Makefile : 1.14 2351.60Smrgfile sbin/atactl/Makefile : 1.3 2361.60Smrgfile sbin/cgdconfig/Makefile : 1.7 2371.60Smrgfile sbin/clri/Makefile : 1.13 2381.60Smrgfile sbin/dkctl/Makefile : 1.4 2391.60Smrgfile sbin/dump/Makefile : 1.33 2401.60Smrgfile sbin/fdisk/Makefile : 1.35 2411.60Smrgfile sbin/fsck_ext2fs/Makefile : 1.11 2421.60Smrgfile sbin/fsck_ffs/Makefile : 1.29 2431.60Smrgfile sbin/fsdb/Makefile : 1.18 2441.60Smrgfile sbin/newfs/Makefile : 1.30 2451.60Smrgfile sbin/newfs_sysvbfs/Makefile : 1.2 2461.60Smrgfile sbin/restore/Makefile : 1.23 2471.60Smrgfile sbin/veriexecctl/Makefile : 1.11 2481.64Smrgfile sys/lib/libsa/Makefile : 1.59 2491.68Smrgfile sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24 2501.59Smrgfile usr.bin/awk/Makefile : 1.9 2511.64Smrgfile usr.bin/crontab/Makefile : 1.24 2521.60Smrgfile usr.bin/ctags/Makefile : 1.8 2531.61Smrgfile usr.bin/gzip/Makefile : 1.10 2541.60Smrgfile usr.bin/ssh/sftp/Makefile : 1.10 2551.60Smrgfile usr.bin/ssh/ssh/Makefile : 1.25 2561.59Smrgfile usr.bin/vi/build/Makefile : 1.26 2571.60Smrgfile usr.bin/telnet/Makefile : 1.40 2581.60Smrgfile usr.bin/tn3270/tn3270/Makefile : 1.36 2591.60Smrgfile usr.bin/tr/Makefile : 1.4 2601.59Smrgfile usr.sbin/amd/amd/Makefile : 1.27 2611.59Smrgfile usr.sbin/amd/amq/Makefile : 1.14 2621.59Smrgfile usr.sbin/amd/libamu/Makefile : 1.20 2631.59Smrgfile usr.sbin/amd/pawd/Makefile : 1.5 2641.59Smrgfile usr.sbin/bind/Makefile.inc : 1.22 2651.60Smrgfile usr.sbin/bind/libdns/Makefile : 1.3 2661.60Smrgfile usr.sbin/bind/named/Makefile : 1.17 2671.60Smrgfile usr.sbin/bootp/bootptest/Makefile : 1.2 2681.60Smrgfile usr.sbin/chrtbl/Makefile : 1.6 2691.60Smrgfile usr.sbin/cron/Makefile : 1.12 2701.59Smrgfile usr.sbin/dhcp/Makefile.inc : 1.20 2711.60Smrgfile usr.sbin/hprop/Makefile : 1.13 2721.60Smrgfile usr.sbin/installboot/Makefile : 1.35 2731.59Smrgfile usr.sbin/ipf/ipftest/Makefile : 1.32 2741.59Smrgfile usr.sbin/isdn/isdnd/Makefile : 1.6 2751.59Smrgfile usr.sbin/isdn/isdnmonitor/Makefile : 1.3 2761.59Smrgfile usr.sbin/isdn/isdntel/Makefile : 1.2 2771.59Smrgfile usr.sbin/isdn/isdntrace/Makefile : 126 2781.61Smrgfile usr.sbin/mopd/common/Makefile : 1.10 2791.61Smrgfile usr.sbin/mopd/mopd/Makefile : 1.9 2801.61Smrgfile usr.sbin/mopd/mopprobe/Makefile : 1.7 2811.60Smrgfile usr.sbin/makefs/Makefile : 1.17 2821.60Smrgfile usr.sbin/mscdlabel/Makefile : 1.5 2831.60Smrgfile usr.sbin/pkg_install/add/Makefile : 1.7 2841.60Smrgfile usr.sbin/pkg_install/create/Makefile : 1.5 2851.60Smrgfile usr.sbin/pkg_install/lib/Makefile : 1.28 2861.59Smrgfile usr.sbin/ntp/ntpd/Makefile : 1.10/1.11 2871.59Smrgfile usr.sbin/ntp/ntptime/Makefile : 1.4/1.5 2881.59Smrgfile usr.sbin/pppd/Makefile.inc : 1.3 2891.59Smrgfile usr.sbin/pppd/pppd/Makefile : 1.38 2901.60Smrgfile usr.sbin/rarpd/Makefile : 1.10 2911.59Smrgfile usr.sbin/rbootd/Makefile : 1.10 2921.60Smrgfile usr.sbin/rpc.pcnfsd/Makefile : 1.17 2931.60Smrgfile usr.sbin/tcpdump/Makefile : 1.42 2941.59Smrgdescr 2951.59Smrg GCC 4.1 warns on pointer sign comparision/assignments and lots of 2961.59Smrg code does not conform. For now we use -Wno-pointer-sign and 2971.59Smrg -fno-strict-aliasing. 2981.59Smrgkcah 2991.59Smrg 3001.145Schristoshack disable ctf for gcc-4.8 build 3011.145Schristosmdate April 3 2014 3021.146Swizwho christos 3031.145Schristosfile external/gpl3/gcc/usr.bin/Makefile.frontend : 1.4 3041.145Schristosfile external/gpl3/gcc/usr.bin/Makefile.backend : 1.5 3051.145Schristosdescr 3061.145Schristos nbctfconvert -g -L VERSION -g fold-const.o 3071.145Schristos ERROR: fold-const.c: failed to get mapping for tid 79154 \ 3081.145Schristos ((null)) <13532> 3091.145Schristoskcak 3101.145Schristos 3111.121Schristoshack emacs aborting on exit (libgcc issue) 3121.121Schristosmdate 7 November 2011 3131.121Schristoswho christos 3141.121Schristosfile external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2 3151.121Schristosdescr 3161.121Schristos GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit 3171.121Schristos to do just that. If the symbol requested is not found, then it aborts. 3181.121Schristos emacs 23.3 triggers this assertion. For now disable aborting, and 3191.121Schristos silently ignore. 3201.121Schristoskcah 3211.121Schristos 3221.105Sagchack cross-building hack on Darwin 3231.105Sagcmdate 20 July 2008 3241.105Sagcwho agc 3251.105Sagcfile src/distrib/common/Makefile.mdset : 1.33 3261.105Sagcdescr 3271.105Sagc Darwin has problems with getopt() when used in mdsetimage -v, 3281.105Sagc due to the difference between BSD and libiberty() getopt 3291.105Sagc implementations, more fully described in 3301.105Sagc http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html 3311.105Sagc and the subsequent thread. For just now, we just have an ugly 3321.105Sagc workaround not to call mdsetimage with the -v argument on Darwin 3331.105Sagckcah 3341.105Sagc 3351.109Sveegohack avoid rebuilding asn1 libraries 3361.109Sveegomdate 03 August 2008 3371.109Sveegowho veego 3381.109Sveegofile src/crypto/dist/heimdal/lib/asn1/gen.c : 1.10 3391.109Sveegofile src/lib/libasn1/Makefile : 1.32 3401.109Sveegofile src/lib/libhdb/Makefile : 1.23 3411.109Sveegofile src/lib/libgssapi/Makefile : 1.20 3421.109Sveegofile src/lib/libhx509/Makefile : 1.3 3431.109Sveegopr 9702 39185 3441.109Sveegodescr 3451.109Sveego asn1_compile does not check if generated header files do not have to 3461.109Sveego be rebuild. 3471.109Sveego Generate .hx files and copy it in the Makefiles if they changed. 3481.109Sveegokcah 3491.109Sveego 3501.144Stronhack Disable fortification for /usr/bin/makeinfo 3511.144Stroncdata 24 Mar 2014 3521.144Stronwho tron 3531.186Smayafile src/external/gpl2/texinfo/bin/makeinfo/Makefile : 1.1 3541.144Stronpr N/A 3551.144Strondescr 3561.144Stron If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3 3571.144Stron it fails to process certain texinfo files, e.g. "cl.texi" 3581.144Stron included in the Emacs 24.3 distribution. 3591.144Stronkcah 3601.144Stron 3611.147Stronhack Disable Stack Smash Protection for /usr/X11R7/bin/xauth 3621.147Stroncdata 05 Apr 2014 3631.147Stronwho tron 3641.147Stronfile src/external/mit/xorg/bin/xauth/Makefile : 1.4 3651.147Stronpr N/A 3661.147Strondescr 3671.147Stron If "xauth" is compile with "USE_SSP" set to "yes" it fails 3681.147Stron mysteriously with an error message like this: 3691.147Stron 3701.147Stron /usr/X11R7/bin/xauth: file /foo/bar/.Xauthority does not exist 3711.147Stron /usr/X11R7/bin/xauth: unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority 3721.147Stron 3731.147Stron The compiler seems to get confused about the two filename variables 3741.147Stron used in the link(2) system call. 3751.147Stronkcah 3761.147Stron 3771.162Spookahack g++ 5.x barfs on volatile in constexpr initializers 3781.162Spookacdata 27 Aug 2015 3791.160Spookawho pooka 3801.162Spookafile src/lib/libpthread/pthread_types.h : 1.17 3811.160Spookapr lib/49989 3821.160Spookadescr 3831.160Spooka Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER 3841.160Spooka in C++ results in: 3851.160Spooka error: temporary of non-literal type '__pthread_mutex_st' 3861.160Spooka in a constant expression 3871.160Spooka constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} 3881.160Spooka [...] 3891.160Spooka include/pthread_types.h:101:8: note: '__pthread_mutex_st' is 3901.160Spooka not literal because: 3911.160Spooka struct __pthread_mutex_st { 3921.160Spooka ^ 3931.160Spooka include/pthread_types.h:103:17: note: non-static data 3941.160Spooka member '__pthread_mutex_st::ptm_errorcheck' has volatile type 3951.160Spooka pthread_spin_t ptm_errorcheck; 3961.160Spookakcah 3971.160Spooka 3981.163Schristoshack libm cabs{,f,l} and g++ 3991.163Schristoscdata 11 Jan 2016 4001.163Schristoswho christos 4011.163Schristospr lib/50646 4021.163Schristosfile src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2 4031.163Schristosfile src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2 4041.163Schristosdescr 4051.163Schristos Our cabs and cabsf have a different argument format on some architectures 4061.163Schristos and for that we have created in libm/compat_cabs{,f}.c. The standard 4071.163Schristos versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in 4081.163Schristos <complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they 4091.163Schristos translate by default to cabs{,f,l} which gets defined to cabs{,f} (the 4101.163Schristos wrong function) and an undefined cabsl. I've changed <complex> to use 4111.163Schristos the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is 4121.163Schristos still broken. 4131.163Schristoskcah 4141.163Schristos 4151.21Smycroftport vax 4161.21Smycroft 4171.102Stsutsui hack gcc4/vax ICE 4181.203Srin cdate Sat Dec 22 08:17:57 2007 UTC 4191.102Stsutsui who tsutsui 4201.203Srin file sys/arch/vax/conf/Makefile.vax : 1.79 4211.102Stsutsui descr 4221.102Stsutsui GCC4 on vax gets ICE on compiling sys/ddb/db_command.c. 4231.102Stsutsui -fno-tree-ter prevents it so add it to COPTS. 4241.102Stsutsui kcah 4251.102Stsutsui 4261.81Smrg hack gcc4/vax compiler crash 4271.81Smrg cdate Fri Jun 30 22:39:12 PDT 2006 4281.81Smrg who mrg 4291.81Smrg file bin/csh/Makefile : 1.27 4301.81Smrg file lib/i18n_module/UTF7/Makefile : 1.2 4311.81Smrg descr 4321.81Smrg GCC4 on vax crashes. -O0 stops it happening so far... 4331.81Smrg kcah 4341.81Smrg 4351.54She hack declare boolean_t in two IPF user-mode programs 4361.54She cdate Tue Mar 7 19:19:20 CET 2006 4371.54She who he 4381.54She file dist/ipf/ipsend/iptests.c : 1.8 4391.54She dist/ipf/ipsend/sock.c : 1.7 4401.54She descr 4411.54She The IPF user-mode programs ipsend and iptest first 4421.54She include <sys/types.h> without _KERNEL defined, and 4431.54She later include <sys/file.h> with _KERNEL defined. 4441.54She This causes a build failure when building for vax, 4451.54She since <sys/device.h> ends up being included without 4461.54She bollean_t being defined by <sys/types.h>. 4471.54She Build failure and further details documented in 4481.54She PR#32907. 4491.54She kcah 4501.54She 4511.104Sgmcgarry hack pcc 0.9.9 large string literals 4521.104Sgmcgarry cdat 8 July 2008 4531.104Sgmcgarry who gmcgarry 4541.104Sgmcgarry file sys/conf/param.c : 1.58 4551.104Sgmcgarry descr 4561.104Sgmcgarry Workaround for pcc 0.9.9 not handling large string literals 4571.104Sgmcgarry which causes kernels with 'options INCLUDE_CONFIG_FILE' to 4581.104Sgmcgarry fail compilation. 4591.104Sgmcgarry There is a proposal on the pcc mailing list to stuff config 4601.104Sgmcgarry file in ELF section. 4611.104Sgmcgarry kcah 4621.104Sgmcgarry 4631.107Smrg hack xorg warnings 4641.129Schristos cdat 30 July 2008, 3 June, 2013 4651.107Smrg who mrg 4661.108Smrg file external/mit/xorg/lib/libSM/Makefile : 1.2 4671.129Schristos external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10 4681.107Smrg external/mit/xorg/lib/libXext/Makefile : 1.2 4691.107Smrg external/mit/xorg/lib/libXfont/Makefile : 1.2 4701.107Smrg descr 4711.107Smrg Disable several warnings or use -Wno-error across Xorg sources 4721.107Smrg while we get them working 4731.107Smrg kcah 4741.107Smrg 4751.112Schristos hack 32 bit time leftovers 4761.112Schristos cdat 11 January 2009 4771.112Schristos who christos 4781.112Schristos file lib/libc/time/localtime.c : 1.41 4791.112Schristos lib/libc/time/zic.c : 1.23 4801.112Schristos descr 4811.112Schristos The timezone compiled files still contain 32 bit time_t 4821.112Schristos quantities. I did not want to version the files because 4831.112Schristos the ``parser'' is too ugly for words. What needs to be 4841.112Schristos done, is to rewrite the parser from scratch also to avoid 4851.112Schristos potential core-dumps from parsing invalid files. 4861.112Schristos kcah 4871.112Schristos 4881.112Schristos hack 32 bit time leftovers 4891.112Schristos cdat 11 January 2009 4901.112Schristos who christos 4911.112Schristos file various 4921.112Schristos descr 4931.113Ssketch Many filesystem on-disk formats have 32 bit times. 4941.112Schristos kcah 4951.112Schristos 4961.141Schristos hack gcc 4.5 fsdb miscompile 4971.140Schristos date Sat Nov 9 11:03:02 EST 2013 4981.140Schristos who christos 4991.141Schristos file src/sbin/fsdb/Makefile : 1.36 (and earlier) 5001.140Schristos descr 5011.140Schristos src/sbin/fsdb/fsdb.c: In function 'findblk': 5021.140Schristos src/sbin/fsdb/fsdb.c:610:1: error: unrecognizable insn: 5031.140Schristos (insn 941 940 942 134 src/sbin/fsdb/fsdb.c:589 (set (reg:SI 604) 5041.140Schristos (subreg:SI (mem/s/j:DI (plus:SI (mult:SI (reg:SI 602) 5051.140Schristos (const_int 8 [0x8])) 5061.140Schristos (reg/f:SI 601)) [0 curinode.99_378->dp2.di_ib S8 A32]) 4)) \ 5071.140Schristos -1 (nil)) 5081.140Schristos src/sbin/fsdb/fsdb.c:610:1: internal compiler error: in \ 5091.140Schristos extract_insn, at recog.c:2103 5101.140Schristos kcah 5111.140Schristos 5121.141Schristos hack gcc 4.8 gcc miscompiles 5131.141Schristos date Sat Nov 9 16:35:18 EST 2013 5141.141Schristos who christos 5151.203Srin file distrib/utils/x_ping/Makefile : 1.8 5161.203Srin file distrib/vax/miniroot/Makefile.inc : ? 5171.203Srin file distrib/vax/ramdisk/Makefile : ? 5181.203Srin file external/gpl3/gdb/lib/libdecnumber/Makefile : 1.3 5191.203Srin file sbin/fsdb/Makefile : 1.36 5201.203Srin file sbin/newfs_ext2fs/Makefile : 1.6 5211.203Srin file sbin/ping/Makefile : 1.17 5221.203Srin file usr.sbin/mtrace/Makefile : 1.11 5231.141Schristos descr 5241.141Schristos external/gpl3/gcc/dist/gcc/expmed.c:2781:1: 5251.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5261.141Schristos external/gpl3/gcc/dist/gcc/recog.c:770:1: 5271.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5281.141Schristos external/gpl3/gcc/dist/libdecnumber/decNumber.c:7214:3: 5291.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5301.141Schristos sbin/ping/ping.c:679:1: 5311.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5321.141Schristos sbin/newfs_ext2fs/mke2fs.c:681:1: 5331.141Schristos internal compiler error: in reload_combine_note_use, 5341.141Schristos at postreload.c:1561 5351.141Schristos external/gpl3/gdb/dist/libdecnumber/decNumber.c:7214:3: 5361.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5371.141Schristos usr.sbin/mtrace/mtrace.c:1655:1: 5381.141Schristos internal compiler error: in change_address_1, at emit-rtl.c:2019 5391.141Schristos kcah 5401.141Schristos 5411.178Srin hack gcc 5.4 cc1 miscompile 5421.178Srin date Tue Feb 14 07:19:57 JST 2017 5431.178Srin who rin 5441.178Srin pr port-vax/51967 5451.178Srin file external/gpl3/gcc/usr.bin/backend/Makefile : 1.35 5461.178Srin descr 5471.178Srin cc1 aborts due to SIGILL when compiling the sample code attached 5481.178Srin to the PR. As a workaround, compile dse.c with -O0. 5491.178Srin kcah 5501.178Srin 5511.179Srin hack libssh miscompile 5521.182Srin cdate Tue Feb 14 17:58:06 JST 2017 5531.182Srin mdate Tue Feb 14 18:57:39 JST 2017 5541.179Srin who rin 5551.179Srin file crypto/external/bsd/openssh/lib/Makefile : 1.20 5561.179Srin descr 5571.182Srin poly1305.c and umac.c are miscompiled, which results in login 5581.182Srin failure to/from external hosts via ssh. 5591.179Srin kcah 5601.179Srin 5611.180Srin hack mandoc miscompile 5621.180Srin date Tue Feb 14 18:03:05 JST 2017 5631.180Srin who rin 5641.180Srin file external/bsd/mdocml/lib/libmandoc/Makefile : 1.8 5651.180Srin descr 5661.180Srin mandoc(1) receives SIGILL in in_line_argn() from mdoc_macro.c. 5671.180Srin kcah 5681.180Srin 5691.183Srin hack libX11 miscompile 5701.183Srin date Thu Feb 16 10:00:22 JST 2017 5711.183Srin who rin 5721.183Srin file src/external/mit/xorg/lib/libX11/Makefile.libx11 : 1.18 5731.183Srin descr 5741.183Srin lcWrap.c is miscompiled, which results in input failure via XIM. 5751.184Srin Besides, some clients, e.g., pkgsrc/x11/kterm, receive SIGSEGV. 5761.183Srin kcah 5771.183Srin 5781.21Smycroftport arm 5791.21Smycroft 5801.21Smycroft hack gcc-unsigned-compare 5811.21Smycroft cdate 09 Mar 2002 5821.21Smycroft mdate 18 Mar 2002 5831.21Smycroft who bjh21 5841.21Smycroft file dist/bind/lib/nameser/ns_parse.c : 1.3 5851.21Smycroft file dist/dhcp/minires/ns_parse.c : 1.3 5861.21Smycroft file dist/dhcp/omapip/result.c : 1.2 5871.21Smycroft file dist/dhcp/server/failover.c : 1.3 5881.21Smycroft file gnu/dist/toolchain/bfd/bfd.c : 1.2 5891.21Smycroft file gnu/dist/toolchain/bfd/format.c : 1.2 5901.21Smycroft file gnu/dist/toolchain/gdb/target.c : 1.2 5911.21Smycroft file sys/kern/vfs_subr.c : 1.172 5921.21Smycroft descr When checking that a potentially-unsigned enum is >= 0, assign 5931.21Smycroft it to an int first. This is necessary to avoid "comparison is 5941.21Smycroft always true" warnings with -fshort-enums. Casting to an int 5951.21Smycroft really should be enough, but turns out not to be. 5961.21Smycroft kcah 5971.21Smycroft 5981.122Stsutsui hack gcc-4.5 arm CNAME hostname lookup failure on 5991.122Stsutsui certain DNS environment (probably -ftree-ter problem) 6001.122Stsutsui cdate Sat Dec 24 04:59:00 UTC 2011 6011.122Stsutsui mdate 6021.122Stsutsui who tsutsui 6031.122Stsutsui file lib/libc/net/Makefile.inc 1.79 6041.122Stsutsui descr Hostname lookup against CNAMEs by some commands fails 6051.122Stsutsui on certain DNS environments if lib/libc/net/gethnamaddr.c 6061.122Stsutsui (ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc) 6071.122Stsutsui are compiled with -O2, even though nslookup(1) against 6081.122Stsutsui the same CNAME returns proper hostname. 6091.122Stsutsui They works properly if compiled with -O2 -fno-tree-ter. 6101.122Stsutsui Also -O2 fails but -O2 -fno-tree-ter works on the following 6111.122Stsutsui test case in gcc bugzilla: 6121.122Stsutsui http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4 6131.122Stsutsui kcah 6141.122Stsutsui 6151.21Smycroftport sh3 6161.21Smycroft 6171.74Smrg hack gcc4-sh3-bz2 6181.103Stsutsui cdate Sun May 21 03:34:57 UTC 2006 6191.103Stsutsui mdate Fri May 16 13:13:00 UTC 2008 6201.103Stsutsui who mrg, tsutsui 6211.74Smrg file lib/libbz2/Makefile : 1.10 6221.74Smrg descr 6231.74Smrg The in-tree GCC 4.1-based compiler generated too-far 6241.103Stsutsui pc-relative addresses. Hack is to build with 6251.103Stsutsui -fno-loop-optimize. 6261.74Smrg kcah 6271.74Smrg 6281.96Smrgport m68000 6291.79Smrg 6301.96Smrg hack gcc4-m68000 6311.102Stsutsui cdate Fri Feb 8 10:29:37 PST 2008 6321.102Stsutsui mdate Sun May 4 15:37:19 UTC 2008 6331.99Stsutsui who mrg, tsutsui 6341.96Smrg file rescue/Makefile : 1.21 6351.99Stsutsui file sbin/dump_lfs/Makefile : 1.9 6361.101Stsutsui file sbin/fsck_ffs/Makefile : 1.35 6371.101Stsutsui file sbin/fsdb/Makefile : 1.22 6381.101Stsutsui file share/mk/sys.mk : 1.96 6391.99Stsutsui file usr.sbin/ndbootd/Makefile : 1.5 6401.95Smrg descr 6411.101Stsutsui Several internal compiler errors with gcc -O1 6421.101Stsutsui around 64bit integer arithmetic. 6431.99Stsutsui This hack uses -O1 and adds some -fno-tree-foo options 6441.99Stsutsui to avoid the problem. 6451.101Stsutsui This might be related with GCC Bugzilla Bug 32424. 6461.95Smrg kcah 6471.95Smrg 6481.141Schristosport m68k,sh3,vax 6491.135Schristos 6501.135Schristos hack gcc-4.8.1 6511.135Schristos cdate Wed Nov 6 20:41:35 EST 2013 6521.135Schristos who christos 6531.141Schristos file src/external/gpl3/gcc/libstdc++-v3/Makefile : 1.6 6541.135Schristos descr 6551.135Schristos compile hashtable_c++0x.cc with -O2 instead of -Os to 6561.135Schristos produce missing instantiation of std::lower_bound expansion 6571.135Schristos for unsigned long. 6581.135Schristos kcah 6591.22Smrg 6601.116Smrgport sparc 6611.116Smrg 6621.116Smrg hack avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3 6631.116Smrg cdate Sun Aug 14 19:26:48 PDT 2011 6641.116Smrg who mrg 6651.116Smrg file sys/arch/sparc64/sparc/cpu.c : 1.234 6661.116Smrg file sys/arch/sparc64/sparc/cpuvar.h : 1.90 6671.116Smrg file sys/arch/sparc64/sparc/genassym.cf : 1.67 6681.116Smrg file sys/arch/sparc64/sparc/locore.s : 1.265 6691.116Smrg descr 6701.116Smrg Something is wrong with GCC 4.5.3 and the savefpstate IPI. 6711.116Smrg Post newlock2 there was a bug where a lock was reduced from 6721.116Smrg IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI 6731.116Smrg would crash due to NULL IPI. This was fixed by re-using the 6741.116Smrg right IPL value. However, GCC 4.5.3 build kernels have the 6751.116Smrg same problems. For now, the hack is re-instated. 6761.116Smrg kcah 6771.116Smrg 6781.116Smrg 6791.51Ssimonbport mips 6801.51Ssimonb 6811.51Ssimonb hack mips-shared-linker-load-address 6821.51Ssimonb cdate Fri Oct 7 08:33:10 UTC 2005 6831.51Ssimonb who simonb 6841.51Ssimonb file src/sys/kern/exec_elf32.c : 1.107 6851.51Ssimonb descr 6861.51Ssimonb With COMPAT_16 or previous enabled (which enables 6871.51Ssimonb ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will 6881.51Ssimonb load and run at address 0. The check to fix this in 6891.51Ssimonb rev 1.107 only checks the first psection of the ELF 6901.51Ssimonb executable, which may not be loadable. A more correct 6911.51Ssimonb fix is to check the first loadable psection instead of 6921.51Ssimonb just the first psection. 6931.51Ssimonb kcah 6941.54She 6951.85Smartin hack mips-duplicate-ras-end-label 6961.85Smartin cdate Sat Sep 2 23:29:42 2006 6971.85Smartin who martin 6981.92Schs file src/regress/sys/kern/ras/ras3/Makefile : 1.3 6991.85Smartin descr 7001.85Smartin Add -fno-reorder-blocks to CFLAGS to avoid duplicate 7011.85Smartin labels by duplicated __asm output from RAS_END() 7021.85Smartin macro. 7031.85Smartin kcah 7041.85Smartin 7051.106Slukem hack mips-mcount-assembler-warning 7061.106Slukem cdate Tue Jul 29 14:16:52 UTC 2008 7071.106Slukem who lukem 7081.106Slukem file src/lib/libc/gmon/Makefile.inc : 1.8 7091.106Slukem descr 7101.106Slukem Workaround for PR port-mips/39192. 7111.106Slukem common/lib/libc/gmon/mcount.c generates a (fatal) 7121.106Slukem assembler warning on MIPS: 7131.106Slukem Warning: No .cprestore pseudo-op used in PIC code 7141.106Slukem Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings 7151.106Slukem kcah 7161.106Slukem 7171.82Schristosport i386 7181.82Schristos 7191.84Sdrochner hack use volatile intermediate variable to enforce rounding 7201.84Sdrochner cdate Tue Aug 1 22:15:55 MEST 2006 7211.84Sdrochner who drochner 7221.84Sdrochner file src/lib/libm/src/lrintf.c : 1.4 7231.84Sdrochner file src/lib/libm/src/s_rintf.c : 1.8 7241.84Sdrochner descr 7251.84Sdrochner gcc-4 does subsequent operations on "float" values within 7261.84Sdrochner the i387 FPU without rounding the intermediate results 7271.84Sdrochner kcah 7281.110Smacallan 7291.148Schristosport x86 7301.148Schristos hack turn off optimization for biosdisk_ll.c because otherwise 7311.148Schristos we are pass the wrong arguments to biosdisk_read(). 7321.148Schristos $ cd /usr/src/sys/arch/i386/floppies/bootflopp-com 7331.148Schristos $ qemu-system-i386 -nographic -fda boot-com1.fs -boot a 7341.203Srin cdate Mon Apr 7 21:09:55 2014 UTC 7351.148Schristos who christos 7361.148Schristos file src/sys/arch/i386/stand/lib/Makefile : 1.38 7371.148Schristos descr 7381.148Schristos Turning on DISK_DEBUG shows the problem. We should find 7391.148Schristos out which option is causing this. 7401.148Schristos hcah 7411.148Schristos 7421.110Smacallanport powerpc 7431.110Smacallan 7441.110Smacallan hack avoid using __builtin_return_address(0) because it fails in 7451.110Smacallan Xorg's module loader 7461.110Smacallan cdate Sat Sep 27 03:52:05 UTC 2008 7471.110Smacallan who macallan 7481.110Smacallan file src/libexec/ld.elf_so/rtld.c : 1.121 7491.110Smacallan descr 7501.110Smacallan workaround for PR port-macppc/37812 7511.110Smacallan kcah 7521.110Smacallan 7531.115Smatt hack define TARGET_SECURE_PLT and HAVE_AS_TLS because when 7541.115Smatt building the native compiler via build.sh those don't defined 7551.115Smatt properly. 7561.115Smatt cdate Sat Mar 12 08:00:00 UTC 2011 7571.115Smatt who matt 7581.203Srin file src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h : 1.7 7591.115Smatt descr 7601.115Smatt see above 7611.115Smatt kcah 7621.117Schristos 7631.117Schristosport powerpc64 7641.117Schristos 7651.117Schristos hack include _errno.c in libposix so that __errno resolves. It 7661.117Schristos should resolve from libc's errno, but somehow it does not. 7671.117Schristos Linker bug? 7681.117Schristos cdate Thu Oct 27 13:19:47 EDT 2011 7691.117Schristos who christos 7701.117Schristos file src/lib/libposix/Makefile: 1.15 7711.118Schristos file src/lib/librt/Makefile: 1.14 7721.117Schristos descr 7731.117Schristos workaround for: 7741.117Schristos libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \ 7751.117Schristos R_PPC64_REL24 relocation against symbol `.__errno' 7761.117Schristos kcah 7771.119Schristos 7781.119Schristos hack rename data() function in mdocml to avoid redefined error. 7791.119Schristos Compiler/Assembler bug? 7801.119Schristos cdate Sat Oct 29 11:16:01 EDT 2011 7811.119Schristos who christos 7821.119Schristos file src/external/bsd/mdocml/tbl_data.c: 1.2 7831.119Schristos descr 7841.119Schristos workaround for: 7851.119Schristos {standard input}: Assembler messages: 7861.119Schristos {standard input}:105: Error: symbol `.data' is already \ 7871.119Schristos defined 7881.119Schristos kcah 7891.120Schristos 7901.120Schristosport emips 7911.120Schristos 7921.120Schristos hack Add nop between ctc1 and mtc0 to avoid assembler internal 7931.120Schristos error 7941.120Schristos cdate Sat Oct 29 16:57:34 EDT 2011 7951.120Schristos who christos 7961.120Schristos file src/sys/arch/mips/mips/mips_fpu.c: 1.7 7971.120Schristos descr 7981.120Schristos workaround for: 7991.120Schristos {standard input}: Assembler messages: 8001.120Schristos {standard input}:730: Internal error! 8011.120Schristos Assertion failure in append_insn at /usr/src/external/gpl3/\ 8021.120Schristos binutils/dist/gas/config/tc-mips.c line 2910. 8031.120Schristos kcah 8041.125Smartin 8051.125Smartinport ia64 8061.125Smartin 8071.157Smartin hack libgcc unwind dummy function 8081.157Smartin cdate Fri Apr 17 14:31:03 CEST 2015 8091.157Smartin who martin 8101.157Smartin file src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4 8111.157Smartin descr 8121.157Smartin Add an empty _Unwind_FindTableEntry() implementation. 8131.157Smartin In the end we will use our libc stuff, and this should 8141.157Smartin go away again. 8151.157Smartin kcah 8161.157Smartin 8171.128Schristosport x68k 8181.127Smartin 8191.128Schristos hack compiler error with gcc 4.5.x 8201.128Schristos cdate Fri May 24 13:23:01 EDT 2013 8211.128Schristos who christos 8221.128Schristos file src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17 8231.128Schristos xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11 8241.128Schristos descr 8251.128Schristos workaround for: 8261.128Schristos internal compiler error: in cselib_record_set, at cselib.c:1999 8271.128Schristos kcah 8281.130Sjoerg 8291.130Sjoerghack fallback to /usr/bin/clang-cpp in rpcgen 8301.130Sjoergcdate Wed Jun 5 15:49:27 CEST 2013 8311.130Sjoergwho joerg 8321.203Srinfile src/usr.bin/rpcgen/rpc_main.c : 1.35 8331.130Sjoergdescr 8341.136Sjoerg It is undecided which compiler owns /usr/bin/cpp and whether it should 8351.130Sjoerg exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box, 8361.130Sjoerg if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback. 8371.130Sjoerg This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable. 8381.130Sjoergkcah 8391.131Sskrll 8401.155Sskrllport hppa 8411.131Sskrll 8421.131Sskrll hack compiler error with gcc 4.5.x 8431.131Sskrll cdate Tue Jul 23 07:42:28 BST 2013 8441.131Sskrll who skrll 8451.133Sskrll file src/sys/lib/libkern/Makefile.libkern: 1.26 8461.133Sskrll descr 8471.133Sskrll workaround for unanalysed codegen bug affecting md5c.c. 8481.133Sskrll kcah 8491.149Smacallan 8501.155Sskrll hack gdb vs _rtld_debug_state problem 8511.155Sskrll cdate Thu Mar 5 09:49:53 UTC 2015 8521.155Sskrll who skrll 8531.155Sskrll file src/libexec/ld.elf_so/rtld.c: 1.175 8541.155Sskrll descr 8551.155Sskrll workaround for problem where gdb misses the breakpoint on 8561.155Sskrll _rtld_debug_state when the function is only the 8571.155Sskrll bv,n %r0(%rp) instruction - the nullify seems to 8581.155Sskrll confuse something 8591.155Sskrll kcah 8601.155Sskrll 8611.149Smacallanport mips64* 8621.149Smacallanhack compiler crashes on mips64* with optimization enabled 8631.149Smacallancdate Tue May 13 18:46:48 UTC 2014 8641.149Smacallanwho macallan 8651.149Smacallanfile src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6 8661.149Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5 8671.149Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6 8681.149Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5 8691.149Smacallandescr workaround for n32 gcc doing unaligned 64bit accesses when optimizing 8701.149Smacallanpr 48696 8711.149Smacallankcah 8721.150Smartin 8731.150Smartinport vax 8741.150Smartinhack compile boot with -O1 8751.150Smartincdate Sat May 24 09:40:58 CEST 2014 8761.150Smartinwho martin 8771.150Smartinfile src/sys/arch/vax/boot/boot/Makefile: 1.41 8781.150Smartindescr /boot does not work when compiled with -O2 and gcc 4.8 8791.150Smartinkcah 8801.150Smartin 8811.191Schristosport vax 8821.191Schristoshack compile nir.c in gallium with -O1 8831.191Schristoscdate Mon Oct 28 14:39:35 EDT 2019 8841.191Schristoswho christos 8851.191Schristosfile /cvsroot/src/external/mit/xorg/lib/gallium/Makefile 1.36 8861.191Schristosdescr gallium does not compile. 8871.191Schristoskcah 8881.191Schristos 8891.193Schristosport sh3 8901.193Schristoshack compile parse.c in battlestar with -Wno-restrict 8911.193Schristoscdate Mon Oct 28 14:39:35 EDT 2019 8921.193Schristoswho christos 8931.193Schristosfile /cvsroot/src/games/battlestar/Makefile 1.11 8941.193Schristosdescr fails to compile, confused by char words[][]; 8951.193Schristos strcpy(words[n - 1], words[n + 1]); 8961.193Schristoskcah 8971.193Schristos 8981.194Schristosport sh3 8991.194Schristoshack compile ddns.c in dhcpcd with no-stringop-overflow 9001.194Schristoscdate Tue Oct 29 20:25:59 EDT 2019 9011.194Schristoswho christos 9021.194Schristosfile /cvsroot/src/external/mpl/dhcp/bin/server/Makefile 1.2 9031.194Schristosdescr fails to compile, confused by builtin_object_size in strcat(p, ".in..") 9041.194Schristoskcah 9051.194Schristos 9061.156Smattport arm 9071.156Smatthack avoid using labels in a 12-bit constant. 9081.203Srincdate Mon Mar 30 05:26:47 2015 UTC 9091.156Smattwho matt 9101.156Smattfile crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2 9111.156Smattdescr workaround for clang misassembling an instruction 9121.156Smattkcah 9131.177Schristos 9141.177Schristosport sparc64 9151.177Schristoshack during profiling with -m32 (and ASLR) labels are not generated 9161.177Schristos consistently 9171.203Srincdate Sat Feb 11 04:56:37 2017 UTC 9181.177Schristoswho christos 9191.177Schristosfile /cvsroot/src/crypto/external/bsd/heimdal/lib/libasn1/Makefile: 1.4 9201.177Schristosdesc asn1_krb5_asn1.po does not produce the same results during successive 9211.177Schristos compilation runs; it is bimodal. Turning optimization to -O0 fixes 9221.177Schristos the issue 9231.177Schristoskcah 9241.187Sscole 9251.187Sscoleport ia64 9261.187Sscolehack ski emulator crashes 9271.203Srincdate Sat Apr 8 18:10:43 2017 UTC 9281.187Sscolewho scole 9291.187Sscolefile /cvsroot/src/sys/external/bsd/acpica/dist/tables/tbxfload.c: 1.6 9301.187Sscoledesc 9311.187Sscole ski emulator crashes during acpi detection. Added a check for 9321.187Sscole uninitialized index. Submitted a request for change with upstream 9331.187Sscole mailing list, but never got a response 9341.187Sscolekcah 9351.189Schristos 9361.189Schristosport vax 9371.189Schristoshack compile rtld.c with -O0 9381.189Schristoscdate Wed Apr 3 17:38:38 EDT 2019 9391.189Schristoswho christos 9401.189Schristosfile src/libexec/ld.elf_so/Makefile: 1.141 9411.189Schristosdescr Disable optimization for rtld.c on the vax with gcc-7. Crashes on the 9421.189Schristos second pass loop with elm == 0xffffffff 9431.189Schristoskcah 9441.195Srin 9451.195Srinport alpha 9461.196Srinhack GCC 7.4/8.3: userland binaries crash randomly (port-alpha/54307) 9471.195Srincdate Fri Nov 1 20:43:35 UTC 2019 9481.195Srinwho rin 9491.195Srinfile src/external/bsd/jemalloc/lib/Makefile.inc: 1.11 9501.195Srindescr rtree.c and tcache.c need to be compiled with -O0, alternatively, 9511.195Srin you can compile whole jemalloc with -DJEMALLOC_DEBUG. 9521.195Srinkcah 9531.197Schristos 9541.197Schristosport powerpc 9551.199Schristoshack compile tc.c, logerr.c, ubsan.c with -O0 for clang 9561.197Schristoscdate Wed Jan 29 17:40:19 EST 2020 9571.197Schristoswho christos 9581.197Schristosfile src/external/bsd/atf/lib/libatf-c/Makefile: 1.22 9591.198Schristosfile src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile: 1.49 9601.199Schristosfile src/tests/lib/libc/misc/Makefile: 1.5 9611.199Schristos 9621.199Schristosdescr Disable optimization on tc.c, logerr.c, ubsan.c crashes: 9631.197Schristos lib/libLLVMCodeGen/../../llvm/../../external/apache2/llvm/lib/..\ 9641.197Schristos /dist/llvm/include/llvm/CodeGen/MachineFrameInfo.h", line 495, \ 9651.197Schristos function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const" 9661.197Schristoskcah 9671.202Srin 9681.202Srinport earmv7hf* 9691.202Srinhack compile gdb/dwarf2expr.c with -O0 for GCC8 (toolchain/54820 and 54877) 9701.202Srincdate Wed Apr 29 11:04:58 UTC 2020 9711.202Srinwho rin 9721.202Srinfile src/external/gpl3/gdb/lib/libgdb/Makefile: 1.22 9731.202Srindescr GCC 8.4 miscompiles dwarf2expr.c with -O2 or -O1, which results in 9741.202Srin crashes with 'gdb_exception_RETURN_MASK_ERROR'. Note that this occurs 9751.202Srin only for earmv7hf{,eb} as far as I can see. Neither earmv6hf{,eb} nor 9761.202Srin earmv7{,eb} (softfloat) are affected. 9771.202Srinkcah 9781.208Srin 9791.208Srinport m68k 9801.208Srinhack compile aes_ccm_tag() with -O0 for GCC8 9811.208Srincdate Mon Aug 10 06:27:29 UTC 2020 9821.208Srinwho rin 9831.208Srinfile src/sys/crypto/aes/aes_ccm.c: 1.5 9841.208Srindescr GCC 8.4 miscompiles aes_ccm_tag() for m68k with optimization level 9851.208Srin -O[12], which results in failure in aes_ccm_selftest(). 9861.208Srin This is observed for amiga (A1200, 68060), mac68k (Quadra 840AV, 9871.208Srin 68040), and luna68k (nono, 68030 emulator). However, it is not for 9881.208Srin sun3 (TME, 68020 emulator) and sun2 (TME, 68010 emulator). 9891.208Srin At the moment, it is unclear whether this is due to differences b/w 9901.208Srin 68010-20 vs 68030-60, or something wrong with TME. 9911.208Srinkcah 9921.208Srin 9931.208Srinport sun2 9941.208Srinhack compile kernel with -fno-omit-frame-pointer for GCC8 9951.208Srincdate Mon Aug 10 06:28:42 UTC 2020 9961.208Srinwho rin 9971.208Srinfile src/sys/arch/sun2/conf/Makefile.sun2: 1.25 9981.208Srindescr Work around for reproducible kernel freezes just after ``Starting 9991.208Srin postfix.'', where I cannot even enter DDB nor obtain crash dump. 10001.208Srin I still haven't figured out why. Possibly something wrong with -Os 10011.208Srin optimization level for GCC/m68k, cf., 10021.208Srin http://mail-index.netbsd.org/port-sun3/2020/07/19/msg000166.html 10031.208Srinkcah 1004