1*c9dfb3ddSrin# $NetBSD: HACKS,v 1.247 2024/09/23 07:35:44 rin Exp $ 2cf738336Slukem# 3cf738336Slukem# This file is intended to document workarounds for currently unsolved 4cf738336Slukem# (mostly) compiler bugs. 5cf738336Slukem# 6cf738336Slukem# Format: 7cf738336Slukem# hack title 8cf738336Slukem# cdate creation date 9cf738336Slukem# mdate mod date 10cf738336Slukem# who responsible developer 11cf738336Slukem# port ... 12cf738336Slukem# affected ports, space separated, if not "all" 13cf738336Slukem# file affected file : revision : line from : line to 14cf738336Slukem# affected files and revision and line numbers describing hack 15cf738336Slukem# multiple lines if necessary. 16cf738336Slukem# pr NNNN ... 17cf738336Slukem# problem reports this hack works around, if known. Space 18cf738336Slukem# separated. 19cf738336Slukem# regress src/regress/directory/where/test/found 20cf738336Slukem# regression test directories, if available. 21cf738336Slukem# descr 22cf738336Slukem# insert short informal description (multi-line). (Longer ones 23cf738336Slukem# should be in the PR database. More formal descriptions might 24cf738336Slukem# be in the regress tree. See above). 25cf738336Slukem# kcah 26cf738336Slukem# closing bracket. 27cf738336Slukem# 28cf738336Slukem# this is a comment. 29cf738336Slukem 30e4eb677bSmaxvhack llvm needs no-unused-command-line-argument 31e4eb677bSmaxvmdate 10 May 2020 32e4eb677bSmaxvwho maxv 33e4eb677bSmaxvfile share/mk/bsd.lib.mk 1.380 -> 1.381 34e4eb677bSmaxvdescr 35e4eb677bSmaxv To avoid LLVM warnings when compiling the kernel with special 36e4eb677bSmaxv CFLAGS such as KASAN on amd64 or ARMV83_PAC on aarch64, pass 37e4eb677bSmaxv -Wno-unused-command-line-argument. 38e4eb677bSmaxvkcah 39e4eb677bSmaxv 40a2fcb602Smayahack static linking with libpthread 41a2fcb602Smayamdate 7 May 2019 42a2fcb602Smayawho maya 43504f8303Schristosfile src/lib/libpthread/Makefile 1.92 -> 1.94 44a2fcb602Smayadescr 45a2fcb602Smaya To avoid some libc thread stub functions being picked up 46a2fcb602Smaya in static builds, link pthread as one section. 47a2fcb602Smayakcah 48a2fcb602Smaya 49504f8303Schristoshack disable optimization for gcc-9.3 in src/lib/libc/gdtoa/strtod.c 50504f8303Schristosmdate 18 Sep 2020 51504f8303Schristoswho christos 52504f8303Schristosfile src/lib/libc/gdtoa/strtod.c 1.15 -> 1.16 53504f8303Schristosdescr 54504f8303Schristos See PR/55668, the program there causes infinite loop 55504f8303Schristoskcah 56504f8303Schristos 57d04a36aeSchristoshack gcc-5.3 optimizes memset+malloc -> calloc inside calloc 58d04a36aeSchristosmdate 4 May 2016 59d04a36aeSchristoswho christos 60d04a36aeSchristosfile external/gpl2/lib/libmalloc/lib/Makefile 1.3 -> 1.5 61d04a36aeSchristosdescr 62d04a36aeSchristos resulting in infinite recursion; we prevent this with 63d04a36aeSchristos -fno-builtin-malloc 64d04a36aeSchristoskcah 65d04a36aeSchristos 66d8ed176fSmrghack turn off tree-vrp for parts of ufs_lookup.c 67d8ed176fSmrgmdate 28 April 2016 68d8ed176fSmrgwho mrg christos 69d8ed176fSmrgfile src/sys/ufs/ufs/ufs_lookup.c : 1.144 70d8ed176fSmrgpr 51094 71d8ed176fSmrgdescr 72d8ed176fSmrg with -ftree-vrp enabled in ufs_lookup.c sometimes bad dir 73d8ed176fSmrg panicks are see. 74d8ed176fSmrghcah 75d8ed176fSmrg 76cf738336Slukemhack netstat ieee1394 address printing. 77cf738336Slukemmdate 14 Nov 2000 78cf738336Slukemwho matt 79cf738336Slukemfile lib/libc/net/getnameinfo.c : 1.32 : 497 : 503 80cf738336Slukemdescr 81cf738336Slukem Because the current implementation of IP over IEEE1394, the 82cf738336Slukem fw device address contains more than just the IEEE1394 EUI-64. 83cf738336Slukem So when printing out IEEE1394 addresses, ignore the extra stuff. 84cf738336Slukemkcah 85cf738336Slukem 86cf738336Slukemhack xterm vs. libterm 87cf738336Slukemmdate 01 Aug 2000 88cf738336Slukemwho jdc 89cf738336Slukemfile xsrc/xc/programs/xterm/main.c : 1.2 : 3609 : 3614 90cf738336Slukempr 10383 91cf738336Slukemdescr 92cf738336Slukem In order to extend the termcap string over 1023 bytes, a ZZ entry was 93cf738336Slukem introduced to point to a memory location containing the full entry. 94cf738336Slukem Without this hack, xterm will export a termcap containing the ZZ 95cf738336Slukem entry, which will then be ignored by libterm. As xterm modifies the 96cf738336Slukem exported termcap, this would cause those modifications to be ignored. 97cf738336Slukemkcah 98cf738336Slukem 99cf738336Slukemhack wi-at-big-endian-bus 100cf738336Slukemcdate 15 Mar 2002 101cf738336Slukemwho martin 102013fdb9eSrinfile dev/ic/wireg.h : 1.20 103cf738336Slukemdescr Add an option to access the underlying bus in big endian byte order 104cf738336Slukem to work around deficiencies in bus_space_{read,write}_* macros. 105cf738336Slukem Those don't allow the implementation of a proper pcmcia bus space 106cf738336Slukem tag. 107cf738336Slukemkcah 108cf738336Slukem 1090ed79825Sjdchack specific knowledge of colours in curses code 1100ed79825Sjdccdate Sun Apr 6 11:05:24 BST 2003 1110ed79825Sjdcwho jdc 1120ed79825Sjdcfile lib/libcurses/color.c : r1.24 1130ed79825Sjdcdescr 1140ed79825Sjdc Swap red/blue and yellow/cyan colours for COLOR_OTHER. 1150ed79825Sjdc Fix is to enhance libtermcap to understand terminfo-style % sequences. 1160ed79825Sjdc See also: 1170a6047a9Ssalo http://mail-index.NetBSD.org/tech-userlevel/2003/04/06/0000.html 1180ed79825Sjdckcah 11908cfcbf2Sscw 120eda774d8Shehack Compensation for differing types of LINUX_USRSTACK and USRSTACK 121eda774d8Shecdate 21 Aug 2003 122eda774d8Shewho he 123eda774d8Shefile sys/miscfs/procfs/procfs_linux.c : 1.14 124eda774d8Shedescr 125eda774d8She Not all ports have LINUX_USRSTACK and/or USRSTACK defined as 126eda774d8She literals/constants, but refer to variables of a type which is 127eda774d8She not "unsigned long", causing compilation of procfs_linux.c to 128eda774d8She fail with "makes integer from pointer without a cast". This 129eda774d8She is observed on e.g. the sun3 port. Ideally the "types" for 130eda774d8She symbols should be consistent across all ports. 131eda774d8Shekcah 1326c22027cSlukem 13340acc0a8Stsutsuihack gcc4 wrong uninitialized variable 13406d7a226Smrgmdate 10 May 2006 13506d7a226Smrgwho mrg 13606d7a226Smrgfile bin/ksh/eval.c : 1.6 13706d7a226Smrgfile bin/sh/histedit.c : 1.39 13806d7a226Smrgfile bin/sh/parser.c : 1.60 13906d7a226Smrgfile crypto/dist/heimdal/kdc/524.c : 1.10 14006d7a226Smrgfile crypto/dist/ssh/sftp.c : 1.20 14106d7a226Smrgfile crypto/dist/ssh/ssh-keysign.c : 1.11 14206d7a226Smrgfile dist/ipf/lib/hostname.c : 1.2 14306d7a226Smrgfile dist/ipf/tools/ipmon.c : 1.8 14484b83327Smrgfile dist/ntp/ntpd/ntp_request.c : 1.4 14506d7a226Smrgfile dist/ntp/ntpd/refclock_shm.c : 1.4 14606d7a226Smrgfile dist/ntp/sntp/timing.c : 1.3 14706d7a226Smrgfile dist/pppd/pppstats/pppstats.c : 1.3 14806d7a226Smrgfile dist/tcpdump/print-zephyr.c : 1.5 14945598cd2Smrgfile distrib/utils/sysinst/aout2elf.c : 1.12 15006d7a226Smrgfile gnu/libexec/uucp/uucico/uucico.c : 1.6 15106d7a226Smrgfile lib/libc/citrus/citrus_csmapper.c : 1.6 15206d7a226Smrgfile lib/libc/citrus/citrus_pivot_factory.c : 1.5 15306d7a226Smrgfile lib/libc/inet/inet_cidr_ntop.c : 1.3 15406d7a226Smrgfile lib/libc/inet/inet_ntop.c : 1.3 15506d7a226Smrgfile lib/libc/stdio/vfwprintf.c : 1.8 1569200f663Smrgfile libexec/ld.elf_so/arch/m68k/mdreloc.c : 1.20 157a4337fd0Smrgfile libexec/ld.elf_so/arch/powerpc/ppc_reloc.c : 1.40 15853751ce0Smrgfile libexec/ld.elf_so/arch/sh3/mdreloc.c : 1.22 1599200f663Smrgfile libexec/ld.elf_so/arch/sparc/mdreloc.c : 1.39 16006d7a226Smrgfile libexec/ld.elf_so/arch/sparc64/mdreloc.c : 1.39 16153751ce0Smrgfile libexec/ld.elf_so/arch/vax/mdreloc.c : 1.21 162d0a17c26Sdanfile libexec/ld.elf_so/arch/x86_64/mdreloc.c : 1.27 16306d7a226Smrgfile sbin/fsck_ext2fs/dir.c : 1.19 16406d7a226Smrgfile sbin/routed/rtquery/rtquery.c : 1.18 16560693294Sdanfile sys/arch/amd64/amd64/pmap.c : 1.26 1669bf1d4a9Smrgfile sys/arch/i386/pci/piixpcib.c : 1.4 16740acc0a8Stsutsuifile sys/arch/m68k/m68k/pmap_motorola.c : 1.4 16806d7a226Smrgfile sys/crypto/cast128/cast128.c : 1.9 16906d7a226Smrgfile sys/ddb/db_command.c : 1.86 17045598cd2Smrgfile sys/dev/cardbus/cardbus_map.c : 1.21 17106d7a226Smrgfile sys/dev/fss.c : 1.25 1729200f663Smrgfile sys/dev/ic/igsfb.c : 1.39 17345598cd2Smrgfile sys/dev/ic/mb86950.c : 1.5 17406d7a226Smrgfile sys/dev/ic/midway.c : 1.71 17545598cd2Smrgfile sys/dev/kttcp.c : 1.18 17645598cd2Smrgfile sys/dev/rasops/rasops_bitops.h : 1.9 17745598cd2Smrgfile sys/dev/pci/cmpci.c : 1.31 17806d7a226Smrgfile sys/dev/pci/machfb.c : 1.45 17945598cd2Smrgfile sys/dev/usb/ohci.c : 1.174 18045598cd2Smrgfile sys/dev/usb/uhci.c : 1.196 18145598cd2Smrgfile sys/dev/rasops/rasops_bitops.h : 1.9 18206d7a226Smrgfile sys/dist/ipf/netinet/ip_nat.c : 1.10 18306d7a226Smrgfile sys/dist/ipf/netinet/ip_rpcb_pxy.c : 1.8 18406d7a226Smrgfile sys/dist/pf/net/pf.c : 1.22 1853d0c01fdSmrgfile sys/fs/udf/udf_vnops.c : 1.4 18606d7a226Smrgfile sys/kern/kern_sig.c : 1.219 18706d7a226Smrgfile sys/kern/tty.c : 1.181 18806d7a226Smrgfile sys/net/bpf.c : 1.116 18906d7a226Smrgfile sys/net/zlib.c : 1.26 19045598cd2Smrgfile sys/netccitt/if_x25subr.c : 1.37 19106d7a226Smrgfile sys/netinet/in.c : 1.107 19206d7a226Smrgfile sys/nfs/nfs_serv.c : 1.108 19306d7a226Smrgfile sys/nfs/nfs_socket.c : 1.129 19406d7a226Smrgfile sys/nfs/nfs_syscalls.c : 1.91 19506d7a226Smrgfile sys/ufs/lfs/lfs_vfsops.c : 1.207 [also (char *)] 19606d7a226Smrgfile usr.bin/ftp/ftp.c : 1.140 19706d7a226Smrgfile usr.bin/find/function.c : 1.54 19806d7a226Smrgfile usr.bin/mail/tty.c : 1.20 199b52282c7Stsutsuifile usr.bin/msgc/msg_sys.def : 1.33-1.34 20006d7a226Smrgfile usr.bin/nl/nl.c : 1.7 20106d7a226Smrgfile usr.bin/systat/keyboard.c : 1.23 20206d7a226Smrgfile usr.bin/usbhidctl/usbhid.c : 1.29 20306d7a226Smrgfile usr.bin/vi/cl/cl_read.c : 1.5 20406d7a226Smrgfile usr.bin/vi/ex/ex_cscope.c : 1.12 20506d7a226Smrgfile usr.bin/vi/ex/ex_tag.c : 1.19 20606d7a226Smrgfile usr.bin/vi/vi/v_txt.c : 1.15 20706d7a226Smrgfile usr.sbin/altq/altqstat/qdisc_rio.c : 1.4 20806d7a226Smrgfile usr.sbin/cron/do_command.c : 1.19 20906d7a226Smrgfile usr.sbin/timed/timed/slave.c : 1.15 21006d7a226Smrgdescr 21106d7a226Smrg GCC 4.1 gets many uninitialised variable warnings wrong. We should 21206d7a226Smrg really audit all the old hacks like this when older compilers are 21306d7a226Smrg removed from the tree, as many are probably no longer required. 2143416405dSchristos The problem is that it does not recognize initialization via function 2153416405dSchristos call pointer. I.e. 2163416405dSchristos int p; 2173416405dSchristos foo(&p); 2183416405dSchristos does not mark p as initialized. 21906d7a226Smrgkcah 22006d7a226Smrg 2213d0c01fdSmrghack gcc4 pointer sign and strict aliasing problems 2223d0c01fdSmrgmdate 10 May 2006 2233d0c01fdSmrgwho mrg 2243d0c01fdSmrgfile bin/ed/Makefile : 1.33 22545598cd2Smrgfile distrib/utils/sysinst/Makefile.inc : 1.44 226fba603e2Smartinfile distrib/utils/x_dhclient/Makefile : 1.15 2271751f5c2Smrgfile games/bcd/Makefile : 1.5 2281751f5c2Smrgfile games/dab/Makefile : 1.5 2291751f5c2Smrgfile games/larn/Makefile : 1.17 2301751f5c2Smrgfile games/pom/Makefile : 1.5 2311751f5c2Smrgfile lib/libasn1/Makefile : 1.26 2321751f5c2Smrgfile lib/libcrypt/Makefile : 1.17 2331751f5c2Smrgfile lib/libgssapi/Makefile : 1.16 2341751f5c2Smrgfile lib/libhdb/Makefile : 1.20 2351751f5c2Smrgfile lib/libkadm5clnt/Makefile : 1.21 2361751f5c2Smrgfile lib/libkadm5srv/Makefile : 1.25 2371751f5c2Smrgfile lib/libkrb5/Makefile : 1.35 2381751f5c2Smrgfile lib/libssh/Makefile : 1.6 2391751f5c2Smrgfile lib/libtelnet/Makefile : 1.26 2401751f5c2Smrgfile libexec/getty/Makefile : 1.14 2411751f5c2Smrgfile libexec/kadmind/Makefile : 1.19 2421751f5c2Smrgfile libexec/kpasswdd/Makefile : 1.14 2431751f5c2Smrgfile sbin/atactl/Makefile : 1.3 2441751f5c2Smrgfile sbin/cgdconfig/Makefile : 1.7 2451751f5c2Smrgfile sbin/clri/Makefile : 1.13 2461751f5c2Smrgfile sbin/dkctl/Makefile : 1.4 2471751f5c2Smrgfile sbin/dump/Makefile : 1.33 2481751f5c2Smrgfile sbin/fdisk/Makefile : 1.35 2491751f5c2Smrgfile sbin/fsck_ext2fs/Makefile : 1.11 2501751f5c2Smrgfile sbin/fsck_ffs/Makefile : 1.29 2511751f5c2Smrgfile sbin/fsdb/Makefile : 1.18 2521751f5c2Smrgfile sbin/newfs/Makefile : 1.30 2531751f5c2Smrgfile sbin/newfs_sysvbfs/Makefile : 1.2 2541751f5c2Smrgfile sbin/restore/Makefile : 1.23 2551751f5c2Smrgfile sbin/veriexecctl/Makefile : 1.11 2565f1d5cdbSmrgfile sys/lib/libsa/Makefile : 1.59 25745598cd2Smrgfile sys/arch/evbarm/adi_brh/brh_machdep.c : 1.24 2583d0c01fdSmrgfile usr.bin/awk/Makefile : 1.9 2595f1d5cdbSmrgfile usr.bin/crontab/Makefile : 1.24 2601751f5c2Smrgfile usr.bin/ctags/Makefile : 1.8 26167b1d93cSmrgfile usr.bin/gzip/Makefile : 1.10 2621751f5c2Smrgfile usr.bin/ssh/sftp/Makefile : 1.10 2631751f5c2Smrgfile usr.bin/ssh/ssh/Makefile : 1.25 2643d0c01fdSmrgfile usr.bin/vi/build/Makefile : 1.26 2651751f5c2Smrgfile usr.bin/telnet/Makefile : 1.40 2661751f5c2Smrgfile usr.bin/tn3270/tn3270/Makefile : 1.36 2671751f5c2Smrgfile usr.bin/tr/Makefile : 1.4 2683d0c01fdSmrgfile usr.sbin/amd/amd/Makefile : 1.27 2693d0c01fdSmrgfile usr.sbin/amd/amq/Makefile : 1.14 2703d0c01fdSmrgfile usr.sbin/amd/libamu/Makefile : 1.20 2713d0c01fdSmrgfile usr.sbin/amd/pawd/Makefile : 1.5 2723d0c01fdSmrgfile usr.sbin/bind/Makefile.inc : 1.22 2731751f5c2Smrgfile usr.sbin/bind/libdns/Makefile : 1.3 2741751f5c2Smrgfile usr.sbin/bind/named/Makefile : 1.17 2751751f5c2Smrgfile usr.sbin/bootp/bootptest/Makefile : 1.2 2761751f5c2Smrgfile usr.sbin/chrtbl/Makefile : 1.6 2771751f5c2Smrgfile usr.sbin/cron/Makefile : 1.12 2783d0c01fdSmrgfile usr.sbin/dhcp/Makefile.inc : 1.20 2791751f5c2Smrgfile usr.sbin/hprop/Makefile : 1.13 2801751f5c2Smrgfile usr.sbin/installboot/Makefile : 1.35 2813d0c01fdSmrgfile usr.sbin/ipf/ipftest/Makefile : 1.32 2823d0c01fdSmrgfile usr.sbin/isdn/isdnd/Makefile : 1.6 2833d0c01fdSmrgfile usr.sbin/isdn/isdnmonitor/Makefile : 1.3 2843d0c01fdSmrgfile usr.sbin/isdn/isdntel/Makefile : 1.2 2853d0c01fdSmrgfile usr.sbin/isdn/isdntrace/Makefile : 126 28667b1d93cSmrgfile usr.sbin/mopd/common/Makefile : 1.10 28767b1d93cSmrgfile usr.sbin/mopd/mopd/Makefile : 1.9 28867b1d93cSmrgfile usr.sbin/mopd/mopprobe/Makefile : 1.7 2891751f5c2Smrgfile usr.sbin/makefs/Makefile : 1.17 2901751f5c2Smrgfile usr.sbin/mscdlabel/Makefile : 1.5 2911751f5c2Smrgfile usr.sbin/pkg_install/add/Makefile : 1.7 2921751f5c2Smrgfile usr.sbin/pkg_install/create/Makefile : 1.5 2931751f5c2Smrgfile usr.sbin/pkg_install/lib/Makefile : 1.28 2943d0c01fdSmrgfile usr.sbin/ntp/ntpd/Makefile : 1.10/1.11 2953d0c01fdSmrgfile usr.sbin/ntp/ntptime/Makefile : 1.4/1.5 2963d0c01fdSmrgfile usr.sbin/pppd/Makefile.inc : 1.3 2973d0c01fdSmrgfile usr.sbin/pppd/pppd/Makefile : 1.38 2981751f5c2Smrgfile usr.sbin/rarpd/Makefile : 1.10 2993d0c01fdSmrgfile usr.sbin/rbootd/Makefile : 1.10 3001751f5c2Smrgfile usr.sbin/rpc.pcnfsd/Makefile : 1.17 3011751f5c2Smrgfile usr.sbin/tcpdump/Makefile : 1.42 3023d0c01fdSmrgdescr 3030fff63c9Swiz GCC 4.1 warns on pointer sign comparison/assignments and lots of 3043d0c01fdSmrg code does not conform. For now we use -Wno-pointer-sign and 3053d0c01fdSmrg -fno-strict-aliasing. 3063d0c01fdSmrgkcah 3073d0c01fdSmrg 3082863807fSchristoshack disable ctf for gcc-4.8 build 3092863807fSchristosmdate April 3 2014 31018e5ee87Swizwho christos 3112863807fSchristosfile external/gpl3/gcc/usr.bin/Makefile.frontend : 1.4 3122863807fSchristosfile external/gpl3/gcc/usr.bin/Makefile.backend : 1.5 3132863807fSchristosdescr 3142863807fSchristos nbctfconvert -g -L VERSION -g fold-const.o 3152863807fSchristos ERROR: fold-const.c: failed to get mapping for tid 79154 \ 3162863807fSchristos ((null)) <13532> 3172863807fSchristoskcak 3182863807fSchristos 319d08c0f06Schristoshack emacs aborting on exit (libgcc issue) 320d08c0f06Schristosmdate 7 November 2011 321d08c0f06Schristoswho christos 322d08c0f06Schristosfile external/gpl3/gcc/dist/gcc/unwind-dw2-fde.c : 1.2 323d08c0f06Schristosdescr 324d08c0f06Schristos GCC 4.5.3 now calls __unregister_frame_info_bases() on unloading/exit 325d08c0f06Schristos to do just that. If the symbol requested is not found, then it aborts. 326d08c0f06Schristos emacs 23.3 triggers this assertion. For now disable aborting, and 327d08c0f06Schristos silently ignore. 328d08c0f06Schristoskcah 329d08c0f06Schristos 3301aa0a071Sagchack cross-building hack on Darwin 3311aa0a071Sagcmdate 20 July 2008 3321aa0a071Sagcwho agc 3331aa0a071Sagcfile src/distrib/common/Makefile.mdset : 1.33 3341aa0a071Sagcdescr 3351aa0a071Sagc Darwin has problems with getopt() when used in mdsetimage -v, 3361aa0a071Sagc due to the difference between BSD and libiberty() getopt 3371aa0a071Sagc implementations, more fully described in 3381aa0a071Sagc http://mail-index.netbsd.org/current-users/2008/06/27/msg003242.html 3391aa0a071Sagc and the subsequent thread. For just now, we just have an ugly 3401aa0a071Sagc workaround not to call mdsetimage with the -v argument on Darwin 3411aa0a071Sagckcah 3421aa0a071Sagc 343cca63e16Sveegohack avoid rebuilding asn1 libraries 344cca63e16Sveegomdate 03 August 2008 345cca63e16Sveegowho veego 346cca63e16Sveegofile src/crypto/dist/heimdal/lib/asn1/gen.c : 1.10 347cca63e16Sveegofile src/lib/libasn1/Makefile : 1.32 348cca63e16Sveegofile src/lib/libhdb/Makefile : 1.23 349cca63e16Sveegofile src/lib/libgssapi/Makefile : 1.20 350cca63e16Sveegofile src/lib/libhx509/Makefile : 1.3 351cca63e16Sveegopr 9702 39185 352cca63e16Sveegodescr 353cca63e16Sveego asn1_compile does not check if generated header files do not have to 354cca63e16Sveego be rebuild. 355cca63e16Sveego Generate .hx files and copy it in the Makefiles if they changed. 356cca63e16Sveegokcah 357cca63e16Sveego 358067da39eStronhack Disable fortification for /usr/bin/makeinfo 359067da39eStroncdata 24 Mar 2014 360067da39eStronwho tron 36185fb2748Smayafile src/external/gpl2/texinfo/bin/makeinfo/Makefile : 1.1 362067da39eStronpr N/A 363067da39eStrondescr 364067da39eStron If "makeinfo" is compiled with "-D_FORTIFY_SOURCE=2" using GCC 4.8.3 365067da39eStron it fails to process certain texinfo files, e.g. "cl.texi" 366067da39eStron included in the Emacs 24.3 distribution. 367067da39eStronkcah 368067da39eStron 36920378f9eStronhack Disable Stack Smash Protection for /usr/X11R7/bin/xauth 37020378f9eStroncdata 05 Apr 2014 37120378f9eStronwho tron 37220378f9eStronfile src/external/mit/xorg/bin/xauth/Makefile : 1.4 37320378f9eStronpr N/A 37420378f9eStrondescr 37520378f9eStron If "xauth" is compile with "USE_SSP" set to "yes" it fails 37620378f9eStron mysteriously with an error message like this: 37720378f9eStron 37820378f9eStron /usr/X11R7/bin/xauth: file /foo/bar/.Xauthority does not exist 37920378f9eStron /usr/X11R7/bin/xauth: unable to link authority file /foo/bar/.Xauthority, use /foo/bar/.Xauthority 38020378f9eStron 38120378f9eStron The compiler seems to get confused about the two filename variables 38220378f9eStron used in the link(2) system call. 38320378f9eStronkcah 38420378f9eStron 385a3a16859Spookahack g++ 5.x barfs on volatile in constexpr initializers 386a3a16859Spookacdata 27 Aug 2015 38770880704Spookawho pooka 388a3a16859Spookafile src/lib/libpthread/pthread_types.h : 1.17 38970880704Spookapr lib/49989 39070880704Spookadescr 39170880704Spooka Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER 39270880704Spooka in C++ results in: 39370880704Spooka error: temporary of non-literal type '__pthread_mutex_st' 39470880704Spooka in a constant expression 39570880704Spooka constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} 39670880704Spooka [...] 39770880704Spooka include/pthread_types.h:101:8: note: '__pthread_mutex_st' is 39870880704Spooka not literal because: 39970880704Spooka struct __pthread_mutex_st { 40070880704Spooka ^ 40170880704Spooka include/pthread_types.h:103:17: note: non-static data 40270880704Spooka member '__pthread_mutex_st::ptm_errorcheck' has volatile type 40370880704Spooka pthread_spin_t ptm_errorcheck; 40470880704Spookakcah 40570880704Spooka 4067801ee00Schristoshack libm cabs{,f,l} and g++ 4077801ee00Schristoscdata 11 Jan 2016 4087801ee00Schristoswho christos 4097801ee00Schristospr lib/50646 4107801ee00Schristosfile src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex : 1.2 4117801ee00Schristosfile src/external/gpl3/gcc/dist/libstdc++-v3/include/std/complex : 1.2 4127801ee00Schristosdescr 4137801ee00Schristos Our cabs and cabsf have a different argument format on some architectures 4147801ee00Schristos and for that we have created in libm/compat_cabs{,f}.c. The standard 4157801ee00Schristos versions in libc are __c99_cabs{,f,l} and there are __RENAME()'s in 4167801ee00Schristos <complex.h>. G++ uses __builtin_cabs{,f,l} to implement those and they 4177801ee00Schristos translate by default to cabs{,f,l} which gets defined to cabs{,f} (the 4187801ee00Schristos wrong function) and an undefined cabsl. I've changed <complex> to use 4197801ee00Schristos the __c99_cabs{,f,l} directly. Using the __builtin_cabs{,f,l} in gcc is 4207801ee00Schristos still broken. 4217801ee00Schristoskcah 4227801ee00Schristos 423772577a8Smycroftport vax 424772577a8Smycroft 42534454f1bSchristos hack gcc10/vax ICE 42634454f1bSchristos cdate Sun Jan 22 15:37:56 EST 2023 42734454f1bSchristos who christos 42834454f1bSchristos file external/mit/xorg/lib/fontconfig/src/Makefile : 1.28 42934454f1bSchristos descr 43034454f1bSchristos Disable optimization on some files 43134454f1bSchristos kcah 43234454f1bSchristos 4333367ee47Stsutsui hack gcc4/vax ICE 434013fdb9eSrin cdate Sat Dec 22 08:17:57 2007 UTC 4353367ee47Stsutsui who tsutsui 436013fdb9eSrin file sys/arch/vax/conf/Makefile.vax : 1.79 4373367ee47Stsutsui descr 4383367ee47Stsutsui GCC4 on vax gets ICE on compiling sys/ddb/db_command.c. 4393367ee47Stsutsui -fno-tree-ter prevents it so add it to COPTS. 4403367ee47Stsutsui kcah 4413367ee47Stsutsui 4427d067137Smrg hack gcc4/vax compiler crash 4437d067137Smrg cdate Fri Jun 30 22:39:12 PDT 2006 4447d067137Smrg who mrg 4457d067137Smrg file bin/csh/Makefile : 1.27 4467d067137Smrg file lib/i18n_module/UTF7/Makefile : 1.2 4477d067137Smrg descr 4487d067137Smrg GCC4 on vax crashes. -O0 stops it happening so far... 4497d067137Smrg kcah 4507d067137Smrg 451f1cd142fShe hack declare boolean_t in two IPF user-mode programs 452f1cd142fShe cdate Tue Mar 7 19:19:20 CET 2006 453f1cd142fShe who he 454f1cd142fShe file dist/ipf/ipsend/iptests.c : 1.8 455f1cd142fShe dist/ipf/ipsend/sock.c : 1.7 456f1cd142fShe descr 457f1cd142fShe The IPF user-mode programs ipsend and iptest first 458f1cd142fShe include <sys/types.h> without _KERNEL defined, and 459f1cd142fShe later include <sys/file.h> with _KERNEL defined. 460f1cd142fShe This causes a build failure when building for vax, 461f1cd142fShe since <sys/device.h> ends up being included without 462f1cd142fShe bollean_t being defined by <sys/types.h>. 463f1cd142fShe Build failure and further details documented in 464f1cd142fShe PR#32907. 465f1cd142fShe kcah 466f1cd142fShe 467fb80c8cdSgmcgarry hack pcc 0.9.9 large string literals 468fb80c8cdSgmcgarry cdat 8 July 2008 469fb80c8cdSgmcgarry who gmcgarry 470fb80c8cdSgmcgarry file sys/conf/param.c : 1.58 471fb80c8cdSgmcgarry descr 472fb80c8cdSgmcgarry Workaround for pcc 0.9.9 not handling large string literals 473fb80c8cdSgmcgarry which causes kernels with 'options INCLUDE_CONFIG_FILE' to 474fb80c8cdSgmcgarry fail compilation. 475fb80c8cdSgmcgarry There is a proposal on the pcc mailing list to stuff config 476fb80c8cdSgmcgarry file in ELF section. 477fb80c8cdSgmcgarry kcah 478fb80c8cdSgmcgarry 479a1286723Smrg hack xorg warnings 4808459d890Schristos cdat 30 July 2008, 3 June, 2013 481a1286723Smrg who mrg 482c9553d73Smrg file external/mit/xorg/lib/libSM/Makefile : 1.2 4838459d890Schristos external/mit/xorg/lib/libX11/Makefile.libx11 : 1.10 484a1286723Smrg external/mit/xorg/lib/libXext/Makefile : 1.2 485a1286723Smrg external/mit/xorg/lib/libXfont/Makefile : 1.2 486a1286723Smrg descr 487a1286723Smrg Disable several warnings or use -Wno-error across Xorg sources 488a1286723Smrg while we get them working 489a1286723Smrg kcah 490a1286723Smrg 4916df24a7dSchristos hack 32 bit time leftovers 4926df24a7dSchristos cdat 11 January 2009 4936df24a7dSchristos who christos 4946df24a7dSchristos file lib/libc/time/localtime.c : 1.41 4956df24a7dSchristos lib/libc/time/zic.c : 1.23 4966df24a7dSchristos descr 4976df24a7dSchristos The timezone compiled files still contain 32 bit time_t 4986df24a7dSchristos quantities. I did not want to version the files because 4996df24a7dSchristos the ``parser'' is too ugly for words. What needs to be 5006df24a7dSchristos done, is to rewrite the parser from scratch also to avoid 5016df24a7dSchristos potential core-dumps from parsing invalid files. 5026df24a7dSchristos kcah 5036df24a7dSchristos 5046df24a7dSchristos hack 32 bit time leftovers 5056df24a7dSchristos cdat 11 January 2009 5066df24a7dSchristos who christos 5076df24a7dSchristos file various 5086df24a7dSchristos descr 509b2b1aa5dSsketch Many filesystem on-disk formats have 32 bit times. 5106df24a7dSchristos kcah 5116df24a7dSchristos 512bbf7aa1dSchristos hack gcc 4.5 fsdb miscompile 513b3763dc5Schristos date Sat Nov 9 11:03:02 EST 2013 514b3763dc5Schristos who christos 515bbf7aa1dSchristos file src/sbin/fsdb/Makefile : 1.36 (and earlier) 516b3763dc5Schristos descr 517b3763dc5Schristos src/sbin/fsdb/fsdb.c: In function 'findblk': 518b3763dc5Schristos src/sbin/fsdb/fsdb.c:610:1: error: unrecognizable insn: 519b3763dc5Schristos (insn 941 940 942 134 src/sbin/fsdb/fsdb.c:589 (set (reg:SI 604) 520b3763dc5Schristos (subreg:SI (mem/s/j:DI (plus:SI (mult:SI (reg:SI 602) 521b3763dc5Schristos (const_int 8 [0x8])) 522b3763dc5Schristos (reg/f:SI 601)) [0 curinode.99_378->dp2.di_ib S8 A32]) 4)) \ 523b3763dc5Schristos -1 (nil)) 524b3763dc5Schristos src/sbin/fsdb/fsdb.c:610:1: internal compiler error: in \ 525b3763dc5Schristos extract_insn, at recog.c:2103 526b3763dc5Schristos kcah 527b3763dc5Schristos 528bbf7aa1dSchristos hack gcc 4.8 gcc miscompiles 529bbf7aa1dSchristos date Sat Nov 9 16:35:18 EST 2013 530bbf7aa1dSchristos who christos 531013fdb9eSrin file distrib/utils/x_ping/Makefile : 1.8 532013fdb9eSrin file distrib/vax/miniroot/Makefile.inc : ? 533013fdb9eSrin file distrib/vax/ramdisk/Makefile : ? 534013fdb9eSrin file external/gpl3/gdb/lib/libdecnumber/Makefile : 1.3 535013fdb9eSrin file sbin/fsdb/Makefile : 1.36 536013fdb9eSrin file sbin/newfs_ext2fs/Makefile : 1.6 537013fdb9eSrin file sbin/ping/Makefile : 1.17 538013fdb9eSrin file usr.sbin/mtrace/Makefile : 1.11 539bbf7aa1dSchristos descr 540bbf7aa1dSchristos external/gpl3/gcc/dist/gcc/expmed.c:2781:1: 541bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 542bbf7aa1dSchristos external/gpl3/gcc/dist/gcc/recog.c:770:1: 543bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 544bbf7aa1dSchristos external/gpl3/gcc/dist/libdecnumber/decNumber.c:7214:3: 545bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 546bbf7aa1dSchristos sbin/ping/ping.c:679:1: 547bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 548bbf7aa1dSchristos sbin/newfs_ext2fs/mke2fs.c:681:1: 549bbf7aa1dSchristos internal compiler error: in reload_combine_note_use, 550bbf7aa1dSchristos at postreload.c:1561 551bbf7aa1dSchristos external/gpl3/gdb/dist/libdecnumber/decNumber.c:7214:3: 552bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 553bbf7aa1dSchristos usr.sbin/mtrace/mtrace.c:1655:1: 554bbf7aa1dSchristos internal compiler error: in change_address_1, at emit-rtl.c:2019 555bbf7aa1dSchristos kcah 556bbf7aa1dSchristos 55778470a5aSrin hack gcc 5.4 cc1 miscompile 55878470a5aSrin date Tue Feb 14 07:19:57 JST 2017 55978470a5aSrin who rin 56078470a5aSrin pr port-vax/51967 56178470a5aSrin file external/gpl3/gcc/usr.bin/backend/Makefile : 1.35 56278470a5aSrin descr 56378470a5aSrin cc1 aborts due to SIGILL when compiling the sample code attached 56478470a5aSrin to the PR. As a workaround, compile dse.c with -O0. 56578470a5aSrin kcah 56678470a5aSrin 56779ef8766Srin hack libssh miscompile 56872128ffaSrin cdate Tue Feb 14 17:58:06 JST 2017 56972128ffaSrin mdate Tue Feb 14 18:57:39 JST 2017 57079ef8766Srin who rin 57179ef8766Srin file crypto/external/bsd/openssh/lib/Makefile : 1.20 57279ef8766Srin descr 57372128ffaSrin poly1305.c and umac.c are miscompiled, which results in login 57472128ffaSrin failure to/from external hosts via ssh. 57579ef8766Srin kcah 57679ef8766Srin 57798803e73Srin hack mandoc miscompile 57898803e73Srin date Tue Feb 14 18:03:05 JST 2017 57998803e73Srin who rin 58098803e73Srin file external/bsd/mdocml/lib/libmandoc/Makefile : 1.8 58198803e73Srin descr 58298803e73Srin mandoc(1) receives SIGILL in in_line_argn() from mdoc_macro.c. 58398803e73Srin kcah 58498803e73Srin 5854ec55dfcSrin hack libX11 miscompile 5864ec55dfcSrin date Thu Feb 16 10:00:22 JST 2017 5874ec55dfcSrin who rin 5884ec55dfcSrin file src/external/mit/xorg/lib/libX11/Makefile.libx11 : 1.18 5894ec55dfcSrin descr 5904ec55dfcSrin lcWrap.c is miscompiled, which results in input failure via XIM. 59196f404cfSrin Besides, some clients, e.g., pkgsrc/x11/kterm, receive SIGSEGV. 5924ec55dfcSrin kcah 5934ec55dfcSrin 594998b891bSchristos hack gomoku compiler crash 595998b891bSchristos date Tue May 31 15:11:39 EDT 2022 596998b891bSchristos who christos 597998b891bSchristos file src/games/gomoku/Makefile : 1.12 598998b891bSchristos descr 599998b891bSchristos pickmove.c crashes with -O2, warns about ovi.o_intersect being 60051508882Smsaitoh uninitialized with -O1, works with -O0 601998b891bSchristos kcah 602998b891bSchristos 60378eb21a0Sjakllsch hack gdtoa/misc.c miscompile 60478eb21a0Sjakllsch cdate Sun Dec 4 22:27:26 UTC 2022 60578eb21a0Sjakllsch who jakllsch 60678eb21a0Sjakllsch file src/lib/libc/gdtoa/Makefile.inc : 1.11 60778eb21a0Sjakllsch descr 60878eb21a0Sjakllsch some doubles print as garbage if gdtoa/misc.c isn't compiled at -O0 60978eb21a0Sjakllsch kcah 61078eb21a0Sjakllsch 611772577a8Smycroftport arm 612772577a8Smycroft 613772577a8Smycroft hack gcc-unsigned-compare 614772577a8Smycroft cdate 09 Mar 2002 615772577a8Smycroft mdate 18 Mar 2002 616772577a8Smycroft who bjh21 617772577a8Smycroft file dist/bind/lib/nameser/ns_parse.c : 1.3 618772577a8Smycroft file dist/dhcp/minires/ns_parse.c : 1.3 619772577a8Smycroft file dist/dhcp/omapip/result.c : 1.2 620772577a8Smycroft file dist/dhcp/server/failover.c : 1.3 621772577a8Smycroft file gnu/dist/toolchain/bfd/bfd.c : 1.2 622772577a8Smycroft file gnu/dist/toolchain/bfd/format.c : 1.2 623772577a8Smycroft file gnu/dist/toolchain/gdb/target.c : 1.2 624772577a8Smycroft file sys/kern/vfs_subr.c : 1.172 625772577a8Smycroft descr When checking that a potentially-unsigned enum is >= 0, assign 626772577a8Smycroft it to an int first. This is necessary to avoid "comparison is 627772577a8Smycroft always true" warnings with -fshort-enums. Casting to an int 628772577a8Smycroft really should be enough, but turns out not to be. 629772577a8Smycroft kcah 630772577a8Smycroft 6317407a6d4Stsutsui hack gcc-4.5 arm CNAME hostname lookup failure on 6327407a6d4Stsutsui certain DNS environment (probably -ftree-ter problem) 6337407a6d4Stsutsui cdate Sat Dec 24 04:59:00 UTC 2011 6347407a6d4Stsutsui mdate 6357407a6d4Stsutsui who tsutsui 6367407a6d4Stsutsui file lib/libc/net/Makefile.inc 1.79 6377407a6d4Stsutsui descr Hostname lookup against CNAMEs by some commands fails 6387407a6d4Stsutsui on certain DNS environments if lib/libc/net/gethnamaddr.c 6397407a6d4Stsutsui (ping(8) etc) and lib/libc/net/getaddrinfo.c (ftp(1) etc) 6407407a6d4Stsutsui are compiled with -O2, even though nslookup(1) against 6417407a6d4Stsutsui the same CNAME returns proper hostname. 6427407a6d4Stsutsui They works properly if compiled with -O2 -fno-tree-ter. 6437407a6d4Stsutsui Also -O2 fails but -O2 -fno-tree-ter works on the following 6447407a6d4Stsutsui test case in gcc bugzilla: 6457407a6d4Stsutsui http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4 6467407a6d4Stsutsui kcah 6477407a6d4Stsutsui 648772577a8Smycroftport sh3 649772577a8Smycroft 65053751ce0Smrg hack gcc4-sh3-bz2 65173085a86Stsutsui cdate Sun May 21 03:34:57 UTC 2006 65273085a86Stsutsui mdate Fri May 16 13:13:00 UTC 2008 65373085a86Stsutsui who mrg, tsutsui 65453751ce0Smrg file lib/libbz2/Makefile : 1.10 65553751ce0Smrg descr 65653751ce0Smrg The in-tree GCC 4.1-based compiler generated too-far 65773085a86Stsutsui pc-relative addresses. Hack is to build with 65873085a86Stsutsui -fno-loop-optimize. 65953751ce0Smrg kcah 66053751ce0Smrg 6613ce69693Stsutsuiport m68000 662f80e165dSmrg 663ecc90aa0Smrg hack gcc4-m68000 6643367ee47Stsutsui cdate Fri Feb 8 10:29:37 PST 2008 6653367ee47Stsutsui mdate Sun May 4 15:37:19 UTC 2008 6666deb8b7dStsutsui who mrg, tsutsui 667ecc90aa0Smrg file rescue/Makefile : 1.21 6686deb8b7dStsutsui file sbin/dump_lfs/Makefile : 1.9 6696dc246f7Stsutsui file sbin/fsck_ffs/Makefile : 1.35 6706dc246f7Stsutsui file sbin/fsdb/Makefile : 1.22 6716dc246f7Stsutsui file share/mk/sys.mk : 1.96 6726deb8b7dStsutsui file usr.sbin/ndbootd/Makefile : 1.5 673f80e165dSmrg descr 6746dc246f7Stsutsui Several internal compiler errors with gcc -O1 6756dc246f7Stsutsui around 64bit integer arithmetic. 6766deb8b7dStsutsui This hack uses -O1 and adds some -fno-tree-foo options 6776deb8b7dStsutsui to avoid the problem. 6786dc246f7Stsutsui This might be related with GCC Bugzilla Bug 32424. 679f80e165dSmrg kcah 6809bea7e24Smartin 681bbf7aa1dSchristosport m68k,sh3,vax 682c44df9e7Schristos 683c44df9e7Schristos hack gcc-4.8.1 684c44df9e7Schristos cdate Wed Nov 6 20:41:35 EST 2013 685c44df9e7Schristos who christos 686bbf7aa1dSchristos file src/external/gpl3/gcc/libstdc++-v3/Makefile : 1.6 687c44df9e7Schristos descr 688c44df9e7Schristos compile hashtable_c++0x.cc with -O2 instead of -Os to 689c44df9e7Schristos produce missing instantiation of std::lower_bound expansion 690c44df9e7Schristos for unsigned long. 691c44df9e7Schristos kcah 692ecc90aa0Smrg 69319d5bf79Smrgport sparc 69419d5bf79Smrg 69519d5bf79Smrg hack avoid NULL pointer derefs in savefpstate IPIs and GCC 4.5.3 69619d5bf79Smrg cdate Sun Aug 14 19:26:48 PDT 2011 69719d5bf79Smrg who mrg 69819d5bf79Smrg file sys/arch/sparc64/sparc/cpu.c : 1.234 69919d5bf79Smrg file sys/arch/sparc64/sparc/cpuvar.h : 1.90 70019d5bf79Smrg file sys/arch/sparc64/sparc/genassym.cf : 1.67 70119d5bf79Smrg file sys/arch/sparc64/sparc/locore.s : 1.265 70219d5bf79Smrg descr 70319d5bf79Smrg Something is wrong with GCC 4.5.3 and the savefpstate IPI. 70419d5bf79Smrg Post newlock2 there was a bug where a lock was reduced from 70519d5bf79Smrg IPL_SCHED to IPL_VM (?) and occasionally savefpstate IPI 70619d5bf79Smrg would crash due to NULL IPI. This was fixed by re-using the 70719d5bf79Smrg right IPL value. However, GCC 4.5.3 build kernels have the 70819d5bf79Smrg same problems. For now, the hack is re-instated. 70919d5bf79Smrg kcah 71019d5bf79Smrg 71119d5bf79Smrg 7121541f2efSsimonbport mips 7131541f2efSsimonb 7141541f2efSsimonb hack mips-shared-linker-load-address 7151541f2efSsimonb cdate Fri Oct 7 08:33:10 UTC 2005 7161541f2efSsimonb who simonb 7171541f2efSsimonb file src/sys/kern/exec_elf32.c : 1.107 7181541f2efSsimonb descr 7191541f2efSsimonb With COMPAT_16 or previous enabled (which enables 7201541f2efSsimonb ELF_INTERP_NON_RELOCATABLE) a recent ld.elf_so will 7211541f2efSsimonb load and run at address 0. The check to fix this in 7221541f2efSsimonb rev 1.107 only checks the first psection of the ELF 7231541f2efSsimonb executable, which may not be loadable. A more correct 7241541f2efSsimonb fix is to check the first loadable psection instead of 7251541f2efSsimonb just the first psection. 7261541f2efSsimonb kcah 727f1cd142fShe 72824ab9b3bSmartin hack mips-duplicate-ras-end-label 72924ab9b3bSmartin cdate Sat Sep 2 23:29:42 2006 73024ab9b3bSmartin who martin 7316979c39aSchs file src/regress/sys/kern/ras/ras3/Makefile : 1.3 73224ab9b3bSmartin descr 73324ab9b3bSmartin Add -fno-reorder-blocks to CFLAGS to avoid duplicate 73424ab9b3bSmartin labels by duplicated __asm output from RAS_END() 73524ab9b3bSmartin macro. 73624ab9b3bSmartin kcah 73724ab9b3bSmartin 738f4f7ab95Slukem hack mips-mcount-assembler-warning 739f4f7ab95Slukem cdate Tue Jul 29 14:16:52 UTC 2008 740f4f7ab95Slukem who lukem 741f4f7ab95Slukem file src/lib/libc/gmon/Makefile.inc : 1.8 742f4f7ab95Slukem descr 743f4f7ab95Slukem Workaround for PR port-mips/39192. 744f4f7ab95Slukem common/lib/libc/gmon/mcount.c generates a (fatal) 745f4f7ab95Slukem assembler warning on MIPS: 746f4f7ab95Slukem Warning: No .cprestore pseudo-op used in PIC code 747f4f7ab95Slukem Add COPTS.count.c+=-Wa,--no-warn to avoid -Wa,--fatal-warnings 748f4f7ab95Slukem kcah 749f4f7ab95Slukem 750f0e86110Smartin hack mips-use-binutils-old 751f0e86110Smartin cdate Sun May 7 14:28:55 CEST 2023 752f0e86110Smartin who martin 753f0e86110Smartin file src/share/mk/bsd.own.mk : 1.1311, 1.1308 754f0e86110Smartin descr 755f0e86110Smartin Use binutils.old for 64bit mips with 32bit userland. 756f0e86110Smartin Version 2.39 causes random (cross-) build failures 757f0e86110Smartin that are hard to reproduce or analyze. 758f0e86110Smartin kcah 759f0e86110Smartin 76095ce3f0bSchristosport i386 76195ce3f0bSchristos 762d7c62b7dSdrochner hack use volatile intermediate variable to enforce rounding 763d7c62b7dSdrochner cdate Tue Aug 1 22:15:55 MEST 2006 764d7c62b7dSdrochner who drochner 765d7c62b7dSdrochner file src/lib/libm/src/lrintf.c : 1.4 766d7c62b7dSdrochner file src/lib/libm/src/s_rintf.c : 1.8 767d7c62b7dSdrochner descr 768d7c62b7dSdrochner gcc-4 does subsequent operations on "float" values within 769d7c62b7dSdrochner the i387 FPU without rounding the intermediate results 770d7c62b7dSdrochner kcah 7711d228feeSmacallan 7724d17f2c6Schristosport x86 7734d17f2c6Schristos hack turn off optimization for biosdisk_ll.c because otherwise 7744d17f2c6Schristos we are pass the wrong arguments to biosdisk_read(). 7754d17f2c6Schristos $ cd /usr/src/sys/arch/i386/floppies/bootflopp-com 7764d17f2c6Schristos $ qemu-system-i386 -nographic -fda boot-com1.fs -boot a 777013fdb9eSrin cdate Mon Apr 7 21:09:55 2014 UTC 7784d17f2c6Schristos who christos 7794d17f2c6Schristos file src/sys/arch/i386/stand/lib/Makefile : 1.38 7804d17f2c6Schristos descr 7814d17f2c6Schristos Turning on DISK_DEBUG shows the problem. We should find 7824d17f2c6Schristos out which option is causing this. 7834d17f2c6Schristos hcah 7844d17f2c6Schristos 7851d228feeSmacallanport powerpc 7861d228feeSmacallan 7871d228feeSmacallan hack avoid using __builtin_return_address(0) because it fails in 7881d228feeSmacallan Xorg's module loader 7891d228feeSmacallan cdate Sat Sep 27 03:52:05 UTC 2008 7901d228feeSmacallan who macallan 7911d228feeSmacallan file src/libexec/ld.elf_so/rtld.c : 1.121 7921d228feeSmacallan descr 7931d228feeSmacallan workaround for PR port-macppc/37812 7941d228feeSmacallan kcah 7951d228feeSmacallan 796fe6182ccSmatt hack define TARGET_SECURE_PLT and HAVE_AS_TLS because when 797fe6182ccSmatt building the native compiler via build.sh those don't defined 798fe6182ccSmatt properly. 799fe6182ccSmatt cdate Sat Mar 12 08:00:00 UTC 2011 800fe6182ccSmatt who matt 801013fdb9eSrin file src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h : 1.7 802fe6182ccSmatt descr 803fe6182ccSmatt see above 804fe6182ccSmatt kcah 805c4521bb3Schristos 806c4521bb3Schristosport powerpc64 807c4521bb3Schristos 808c4521bb3Schristos hack include _errno.c in libposix so that __errno resolves. It 809c4521bb3Schristos should resolve from libc's errno, but somehow it does not. 810c4521bb3Schristos Linker bug? 811c4521bb3Schristos cdate Thu Oct 27 13:19:47 EDT 2011 812c4521bb3Schristos who christos 813c4521bb3Schristos file src/lib/libposix/Makefile: 1.15 81491d88b1fSchristos file src/lib/librt/Makefile: 1.14 815c4521bb3Schristos descr 816c4521bb3Schristos workaround for: 817c4521bb3Schristos libposix_pic.a(cerror.pico)(.text+0x14): unresolvable \ 818c4521bb3Schristos R_PPC64_REL24 relocation against symbol `.__errno' 819c4521bb3Schristos kcah 82012a1c915Schristos 82112a1c915Schristos hack rename data() function in mdocml to avoid redefined error. 82212a1c915Schristos Compiler/Assembler bug? 82312a1c915Schristos cdate Sat Oct 29 11:16:01 EDT 2011 82412a1c915Schristos who christos 82512a1c915Schristos file src/external/bsd/mdocml/tbl_data.c: 1.2 82612a1c915Schristos descr 82712a1c915Schristos workaround for: 82812a1c915Schristos {standard input}: Assembler messages: 82912a1c915Schristos {standard input}:105: Error: symbol `.data' is already \ 83012a1c915Schristos defined 83112a1c915Schristos kcah 8325cea0d82Schristos 8335cea0d82Schristosport emips 8345cea0d82Schristos 8355cea0d82Schristos hack Add nop between ctc1 and mtc0 to avoid assembler internal 8365cea0d82Schristos error 8375cea0d82Schristos cdate Sat Oct 29 16:57:34 EDT 2011 8385cea0d82Schristos who christos 8395cea0d82Schristos file src/sys/arch/mips/mips/mips_fpu.c: 1.7 8405cea0d82Schristos descr 8415cea0d82Schristos workaround for: 8425cea0d82Schristos {standard input}: Assembler messages: 8435cea0d82Schristos {standard input}:730: Internal error! 8445cea0d82Schristos Assertion failure in append_insn at /usr/src/external/gpl3/\ 8455cea0d82Schristos binutils/dist/gas/config/tc-mips.c line 2910. 8465cea0d82Schristos kcah 847475e9a30Smartin 848475e9a30Smartinport ia64 849475e9a30Smartin 8507d4d183bSmartin hack libgcc unwind dummy function 8517d4d183bSmartin cdate Fri Apr 17 14:31:03 CEST 2015 8527d4d183bSmartin who martin 8537d4d183bSmartin file src/external/gpl3/gcc/dist/libgcc/config/ia64/unwind-ia64.c: 1.4 8547d4d183bSmartin descr 8557d4d183bSmartin Add an empty _Unwind_FindTableEntry() implementation. 8567d4d183bSmartin In the end we will use our libc stuff, and this should 8577d4d183bSmartin go away again. 8587d4d183bSmartin kcah 8597d4d183bSmartin 860091518e8Schristosport x68k 861f4f90e12Smartin 862091518e8Schristos hack compiler error with gcc 4.5.x 863091518e8Schristos cdate Fri May 24 13:23:01 EDT 2013 864091518e8Schristos who christos 865091518e8Schristos file src/external/gpl3/gcc/usr.bin/bakend/Makefile: 1.17 866091518e8Schristos xsrc/external/mit/xorg/lib/libGLU/Makefile: 1.11 867091518e8Schristos descr 868091518e8Schristos workaround for: 869091518e8Schristos internal compiler error: in cselib_record_set, at cselib.c:1999 870091518e8Schristos kcah 8718ca7e152Sjoerg 8728ca7e152Sjoerghack fallback to /usr/bin/clang-cpp in rpcgen 8738ca7e152Sjoergcdate Wed Jun 5 15:49:27 CEST 2013 8748ca7e152Sjoergwho joerg 875013fdb9eSrinfile src/usr.bin/rpcgen/rpc_main.c : 1.35 8768ca7e152Sjoergdescr 877755d29f0Sjoerg It is undecided which compiler owns /usr/bin/cpp and whether it should 8788ca7e152Sjoerg exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box, 8798ca7e152Sjoerg if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback. 8808ca7e152Sjoerg This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable. 8818ca7e152Sjoergkcah 882ea7eb287Sskrll 8839dd16362Sskrllport hppa 884ea7eb287Sskrll 885ea7eb287Sskrll hack compiler error with gcc 4.5.x 886ea7eb287Sskrll cdate Tue Jul 23 07:42:28 BST 2013 887ea7eb287Sskrll who skrll 8880bdf107fSskrll file src/sys/lib/libkern/Makefile.libkern: 1.26 8890bdf107fSskrll descr 8900bdf107fSskrll workaround for unanalysed codegen bug affecting md5c.c. 8910bdf107fSskrll kcah 892e7356e01Smacallan 8939dd16362Sskrll hack gdb vs _rtld_debug_state problem 8949dd16362Sskrll cdate Thu Mar 5 09:49:53 UTC 2015 8959dd16362Sskrll who skrll 8969dd16362Sskrll file src/libexec/ld.elf_so/rtld.c: 1.175 8979dd16362Sskrll descr 8989dd16362Sskrll workaround for problem where gdb misses the breakpoint on 8999dd16362Sskrll _rtld_debug_state when the function is only the 9009dd16362Sskrll bv,n %r0(%rp) instruction - the nullify seems to 9019dd16362Sskrll confuse something 9029dd16362Sskrll kcah 9039dd16362Sskrll 904e7356e01Smacallanport mips64* 905e7356e01Smacallanhack compiler crashes on mips64* with optimization enabled 906e7356e01Smacallancdate Tue May 13 18:46:48 UTC 2014 907e7356e01Smacallanwho macallan 908e7356e01Smacallanfile src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc: 1.6 909e7356e01Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/config.h: 1.5 910e7356e01Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc: 1.6 911e7356e01Smacallan src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/config.h: 1.5 912e7356e01Smacallandescr workaround for n32 gcc doing unaligned 64bit accesses when optimizing 913e7356e01Smacallanpr 48696 914e7356e01Smacallankcah 9155d887935Smartin 9165d887935Smartinport vax 9175d887935Smartinhack compile boot with -O1 9185d887935Smartincdate Sat May 24 09:40:58 CEST 2014 9195d887935Smartinwho martin 9205d887935Smartinfile src/sys/arch/vax/boot/boot/Makefile: 1.41 9215d887935Smartindescr /boot does not work when compiled with -O2 and gcc 4.8 9225d887935Smartinkcah 9235d887935Smartin 9242565656cSchristosport vax 9252565656cSchristoshack compile nir.c in gallium with -O1 9262565656cSchristoscdate Mon Oct 28 14:39:35 EDT 2019 9272565656cSchristoswho christos 9282565656cSchristosfile /cvsroot/src/external/mit/xorg/lib/gallium/Makefile 1.36 9292565656cSchristosdescr gallium does not compile. 9302565656cSchristoskcah 9312565656cSchristos 932bd782616Schristosport sh3 933bd782616Schristoshack compile parse.c in battlestar with -Wno-restrict 934bd782616Schristoscdate Mon Oct 28 14:39:35 EDT 2019 935bd782616Schristoswho christos 936bd782616Schristosfile /cvsroot/src/games/battlestar/Makefile 1.11 937bd782616Schristosdescr fails to compile, confused by char words[][]; 938bd782616Schristos strcpy(words[n - 1], words[n + 1]); 939bd782616Schristoskcah 940bd782616Schristos 941fea19e49Schristosport sh3 942fea19e49Schristoshack compile ddns.c in dhcpcd with no-stringop-overflow 943fea19e49Schristoscdate Tue Oct 29 20:25:59 EDT 2019 944fea19e49Schristoswho christos 945fea19e49Schristosfile /cvsroot/src/external/mpl/dhcp/bin/server/Makefile 1.2 946fea19e49Schristosdescr fails to compile, confused by builtin_object_size in strcat(p, ".in..") 947fea19e49Schristoskcah 948fea19e49Schristos 94917785916Smattport arm 95017785916Smatthack avoid using labels in a 12-bit constant. 951013fdb9eSrincdate Mon Mar 30 05:26:47 2015 UTC 95217785916Smattwho matt 95317785916Smattfile crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S: 1.2 95417785916Smattdescr workaround for clang misassembling an instruction 95517785916Smattkcah 956214892fdSchristos 957214892fdSchristosport sparc64 958214892fdSchristoshack during profiling with -m32 (and ASLR) labels are not generated 959214892fdSchristos consistently 960013fdb9eSrincdate Sat Feb 11 04:56:37 2017 UTC 961214892fdSchristoswho christos 962214892fdSchristosfile /cvsroot/src/crypto/external/bsd/heimdal/lib/libasn1/Makefile: 1.4 963214892fdSchristosdesc asn1_krb5_asn1.po does not produce the same results during successive 964214892fdSchristos compilation runs; it is bimodal. Turning optimization to -O0 fixes 965214892fdSchristos the issue 966214892fdSchristoskcah 967d07fad4dSscole 968d07fad4dSscoleport ia64 969d07fad4dSscolehack ski emulator crashes 970013fdb9eSrincdate Sat Apr 8 18:10:43 2017 UTC 971d07fad4dSscolewho scole 972d07fad4dSscolefile /cvsroot/src/sys/external/bsd/acpica/dist/tables/tbxfload.c: 1.6 973d07fad4dSscoledesc 974d07fad4dSscole ski emulator crashes during acpi detection. Added a check for 975d07fad4dSscole uninitialized index. Submitted a request for change with upstream 976d07fad4dSscole mailing list, but never got a response 977d07fad4dSscolekcah 978f4e5a5c4Schristos 979f4e5a5c4Schristosport vax 980f4e5a5c4Schristoshack compile rtld.c with -O0 981f4e5a5c4Schristoscdate Wed Apr 3 17:38:38 EDT 2019 982f4e5a5c4Schristoswho christos 983f4e5a5c4Schristosfile src/libexec/ld.elf_so/Makefile: 1.141 984f4e5a5c4Schristosdescr Disable optimization for rtld.c on the vax with gcc-7. Crashes on the 985f4e5a5c4Schristos second pass loop with elm == 0xffffffff 986f4e5a5c4Schristoskcah 987283bd978Srin 9886caa15c4Schristosport powerpc 9893f09de0cSchristoshack compile tc.c, logerr.c, ubsan.c with -O0 for clang 9906caa15c4Schristoscdate Wed Jan 29 17:40:19 EST 2020 9916caa15c4Schristoswho christos 9926caa15c4Schristosfile src/external/bsd/atf/lib/libatf-c/Makefile: 1.22 993b0c01ce7Schristosfile src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile: 1.49 9943f09de0cSchristosfile src/tests/lib/libc/misc/Makefile: 1.5 9953f09de0cSchristos 9963f09de0cSchristosdescr Disable optimization on tc.c, logerr.c, ubsan.c crashes: 9976caa15c4Schristos lib/libLLVMCodeGen/../../llvm/../../external/apache2/llvm/lib/..\ 9986caa15c4Schristos /dist/llvm/include/llvm/CodeGen/MachineFrameInfo.h", line 495, \ 9996caa15c4Schristos function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const" 10006caa15c4Schristoskcah 1001c9bd6518Srin 1002ed4d0865Srinport m68k 10038486e82fSrinhack compile aes_ccm_tag() with -O0 1004ed4d0865Srincdate Mon Aug 10 06:27:29 UTC 2020 10058486e82fSrinmdate Wed Aug 10 00:00:00 UTC 2022 1006ed4d0865Srinwho rin 1007ed4d0865Srinfile src/sys/crypto/aes/aes_ccm.c: 1.5 1008d1007566Srindescr GCC 9.4 and 8.3 miscompile aes_ccm_tag() for m68k with optimization 1009d1007566Srin level -O[12], which results in failure in aes_ccm_selftest(). 1010d1007566Srin For 9.4, -O0 and -O1 work but -O2 fails for amiga (A1200, 68060) and 1011d1007566Srin mac68k (Quadra 840AV, 68040). Whereas -O0 and -O2 work but -O1 fails 1012d1007566Srin for sun3 (TME, 68020 emulator) and sun2 (TME, 68010 emulator). 10138486e82fSrin aes_ccm_selftest() still fails with GCC 10.4 and -O2. 1014ed4d0865Srinkcah 1015e30fc555Schristos 1016cbd413d1Smartinport sh3 1017cbd413d1Smartin 1018cbd413d1Smartin hack gcc9-sh3-lint 1019cbd413d1Smartin cdate Tue Jun 22 14:59:52 CEST 2021 1020f20bc1e7Shgutch mdate Mon Jul 5 12:34:57 CEST 2021 1021f20bc1e7Shgutch who hgutch 1022f20bc1e7Shgutch file external/gpl3/gcc/dist/gcc/config/sh/sh.md 1.2 1023f20bc1e7Shgutch external/gpl3/gcc.old/dist/gcc/config/sh/sh.md 1.11 1024cbd413d1Smartin descr 1025f20bc1e7Shgutch The in-tree gcc 9/gcc 10 crashes with an internal 1026f20bc1e7Shgutch invalid opcode exception when using any kind of 1027f20bc1e7Shgutch optimization on lex.c in usr.bin/xlint/lint . This 1028f20bc1e7Shgutch was introduced apparently unintendedly in gcc when 1029f20bc1e7Shgutch addressing a different issue. Rather than disabling 1030f20bc1e7Shgutch optimization for lex.c, instead revert the change to 1031f20bc1e7Shgutch gcc. The bug report upstream has been updated to 1032f20bc1e7Shgutch reflect the exact breakage. 1033f20bc1e7Shgutch 1034c98dd4a4Srillig https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 1035cbd413d1Smartinkcah 1036e07b90ffSrin 1037b285c3f7Sniaport vax 1038b285c3f7Sniahack compile blake2b.c with -O0 for vax 1039b285c3f7Sniacdate Wed Oct 13 14:28:32 UTC 2021 1040b285c3f7Sniamdate Wed Oct 13 14:28:32 UTC 2021 1041b285c3f7Sniawho nia 1042b285c3f7Sniafile src/lib/libcrypt/Makefile: 1.200 1043b285c3f7Sniadescr GCC 10 fails to build blake2b.c with an internal compiler 1044b285c3f7Snia error unless optimization is disabled. 1045b285c3f7Sniakcah 1046f5f80c07Sthorpej 1047f5f80c07Sthorpejport arm 1048f5f80c07Sthorpejhack compile t_sig_backtrace with -fno-omit-frame-pointer for arm 1049f5f80c07Sthorpejcdate Tue Nov 23 23:24:37 UTC 2021 1050f5f80c07Sthorpejmdate Tue Nov 23 23:24:37 UTC 2021 1051f5f80c07Sthorpejwho thorpej 1052f5f80c07Sthorpejfile src/tests/lib/libexecinfo/Makefile: 1.8 1053f5f80c07Sthorpejfile src/tests/lib/libexecinfo/t_sig_backtrace: 1.2 1054f5f80c07Sthorpejdescr Unit test fails to pass unless t_sig_backtrace.c is compiled 1055f5f80c07Sthorpej with -fno-omit-frame-pointer and -DNOINLINE_HACK. 1056f5f80c07Sthorpejkcah 105723bef704Smartin 105823bef704Smartinhack alpha gcc error in lint 105923bef704Smartincdate 2022/04/10 13:21:34 106023bef704Smartinwho martin 106195139a95Smartinport alpha, vax 106295139a95Smartinfile usr.bin/xlint/Makefile.inc: 1.23, 1.25 106323bef704Smartinpr 56789 106423bef704Smartindescr 106523bef704Smartin Compiling lint with -ftrapv fails with an internal 106623bef704Smartin gcc compiler error. 106723bef704Smartin 10684cf69f2fSrillig https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105209 106995139a95Smartin 107095139a95Smartin Supposedly fixed in gcc 11 or newer. 10714cf69f2fSrilligkcah 1072478df496Srin 1073478df496Srinhack compile copy{in,out}() for ibm4xx with -O0 for clang 1074478df496Srincdate Mon Sep 12 08:06:36 UTC 2022 1075478df496Srinwho rin 1076478df496Srinport evbppc 1077478df496Srinfile sys/arch/powerpc/ibm4xx/trap.c: 1.99 1078478df496Srindescr 1079478df496Srin clang 13.0.0 miscompiles copy{in,out}() with -O[12]. As a result, 1080478df496Srin kernel cannot execute /sbin/init. 1081478df496Srinkcah 10822bd1369fSrin 10832bd1369fSrinhack Disable secure PLT for alpha 10842bd1369fSrincdate Fri Jul 7 08:33:25 UTC 2023 10852bd1369fSrinwho rin 10862bd1369fSrinport alpha 10872bd1369fSrinfile src/external/gpl3/binutils/dist/bfd/elf64-alpha.c: 1.11 10882bd1369fSrinpr port-alpha/57511 10892bd1369fSrindescr 10902bd1369fSrin Temporally disable secure PLT support, introduced by 10912bd1369fSrin binutils 2.39 for us. We need its support to ld.elf_so(1). 10922bd1369fSrinkcah 1093f4753910Srin 1094f4753910Srinhack openssl: Disable ec_nistp_64_gcc_128 on aarch64eb 1095f4753910Srincdate Sat Jul 8 23:54:27 UTC 2023 1096f4753910Srinwho rin 1097f4753910Srinport aarch64eb 1098f4753910Srinfile src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/ec.inc : 1.4 1099f4753910Srindescr 1100f4753910Srin As described in upstream document: 1101f4753910Srin https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-ec_nistp_64_gcc_128 1102f4753910Srin This feature (for LP64) does not support big-endian machines. 1103f4753910Srin Note that sparc64 does not use this (port-sparc64/57472). 1104f4753910Srinkcah 1105f8227581Smrg 1106f8227581Smrghack GCC: Disable "-Warray-bounds" for x86 curcpu() and curlwp() 1107f8227581Smrgcdate Mon Sep 4 13:59:32 PDT 2023 1108f8227581Smrgwho mrg 1109f8227581Smrgport i386 amd64 1110f8227581Smrgfile src/sys/arch/amd64/include/cpu.h : 1.71 1111f8227581Smrgfile src/sys/arch/i386/include/cpu.h : 1.184 1112f8227581Smrgdescr 1113f8227581Smrg These functions trigger eg: 1114f8227581Smrg ./machine/cpu.h:57:9: error: array subscript 0 is outside array bounds of 'struct cpu_info * const[0]' [-Werror=array-bounds] 1115f8227581Smrg 56 | __asm("movq %%gs:%1, %0" : 1116f8227581Smrg and can't easily be worked around. 1117f8227581Smrgkcah 11187e6e1033Schristos 11197e6e1033Schristoshack ctfconvert/gcc: disable gcc dwarf-4 generation 11207e6e1033Schristoscdate Thu Apr 4 19:51:05 EDT 2024 11217e6e1033Schristoswho christos 11227e6e1033Schristosfile src/external/mit/xorg/lib/gallium.old/Makefile : 1.9 11237e6e1033Schristosdescr 11247e6e1033Schristos Some files create dwarf info that our ctfmerge can't handle. 11257e6e1033Schristos We downgrade dwarf generation to version 3 which works. 11267e6e1033Schristoskcah 11272b70237dSriastradh 11282b70237dSriastradhhack ia64: work around feclearexcept/fetestexcept compiler bug 11292b70237dSriastradhcdate Sun May 5 23:06:10 UTC 2024 11302b70237dSriastradhwho riastradh 11312b70237dSriastradhfile tests/lib/libm/t_fe_round.c 11322b70237dSriastradhdescr 11332b70237dSriastradh Without judiciously placed __insn_barrier, we get: 11342b70237dSriastradh /tmp//ccJayu9g.s:2793: Warning: Use of 'mov.m' violates RAW dependency 'AR[FPSR].sf0.flags' (impliedf) 11352b70237dSriastradh /tmp//ccJayu9g.s:2793: Warning: Only the first path encountering the conflict is reported 11362b70237dSriastradh /tmp//ccJayu9g.s:2757: Warning: This is the location of the conflicting usage 11372b70237dSriastradhkcah 113801434d8eSmrg 113901434d8eSmrghack m68k: work around stack protector m68k compiler bug 114001434d8eSmrgcdate Thu Jun 6 15:53:21 PDT 2024 1141*c9dfb3ddSrinudate Sat Aug 17 15:18:30 UTC 2024 114201434d8eSmrgport m68k 1143*c9dfb3ddSrinwho mrg, rin 114401434d8eSmrgfile lib/libc/stdlib/strsuftoll.c : 1.10 114501434d8eSmrgfile lib/libc/citrus/citrus_module.c : 1.14 114601434d8eSmrgfile crypto/external/bsd/openssl/lib/libcrypto/blake2.inc : 1.3 1147*c9dfb3ddSrinfile crypto/external/bsd/openssl/lib/libcrypto/sha.inc : 1.8 1148*c9dfb3ddSrinfile external/mit/xorg/lib/freetype/Makefile : 1.26 1149*c9dfb3ddSrinfile external/mit/xorg/lib/gallium/Makefile : 1.56 115001434d8eSmrgdescr 115101434d8eSmrg With GCC 12, strsuftoll() triggers an stack protector issue 115201434d8eSmrg that does not appear to be valid. _citrus_find_getops() does 115301434d8eSmrg the same. They both have minimal stack usage themselves and 115401434d8eSmrg I suspect a GCC bug. 1155*c9dfb3ddSrin Other cases are less well studied. 115601434d8eSmrgkcah 115798831771Sriastradh 115898831771Sriastradhhack gcc: work around alignment limitations in ld.elf_so 115998831771Sriastradhcdate Mon Jun 17 23:35:52 UTC 2024 116098831771Sriastradhwho riastradh 116198831771Sriastradhfile external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors_posix.cpp : 1.4 116298831771Sriastradhfile src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.cpp : 1.4 116398831771Sriastradhfile external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h : 1.5 116498831771Sriastradhdescr 116598831771Sriastradh ld.elf_so only supports 2*pointer-aligned objects (typically 116698831771Sriastradh 8- or 16-byte) in thread-local storage, but tsan expects 116798831771Sriastradh cacheline-aligned objects (typically >=64-byte). To work 116898831771Sriastradh around this, allocate n + 63 bytes and pick whichever pointer 116998831771Sriastradh in that interval is aligned (PR lib/58349). 117098831771Sriastradhkcah 1171