head 1.5; access; symbols pkgsrc-2026Q1:1.5.0.16 pkgsrc-2026Q1-base:1.5 pkgsrc-2025Q4:1.5.0.14 pkgsrc-2025Q4-base:1.5 pkgsrc-2025Q3:1.5.0.12 pkgsrc-2025Q3-base:1.5 pkgsrc-2025Q2:1.5.0.10 pkgsrc-2025Q2-base:1.5 pkgsrc-2025Q1:1.5.0.8 pkgsrc-2025Q1-base:1.5 pkgsrc-2024Q4:1.5.0.6 pkgsrc-2024Q4-base:1.5 pkgsrc-2024Q3:1.5.0.4 pkgsrc-2024Q3-base:1.5 pkgsrc-2024Q2:1.5.0.2 pkgsrc-2024Q2-base:1.5 pkgsrc-2024Q1:1.4.0.14 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.12 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.10 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.8 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.6 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.4 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.2 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.3.0.4 pkgsrc-2022Q2-base:1.3 pkgsrc-2022Q1:1.3.0.2 pkgsrc-2022Q1-base:1.3 pkgsrc-2021Q4:1.2.0.4 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.2 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.1.0.2 pkgsrc-2021Q2-base:1.1; locks; strict; comment @# @; 1.5 date 2024.04.01.14.33.57; author js; state Exp; branches; next 1.4; commitid l1phzwYDi0JhWr4F; 1.4 date 2022.07.03.15.59.17; author wiz; state Exp; branches; next 1.3; commitid GdPJAk3xIBncVsKD; 1.3 date 2022.02.02.22.07.28; author mrg; state Exp; branches; next 1.2; commitid TGGQsEIqnaEYN5rD; 1.2 date 2021.09.23.09.53.21; author adam; state Exp; branches; next 1.1; commitid fZD1zP8Mq1dHZ3aD; 1.1 date 2021.04.24.09.35.31; author mrg; state Exp; branches; next ; commitid 8aLQJ2kbYwVhMwQC; desc @@ 1.5 log @Port lang/gcc10 to QNX With this, there is finally a somewhat modern compiler for QNX. @ text @$NetBSD$ Match what is in NetBSD src. Fixes at least aarch64eb, and probably several others. Allow builds on Darwin 21. Fix build on QNX. --- gcc/config.gcc.orig 2023-07-07 07:08:19.000000000 +0000 +++ gcc/config.gcc @@@@ -462,6 +462,16 @@@@ m32r*-*-*) cpu_type=m32r extra_options="${extra_options} g.opt" ;; +m5200-*-*|m5407-*-*) + cpu_type=m68k + extra_headers=math-68881.h + extra_options="${extra_options} m68k/m68k-tables.opt" + ;; +m680[012]0-*-*) + cpu_type=m68k + extra_headers=math-68881.h + extra_options="${extra_options} m68k/m68k-tables.opt" + ;; m68k-*-*) extra_headers=math-68881.h extra_options="${extra_options} m68k/m68k-tables.opt" @@@@ -891,6 +901,11 @@@@ case ${target} in case ${enable_threads} in "" | yes | posix) thread_file='posix' ;; esac + case ${target} in + arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*) + default_gnu_indirect_function=yes + ;; + esac nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h" default_use_cxa_atexit=yes target_has_targetdm=yes @@@@ -1125,6 +1140,11 @@@@ aarch64*-*-netbsd*) tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" + case $target in + aarch64_be-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" + ;; + esac ;; aarch64*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h" @@@@ -1266,7 +1286,6 @@@@ arm*-*-freebsd*) # ARM Fr with_tls=${with_tls:-gnu} ;; arm*-*-netbsdelf*) - target_cpu_cname="strongarm" tmake_file="${tmake_file} arm/t-arm" tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@@@ -1275,26 +1294,34 @@@@ arm*-*-netbsdelf*) esac case ${target} in arm*-*-netbsdelf-*eabi*) - tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h" - tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi" + tm_file="${tm_file} arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h" + #tmake_file="$tmake_file arm/t-bpabi" + # The EABI requires the use of __cxa_atexit. + default_use_cxa_atexit=yes + # NetBSD native configuration pulls this in, not sure why this must + # be here explicitly for pkgsrc. + gcc_cv_initfini_array=yes ;; *) - tm_file="$tm_file arm/netbsd-elf.h" + tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h" + #tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi" tmake_file="$tmake_file arm/t-netbsd" ;; esac tm_file="${tm_file} arm/aout.h arm/arm.h" case ${target} in arm*-*-netbsdelf-*eabihf*) - # Hard-float requires at least Arm v5te - target_cpu_cname="arm10e" tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD" ;; esac case ${target} in - armv6*) target_cpu_cname="arm1176jzf-s";; - armv7*) target_cpu_cname="generic-armv7-a";; + armv4*) with_cpu=${with_cpu:-strongarm};; + armv6*) with_cpu=${with_cpu:-arm1176jzf-s};; + armv7*) with_cpu=${with_cpu:-cortex-a8};; + arm*eabihf*) with_cpu=${with_cpu:-arm10e};; + arm*) with_cpu=${with_cpu:-arm9e};; esac + target_cpu_cname="$with_cpu" ;; arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" @@@@ -1942,6 +1969,7 @@@@ i[34567]86-*-netbsdelf*) ;; x86_64-*-netbsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h" + tmake_file="${tmake_file} i386/t-netbsd64" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" ;; i[34567]86-*-openbsd*) @@@@ -2072,7 +2100,7 @@@@ i[34567]86-*-lynxos*) gnu_ld=yes gas=yes ;; -i[34567]86-*-nto-qnx*) +i[34567]86-*-qnx*) tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h" extra_options="${extra_options} i386/nto.opt" gnu_ld=yes @@@@ -2264,6 +2292,16 @@@@ ia64*-*-elf*) target_cpu_default="${target_cpu_default}|MASK_GNU_LD" fi ;; +ia64*-*-netbsd*) + tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} ia64/sysv4.h ia64/netbsd.h" + target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" + tmake_file="${tmake_file} ia64/t-ia64" + if test x$with_system_libunwind != xyes ; then + tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" + fi + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" + ;; ia64*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h" target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" @@@@ -2376,8 +2414,25 @@@@ m68k-*-elf* | fido-*-elf*) ;; esac ;; -m68k*-*-netbsdelf*) +m68010-*-netbsdelf* | m68k-*-netbsdelf* | m5407-*-netbsdelf*) default_m68k_cpu=68020 + case ${target} in + m5407*) + with_arch=${with_arch:-cf} + target_cpu_default="mcf5475" +# target="`echo ${target} | sed 's/m68kcf/m68k/'`" + ;; + m68010*) + target_cpu_default="m68010" + tmake_file="${tmake_file} m68k/t-m68kelf m68k/t-m68010-netbsd" + default_m68k_cpu=68010 + tmake_file="${tmake_file} m68k/t-floatlib" + ;; + *) + with_arch=${with_arch:-m68k} + tmake_file="${tmake_file} m68k/t-floatlib" + ;; + esac default_cf_cpu=5475 tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@@@ -2517,6 +2572,26 @@@@ riscv*-*-freebsd*) # automatically detect that GAS supports it, yet we require it. gcc_cv_initfini_array=yes ;; +riscv*-*-netbsd*) # NetBSD RISC-V + tm_file="elfos.h ${tm_file} ${nbsd_tm_file} riscv/netbsd.h" + tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1" + case ${target} in + riscv32*) tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=0" ;; + *) tmake_file="${tmake_file} riscv/t-netbsd64" ;; + esac + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" + tmake_file="${tmake_file} riscv/t-riscv" + gnu_ld=yes + gas=yes + gcc_cv_initfini_array=yes + ;; +mips64*-*-netbsd*) # NetBSD/mips64, either endian. + target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_SOFT_FLOAT_ABI" + tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h mips/netbsd64.h" + tmake_file="${tmake_file} mips/t-netbsd64" + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" + ;; mips*-*-netbsd*) # NetBSD/mips, either endian. target_cpu_default="MASK_ABICALLS" tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h" @@@@ -2932,11 +3007,24 @@@@ powerpc*-*-freebsd*) ;; esac ;; -powerpc-*-netbsd*) - tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h" +powerpc*-*-netbsd*) + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${nbsd_tm_file} freebsd-spec.h" + case ${target} in + powerpc64*) + tm_file="rs6000/biarch64.h ${tm_file}" + tm_file="${tm_file} rs6000/sysv4.h rs6000/default64.h rs6000/netbsd64.h" + tmake_file="${tmake_file} rs6000/t-netbsd64" + ;; + *) + tm_file="${tm_file} rs6000/sysv4.h rs6000/netbsd.h" + tmake_file="${tmake_file} rs6000/t-netbsd" + ;; + esac extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} rs6000/t-netbsd" - extra_options="${extra_options} rs6000/sysv4.opt" + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" + if test x${enable_secureplt} != xno; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi ;; powerpc-*-eabisimaltivec*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h" @@@@ -3408,9 +3496,11 @@@@ sparc64-*-freebsd*|ultrasparc-*-freebsd* sparc64-*-netbsd*) tm_file="sparc/biarch64.h ${tm_file}" tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h" + tm_file="${tm_file} sparc/default64.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64" + with_cpu=ultrasparc ;; sparc64-*-openbsd*) tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h" @@@@ -3925,6 +4015,9 @@@@ if test x$with_cpu = x ; then frv550-*-*linux*) with_cpu=fr550 ;; + m5200-*-*|m5407-*-*) + with_cpu=${default_cf_cpu} + ;; m68k*-*-*) case "$with_arch" in "cf") @@@@ -4435,7 +4528,7 @@@@ case "${target}" in esac ;; - fido-*-* | m68k*-*-*) + fido-*-* | m68k*-*-* | m5200-*-* | m5407-*-*) supported_defaults="arch cpu" case "$with_arch" in "" | "m68k"| "cf") @ 1.4 log @gcc10: update to 10.4 GCC 10.4 60 bug reports were fixed. Target Specific Changes x86-64 * The x86-64 ABI of passing and returning structures with a 64-bit integer vector changed in GCC 10.1 when MMX is disabled. Disabling MMX no longer changes how they are passed nor returned. This ABI change is now diagnosed with -Wpsabi. @ text @d1 1 a1 1 $NetBSD: patch-gcc_config.gcc,v 1.3 2022/02/02 22:07:28 mrg Exp $ d8 5 a12 3 --- gcc/config.gcc.orig 2021-04-08 04:56:28.033740243 -0700 +++ gcc/config.gcc 2022-02-02 10:27:44.252878051 -0800 @@@@ -462,6 +462,16 @@@@ d29 1 a29 1 @@@@ -877,6 +887,11 @@@@ d41 1 a41 1 @@@@ -1111,6 +1126,11 @@@@ d53 1 a53 1 @@@@ -1252,7 +1272,6 @@@@ d61 1 a61 1 @@@@ -1261,26 +1280,34 @@@@ d103 1 a103 1 @@@@ -1928,6 +1955,7 @@@@ d111 10 a120 1 @@@@ -2250,6 +2278,16 @@@@ d137 1 a137 1 @@@@ -2362,8 +2400,25 @@@@ d164 1 a164 1 @@@@ -2503,6 +2558,26 @@@@ d191 1 a191 1 @@@@ -2918,11 +2993,24 @@@@ d220 1 a220 1 @@@@ -3394,9 +3482,11 @@@@ d232 1 a232 1 @@@@ -3911,6 +4001,9 @@@@ d242 1 a242 1 @@@@ -4421,7 +4514,7 @@@@ @ 1.3 log @pull over the rest of netbsd arm32 configuration from -current. fixes PR#56679. (tested in armv7hf-el chroot on armv8, and also tested doesn't break amd64 version.) @ text @d1 1 a1 1 $NetBSD: patch-gcc_config.gcc,v 1.2 2021/09/23 09:53:21 adam Exp $ a26 9 @@@@ -691,7 +701,7 @@@@ *-*-darwin[4-9]* | *-*-darwin1[0-9]*) macos_min=`expr $darwin_maj - 4` ;; - *-*-darwin20*) + *-*-darwin2[01]*) # Darwin 20 corresponds to macOS 11. macos_maj=11 def_ld64=609.0 @ 1.2 log @gcc10: allow builds on Darwin 21 @ text @d1 1 a1 1 $NetBSD: patch-gcc_config.gcc,v 1.1 2021/04/24 09:35:31 mrg Exp $ d8 3 a10 3 --- gcc/config.gcc.orig 2021-04-08 11:56:28.000000000 +0000 +++ gcc/config.gcc @@@@ -462,6 +462,16 @@@@ m32r*-*-*) d27 1 a27 1 @@@@ -691,7 +701,7 @@@@ case ${target} in d36 1 a36 1 @@@@ -877,6 +887,11 @@@@ case ${target} in d48 1 a48 1 @@@@ -1111,6 +1126,11 @@@@ aarch64*-*-netbsd*) d60 1 a60 1 @@@@ -1252,7 +1272,6 @@@@ arm*-*-freebsd*) # ARM Fr d68 1 a68 1 @@@@ -1261,26 +1280,33 @@@@ arm*-*-netbsdelf*) a74 1 + # GCC 7 vs NetBSD/eabi -> avoid arm unwinder a75 1 + tmake_file="$tmake_file arm/t-netbsdeabi" d78 3 d110 1 a110 1 @@@@ -1928,6 +1954,7 @@@@ i[34567]86-*-netbsdelf*) d118 1 a118 1 @@@@ -2250,6 +2277,16 @@@@ ia64*-*-elf*) d135 1 a135 1 @@@@ -2362,8 +2399,25 @@@@ m68k-*-elf* | fido-*-elf*) d162 1 a162 1 @@@@ -2503,6 +2557,26 @@@@ riscv*-*-freebsd*) d189 1 a189 1 @@@@ -2918,11 +2992,24 @@@@ powerpc*-*-freebsd*) d218 1 a218 1 @@@@ -3394,9 +3481,11 @@@@ sparc64-*-freebsd*|ultrasparc-*-freebsd* d230 1 a230 1 @@@@ -3911,6 +4000,9 @@@@ if test x$with_cpu = x ; then d240 1 a240 1 @@@@ -4421,7 +4513,7 @@@@ case "${target}" in @ 1.1 log @pull in fixes for arm64eb from netbsd src. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 Match what is in NetBSD src. Fixes at least aarch64eb, and d6 5 a10 3 --- gcc/config.gcc.orig 2021-04-08 04:56:28.033740243 -0700 +++ gcc/config.gcc 2021-04-24 00:16:20.082096330 -0700 @@@@ -462,6 +462,16 @@@@ d27 10 a36 1 @@@@ -877,6 +887,11 @@@@ d48 1 a48 1 @@@@ -1111,6 +1126,11 @@@@ d60 1 a60 1 @@@@ -1252,7 +1272,6 @@@@ d68 1 a68 1 @@@@ -1261,26 +1280,33 @@@@ d109 1 a109 1 @@@@ -1928,6 +1954,7 @@@@ d117 1 a117 1 @@@@ -2250,6 +2277,16 @@@@ d134 1 a134 1 @@@@ -2362,8 +2399,25 @@@@ d161 1 a161 1 @@@@ -2503,6 +2557,26 @@@@ d188 1 a188 1 @@@@ -2918,11 +2992,24 @@@@ d217 1 a217 1 @@@@ -3394,9 +3481,11 @@@@ d229 1 a229 1 @@@@ -3911,6 +4000,9 @@@@ d239 1 a239 1 @@@@ -4421,7 +4513,7 @@@@ @