DragonFlyBSD/src 57f067cshare/mk Makefile bsd.sys.mk

share/mk: Minor style cleanups
DeltaFile
+4-2share/mk/Makefile
+3-2share/mk/bsd.sys.mk
+7-42 files

DragonFlyBSD/src 0ad96ccgnu/usr.bin/cc120/libbackend Makefile, gnu/usr.bin/cc120/support-libs/libcommon Makefile

cc80,cc120: Adjust -Wno-narrowing for GCC >= 8.0

Add the necessary check for cc80 libraries so that GCC 12 succeeds in
building GCC 8.

Meanwhile, improve the GCC check to check for any GCC version >= 8.0.
DeltaFile
+1-1gnu/usr.bin/cc120/libbackend/Makefile
+1-1gnu/usr.bin/cc120/support-libs/libcommon-target/Makefile
+1-1gnu/usr.bin/cc120/support-libs/libcommon/Makefile
+1-1gnu/usr.bin/cc80/libbackend/Makefile
+1-1gnu/usr.bin/cc80/support-libs/libcommon-target/Makefile
+1-1gnu/usr.bin/cc80/support-libs/libcommon/Makefile
+6-66 files

DragonFlyBSD/src e2e4617sys/platform/pc64/conf kern.mk, sys/platform/vkernel64/conf kern.mk

sys: Adjust CFLAGS for gcc120
DeltaFile
+2-1sys/platform/pc64/conf/kern.mk
+1-2sys/platform/vkernel64/conf/kern.mk
+3-32 files

DragonFlyBSD/src 41450f4share/mk bsd.sys.mk

share/mk: Adjust warning flags for gcc120
DeltaFile
+13-9share/mk/bsd.sys.mk
+13-91 files

DragonFlyBSD/src 45bb366. Makefile.inc1, gnu/lib Makefile

gcc120: Hook onto build as the alternative compiler
DeltaFile
+18-1Makefile.inc1
+4-4share/man/man5/make.conf.5
+4-0gnu/usr.bin/Makefile
+3-0gnu/lib/Makefile
+1-1share/mk/sys.mk
+1-1gnu/usr.bin/Makefile.cco
+31-76 files

DragonFlyBSD/src ed409f7gnu/lib/gcc120 Makefile, gnu/lib/gcc120/libstd++fs Makefile

gcc120: Build and install libstd++fs.a
DeltaFile
+44-0gnu/lib/gcc120/libstd++fs/Makefile
+3-2share/mk/bsd.libnames.mk
+2-1gnu/lib/gcc120/Makefile
+49-33 files

DragonFlyBSD/src bcc7611etc/mtree BSD.usr.dist, gnu/usr.bin/cc120/support-libs/liblto_plugin Makefile.headers b-header-vars

gcc120: Skip installing the headers for plugin development

The list of headers to install and the b-header-vars file are hard to
generate from vendor makefiles and require manual creation from a staged
GCC installation.

Given that these files are only needed for developing GCC plugins
instead of running them, so just skip installing them in the base
system.

One more thing, the 'gengtype' tool should be installed (into
/usr/libexec/gcc120/plugin/) together with these headers for plugin
development.
DeltaFile
+0-408gnu/usr.bin/cc120/support-libs/liblto_plugin/Makefile.headers
+0-90gnu/usr.bin/cc120/support-libs/liblto_plugin/b-header-vars
+0-32gnu/usr.bin/cc120/support-libs/liblto_plugin/Makefile
+0-18etc/mtree/BSD.usr.dist
+0-5484 files

DragonFlyBSD/src 39ea5c2etc/mtree BSD.include.dist BSD.usr.dist

mtree: Add directories for gcc120

Based on the hierarchy of gcc80, but without
'include/c++/12.0/profile/impl'.
DeltaFile
+74-0etc/mtree/BSD.include.dist
+28-0etc/mtree/BSD.usr.dist
+102-02 files

DragonFlyBSD/src 7c9a20agnu/lib/gcc120/libgcc Makefile Makefile.src, gnu/lib/gcc120/libstdcxx/headers Makefile.headers

gcc120: Rework the makefiles to fix issues and ease future upgrades

* Remove many obsolete comments copied from gcc80's makefiles.

* Remove the unneeded 'Makefile.intcxx_lib' because all the C++ files
  have been renamed to use the proper .cc suffix so we can simply use
  the <bsd.hostlib.mk> makefile.

* Rework libgcc's makefiles.  Rewrite the libgcc/Makefile.src to
  follow the processes in GCC's makefile as much as possible.  Now the
  libgcc is built with the same source list as in the GCC's makefile.

* Fix and rework libstdcxx's makefiles.

  - Refactor headers/Makefile.headers to reduce the difference with
    GCC's makefile.
  - Add libconv_2017 and libconv_2020.
  - Fix headers preparation and enable '-nostdinc++' for building the
    component and product libraries.  As a result, use FILESGROUPS

    [21 lines not shown]
DeltaFile
+188-75gnu/lib/gcc120/libstdcxx/headers/Makefile.headers
+122-139gnu/lib/gcc120/libgcc/Makefile
+137-123gnu/usr.bin/cc120/cc_tools/tools/Makefile
+189-57gnu/lib/gcc120/libgcc/Makefile.src
+0-228gnu/usr.bin/cc120/Makefile.intcxx_lib
+74-97gnu/usr.bin/cc120/libbackend/Makefile
+710-71954 files not shown
+1,472-1,43260 files

DragonFlyBSD/src fad60f9gnu/lib/gcc120/libstdcxx/headers Makefile.headers, gnu/usr.bin/cc120 Makefile.langs Makefile.intcxx_lib

gcc120: Add makefiles based on gcc80

Based on the makefiles for gcc 8.3, by way of 9.5, 10.5, and 11.5

GCC 12.5 has added:
* a new library "libcody"
* a new place for compiler-related tools "c++tools"
* the static analyzer "gcc/analyzer"

Also, all (C++) '.c' files in gcc/ have been renamed to '.cc'.
DeltaFile
+948-0gnu/lib/gcc120/libstdcxx/headers/Makefile.headers
+557-0gnu/usr.bin/cc120/libbackend/Makefile
+408-0gnu/usr.bin/cc120/support-libs/liblto_plugin/Makefile.headers
+238-0gnu/usr.bin/cc120/Makefile.langs
+231-0gnu/usr.bin/cc120/cc_tools/tools/Makefile
+228-0gnu/usr.bin/cc120/Makefile.intcxx_lib
+2,610-063 files not shown
+5,353-069 files

DragonFlyBSD/src c377737share/mk bsd.cpu.gcc120.mk bsd.cpu.mk

share/mk: Add bsd.cpu.gcc120.mk

Basically a copy of 'bsd.cpu.gcc80.mk'.
DeltaFile
+137-0share/mk/bsd.cpu.gcc120.mk
+2-0share/mk/bsd.cpu.mk
+1-0share/mk/Makefile
+1-0share/mk/bsd.README
+141-04 files

DragonFlyBSD/src 8747051gnu/usr.bin/cc120/cc_prep/config dragonfly-native.h

gcc120: Copy dragonfly-native.h from gcc80

No change needed for this local header.
DeltaFile
+81-0gnu/usr.bin/cc120/cc_prep/config/dragonfly-native.h
+81-01 files

DragonFlyBSD/src f94d50dgnu/usr.bin/cc120/cc_prep auto-host.h, gnu/usr.bin/cc120/support-libs/libcpp config.h

gcc120: Apply local changes to generated headers

Port from gcc80:
- gcc80: Partially implement TOOLCHAIN_CHECKING.
  commit: 49138b3b71797ee9e8eaeb7f242255bc549486f0
- gcc80: Make bootstrapping more permissive.
  commit: 225cb38fefe493d6b322d9e7699d9987ec2c56e5
DeltaFile
+28-0gnu/usr.bin/cc120/cc_prep/auto-host.h
+6-0gnu/usr.bin/cc120/support-libs/libcpp/config.h
+34-02 files

DragonFlyBSD/src c9edcd0gnu/lib/gcc120/libgomp config.h, gnu/lib/gcc120/libstdcxx/headers config.h

gcc120: Add generated headers

Directly copied from a configured and built GCC.
DeltaFile
+2,777-0gnu/usr.bin/cc120/cc_prep/auto-host.h
+1,405-0gnu/lib/gcc120/libstdcxx/headers/config.h
+578-0gnu/usr.bin/cc120/support-libs/libiberty/config.h
+381-0gnu/usr.bin/cc120/support-libs/libcpp/config.h
+203-0gnu/lib/gcc120/libgomp/config.h
+185-0gnu/usr.bin/cc120/support-libs/libbacktrace/config.h
+5,529-011 files not shown
+6,098-017 files

DragonFlyBSD/src 822cc51contrib/gcc-12 README.DRAGONFLY, contrib/gcc-12/gcc common.opt

contrib/gcc-12: Patch options to use DWARF v4 by default

Because our GDB in base is 7.6 and is too old to read the DWARF v5 that
is used by GCC 12.5 by default.  In addition, there is no longer a
configure option to override the default DWARF version.  Therefore, we
decided to patch the GCC source code.

We could tweak the world/kernel makefiles to add the
'-gdwarf-4 -gstrict-dwarf' options, but that couldn't solve the issue
that a user cannot use the base GDB to debug one's own binary built
outside the world/kernel.

Discussed-with: swildner
DeltaFile
+2-2contrib/gcc-12/gcc/common.opt
+1-0contrib/gcc-12/README.DRAGONFLY
+3-22 files

DragonFlyBSD/src 97b9ed6contrib/gcc-12 README.DRAGONFLY, contrib/gcc-12/gcc gcc.cc

contrib/gcc-12: Add local -save-temp=objects option

The upstream has considerably reworked how the -save-temps option (and
friends) works [1], so we have to adjust the GCC-8 patch [2] for GCC-12.

Meanwhile, apply commit d0443a708c [3] to the gcc.1 man page.

[1] revamp dump and aux output names
    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1dedc12d186a110854537e1279b4e6c29f2df35a
[2] gcc80: Add local -save-temps=objects option
    commit df642abc04
[3] gcc80: Document -save-temps=objects addition
    commit d0443a708c
DeltaFile
+22-1contrib/gcc-12/gcc/doc/gcc.1
+14-3contrib/gcc-12/gcc/gcc.cc
+2-0contrib/gcc-12/README.DRAGONFLY
+38-43 files

DragonFlyBSD/src 80eae53contrib/gcc-12 README.DRAGONFLY, contrib/gcc-12/gcc gcc.cc

contrib/gcc-12: Apply local changes from GCC-8

bd23261bc0 libstdc++: Fix unsigned wraparound in codecvt::do_length [PR105857]
fca8e87b2e gcc: Define ElfW() if it is not defined.
2007c584a7 gcc8: Fix the fix.
9cf0c62db7 gccs had ElfW() already. Comment out for now.
2ecd6c6623 gcc: Allow our C++ headers to survive -Wsystem-headers (2).
894c19b2d8 gcc: Allow our C++ headers to survive -Wsystem-headers.
a69def156b gcc80: Handle TZ specific "%+" format in strftime.
fcad8200ea gcc80: Remove throw() from protos in libstdc++ headers.
3dcb3c95ea gcc80: Add alternative variant of pthread presence checking.
632577dbc0 gcc80: Adjust search paths for base compiler layout.
ed36d35d08 gcc80: Adjust default dynamic linker search location.
DeltaFile
+24-0contrib/gcc-12/libgcc/gthr-posix.h
+9-9contrib/gcc-12/libstdc++-v3/include/c_global/cstdlib
+17-0contrib/gcc-12/README.DRAGONFLY
+16-0contrib/gcc-12/gcc/gcc.cc
+5-3contrib/gcc-12/libstdc++-v3/config/locale/dragonfly/codecvt_members.cc
+7-1contrib/gcc-12/libstdc++-v3/config/os/bsd/dragonfly/os_defines.h
+78-135 files not shown
+93-2111 files

DragonFlyBSD/src 5ab9b8fcontrib/gcc-12 README.DELETED README.DRAGONFLY

contrib/gcc-12: Add README.DRAGONFLY and README.DELETED
DeltaFile
+1,361-0contrib/gcc-12/README.DELETED
+23-0contrib/gcc-12/README.DRAGONFLY
+1,384-02 files

DragonFlyBSD/src 1b556c2contrib/gcc-12/gcc dwarf2out.cc, contrib/gcc-12/gcc/config/i386 sse.md i386.cc

Merge branch 'vendor/GCC120'

Import GCC 12.5.0 Release.
DeltaFile
+48,407-0contrib/gcc-12/gcc/cp/parser.cc
+33,255-0contrib/gcc-12/gcc/dwarf2out.cc
+32,566-0contrib/gcc-12/gcc/doc/gcc.1
+31,084-0contrib/gcc-12/gcc/cp/pt.cc
+28,588-0contrib/gcc-12/gcc/config/i386/sse.md
+24,936-0contrib/gcc-12/gcc/config/i386/i386.cc
+198,836-02,607 files not shown
+2,563,370-02,613 files

DragonFlyBSD/src 2338f0econtrib/gcc-12/gcc dwarf2out.cc, contrib/gcc-12/gcc/config/i386 sse.md i386.cc

Import GCC 12.5.0 Release (2025-07-11)

Source downloaded from:
https://ftp.gnu.org/gnu/gcc/gcc-12.5.0/gcc-12.5.0.tar.xz

aly: All the unused files have been trimmed by checking the 'atime'
(access time):
1. Create a UFS filesystem using vn(4) and mount it at contrib/gcc-12;
2. Copy the full source over;
3. Touch all files: find . | xargs touch
4. Create a timestamp mark: touch TMARK
5. Manually touch the files to keep:
   $ touch README COPYING* LAST_UPDATED gcc/BASE-VER
6. Build world
7. Delete unused files:
   $ find . -type f '!' -anewer TMARK -delete
   $ find . -empty -delete
DeltaFile
+48,407-0contrib/gcc-12/gcc/cp/parser.cc
+33,255-0contrib/gcc-12/gcc/dwarf2out.cc
+32,566-0contrib/gcc-12/gcc/doc/gcc.1
+31,084-0contrib/gcc-12/gcc/cp/pt.cc
+28,588-0contrib/gcc-12/gcc/config/i386/sse.md
+24,936-0contrib/gcc-12/gcc/config/i386/i386.cc
+198,836-02,607 files not shown
+2,563,370-02,613 files

DragonFlyBSD/src 7d36bc5sys/bus/mmc mmc_subr.c

mmc - Fix missing variable initialization in mmc_switch_status

Found via gcc14 -fanalyzer.

Also part of FreeBSD commit aca38eab8a12.
DeltaFile
+1-0sys/bus/mmc/mmc_subr.c
+1-01 files

DragonFlyBSD/src ab75162gnu/lib/gcc47 Makefile.inc, gnu/lib/gcc47/libsupc++ Makefile

gcc47/libsupc++: Fix config.h for cp-demangle.c

Similar to the previous fix to gcc80/libstdcxx/libconv_supc, apply the
same config.h fix to gcc47/libsupc++.
DeltaFile
+9-3gnu/lib/gcc47/libsupc++/Makefile
+2-0gnu/lib/gcc47/Makefile.inc
+11-32 files

DragonFlyBSD/src 60e05d4gnu/lib/gcc80 Makefile.inc, gnu/lib/gcc80/libstdcxx Makefile.inc

gcc80/libstdcxx: Fix config.h for libconv_supc/cp-demangle.c

cp-demangle.c is provided by libiberty, so it must be built with
libiberty's 'config.h'.  Introduce the 'GCC_NO_INC' make variable to
avoid including any search paths so we can specify the correct search
path for cp-demangle.c.  Meanwhile, add the rule to copy over the
libiberty config.h.

In addition, apply GCC_NO_INC=yes to other libstdcxx components as it
turned out these search paths are unneeded.
DeltaFile
+8-4gnu/lib/gcc80/libstdcxx/components/libconv_supc/Makefile
+1-1gnu/lib/gcc80/libstdcxx/components/libconv_2011/Makefile
+1-1gnu/lib/gcc80/libstdcxx/headers/Makefile
+1-1gnu/lib/gcc80/libstdcxx/product/Makefile
+2-0gnu/lib/gcc80/libstdcxx/Makefile.inc
+2-0gnu/lib/gcc80/Makefile.inc
+15-71 files not shown
+16-87 files

DragonFlyBSD/src 9861df6sys/conf kmod.mk

sys/kmod.mk: Remove the obsolete CFLAGS handling for FREEBSD_COMPAT
DeltaFile
+0-4sys/conf/kmod.mk
+0-41 files

DragonFlyBSD/src e51ddf9sys/platform/pc64/conf kern.mk

pc64: Add '-mno-fp-ret-in-387' compiler option

This option prevents returning floating-point values in x87 registers.

I don't think our kernel has such issues, but just be safe.
DeltaFile
+1-0sys/platform/pc64/conf/kern.mk
+1-01 files

DragonFlyBSD/src e8f153csys/platform/pc64/conf kern.mk

pc64: Remove the obsolete '-mno-sse5' option

There was no SSE5; AMD abandoned that and GCC also dropped this option.
DeltaFile
+1-2sys/platform/pc64/conf/kern.mk
+1-21 files

DragonFlyBSD/src 6bf6d10gnu/usr.bin/cc47/cc_prep/config dragonfly-native.h, gnu/usr.bin/cc80/cc_prep/config dragonfly-native.h

gcc47,gcc80: Define LINK_SSP_SPEC to link with libssp_nonshared.a

libssp_nonshared.a provides '__stack_chk_fail_local()' as a hidden
symbol to avoids PLT overhead on 32-bit x86 by deferring PIC register
setup to the cold failure path.  Although our libc.a (static) also
provides the '__stack_chk_fail_local()', it cannot be used when the
program is dynamically linked.

Note that on x86-64, GCC calls '__stack_chk_fail()' directly because
RIP-relative addressing makes PLT efficient, but we link
libssp_nonshared.a for consistency with other systems as well as for
future-proof.

One more thing, the 'TARGET_LIBC_PROVIDES_SSP' macro is undefined in GCC
4.7's 'auto-host.h' but defined to be 1 in GCC 8.0's.  However, this
difference is ignored when 'LINK_SSP_SPEC' is explicitly defined.
DeltaFile
+16-0gnu/usr.bin/cc47/cc_prep/config/dragonfly-native.h
+16-0gnu/usr.bin/cc80/cc_prep/config/dragonfly-native.h
+32-02 files

DragonFlyBSD/src 71f5450gnu/usr.bin/cc47/cc_prep/config dragonfly-native.h

cc47: Whitespace cleanups to cc_prep/config/dragonfly-native.h

Reduce diffs with cc80's dragonfly-native.h.
DeltaFile
+7-7gnu/usr.bin/cc47/cc_prep/config/dragonfly-native.h
+7-71 files

DragonFlyBSD/src 2465962gnu/lib/csu Makefile.csu

gnu/lib/csu: Remove unused MFILE=${.ALLSRC} from 'tm.h' target

All the ${MFILE} variables used in gnu/usr.bin/cc* refer to man pages,
so this MFILE=${.ALLSRC} is never used.
DeltaFile
+1-1gnu/lib/csu/Makefile.csu
+1-11 files

DragonFlyBSD/src b7b9426gnu/lib/gcc47 Makefile.inc, gnu/usr.bin/cc47 Makefile.tgt

gcc47: Minor cleanups to makefiles

- Remove unused LIBSUPCPP and GTFILES_SRCDIR.
- Include <bsd.subdir.mk> instead of <bsd.obj.mk> for cc_tools/Makefile
  to make more sense.
DeltaFile
+0-2gnu/lib/gcc47/Makefile.inc
+0-2gnu/usr.bin/cc47/Makefile.tgt
+1-1gnu/usr.bin/cc47/cc_tools/Makefile
+1-53 files