diff options
author | Andreas Tobler <andreast@gcc.gnu.org> | 2024-06-09 23:18:04 +0200 |
---|---|---|
committer | Gerald Pfeifer <gerald@pfeifer.com> | 2024-06-09 23:18:04 +0200 |
commit | 48abb540701447b0cd9df7542720ab65a34fc1b1 (patch) | |
tree | e85f5dfbd3581557056269aa853e19e3b0500edd | |
parent | 932c6f8dd8859afb13475c2de466bd1a159530da (diff) | |
download | gcc-48abb540701447b0cd9df7542720ab65a34fc1b1.zip gcc-48abb540701447b0cd9df7542720ab65a34fc1b1.tar.gz gcc-48abb540701447b0cd9df7542720ab65a34fc1b1.tar.bz2 |
FreeBSD: Stop linking _p libs for -pg as of FreeBSD 14
As of FreeBSD version 14, FreeBSD no longer provides profiled system
libraries like libc_p and libpthread_p. Stop linking against them if
the FreeBSD major version is 14 or more.
gcc:
* config/freebsd-spec.h: Change fbsd-lib-spec for FreeBSD > 13,
do not link against profiled system libraries if -pg is invoked.
Add a define to note about this change.
* config/aarch64/aarch64-freebsd.h: Use the note to inform if
-pg is invoked on FreeBSD > 13.
* config/arm/freebsd.h: Likewise.
* config/i386/freebsd.h: Likewise.
* config/i386/freebsd64.h: Likewise.
* config/riscv/freebsd.h: Likewise.
* config/rs6000/freebsd64.h: Likewise.
* config/rs6000/sysv4.h: Likeise.
-rw-r--r-- | gcc/config/aarch64/aarch64-freebsd.h | 1 | ||||
-rw-r--r-- | gcc/config/arm/freebsd.h | 1 | ||||
-rw-r--r-- | gcc/config/freebsd-spec.h | 18 | ||||
-rw-r--r-- | gcc/config/i386/freebsd.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/freebsd64.h | 1 | ||||
-rw-r--r-- | gcc/config/riscv/freebsd.h | 1 | ||||
-rw-r--r-- | gcc/config/rs6000/freebsd64.h | 1 | ||||
-rw-r--r-- | gcc/config/rs6000/sysv4.h | 1 |
8 files changed, 21 insertions, 4 deletions
diff --git a/gcc/config/aarch64/aarch64-freebsd.h b/gcc/config/aarch64/aarch64-freebsd.h index 53cc17a..e26d69c 100644 --- a/gcc/config/aarch64/aarch64-freebsd.h +++ b/gcc/config/aarch64/aarch64-freebsd.h @@ -35,6 +35,7 @@ #undef FBSD_TARGET_LINK_SPEC #define FBSD_TARGET_LINK_SPEC " \ %{p:%nconsider using `-pg' instead of `-p' with gprof (1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/gcc/config/arm/freebsd.h b/gcc/config/arm/freebsd.h index 9d0a5a8..ee4860a 100644 --- a/gcc/config/arm/freebsd.h +++ b/gcc/config/arm/freebsd.h @@ -47,6 +47,7 @@ #undef LINK_SPEC #define LINK_SPEC " \ %{p:%nconsider using `-pg' instead of `-p' with gprof (1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index a6d1ad1..f43056b 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -92,19 +92,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see libc, depending on whether we're doing profiling or need threads support. (similar to the default, except no -lg, and no -p). */ +#if FBSD_MAJOR < 14 +#define FBSD_LINK_PG_NOTHREADS "%{!pg: -lc} %{pg: -lc_p}" +#define FBSD_LINK_PG_THREADS "%{!pg: %{pthread:-lpthread} -lc} " \ + "%{pg: %{pthread:-lpthread} -lc_p}" +#define FBSD_LINK_PG_NOTE "" +#else +#define FBSD_LINK_PG_NOTHREADS "%{-lc} " +#define FBSD_LINK_PG_THREADS "%{pthread:-lpthread} -lc " +#define FBSD_LINK_PG_NOTE "%{pg:%nFreeBSD no longer provides profiled "\ + "system libraries}" +#endif + #ifdef FBSD_NO_THREADS #define FBSD_LIB_SPEC " \ %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \ is built with the --enable-threads configure-time option.} \ %{!shared: \ - %{!pg: -lc} \ - %{pg: -lc_p} \ + " FBSD_LINK_PG_NOTHREADS " \ }" #else #define FBSD_LIB_SPEC " \ %{!shared: \ - %{!pg: %{pthread:-lpthread} -lc} \ - %{pg: %{pthread:-lpthread_p} -lc_p} \ + " FBSD_LINK_PG_THREADS " \ } \ %{shared: \ %{pthread:-lpthread} -lc \ diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h index 3c57dc7..583c752 100644 --- a/gcc/config/i386/freebsd.h +++ b/gcc/config/i386/freebsd.h @@ -80,6 +80,7 @@ along with GCC; see the file COPYING3. If not see #undef LINK_SPEC #define LINK_SPEC "\ %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/gcc/config/i386/freebsd64.h b/gcc/config/i386/freebsd64.h index af3fc30..12985e2 100644 --- a/gcc/config/i386/freebsd64.h +++ b/gcc/config/i386/freebsd64.h @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #define LINK_SPEC "\ %{m32:-m elf_i386_fbsd}%{!m32:-m elf_x86_64_fbsd} \ %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/gcc/config/riscv/freebsd.h b/gcc/config/riscv/freebsd.h index 5dd4d51..6063861 100644 --- a/gcc/config/riscv/freebsd.h +++ b/gcc/config/riscv/freebsd.h @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see #define LINK_SPEC " \ -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv \ %{p:%nconsider using `-pg' instead of `-p' with gprof (1)} \ + " FBSD_LINK_PG_NOTES " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ -X \ diff --git a/gcc/config/rs6000/freebsd64.h b/gcc/config/rs6000/freebsd64.h index 55e75cf..6740170 100644 --- a/gcc/config/rs6000/freebsd64.h +++ b/gcc/config/rs6000/freebsd64.h @@ -112,6 +112,7 @@ extern int dot_symbols; #define LINK_OS_FREEBSD_SPEC_DEF "\ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index bcafa9d..e997dd7 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -748,6 +748,7 @@ GNU_USER_TARGET_CC1_SPEC #define LINK_OS_FREEBSD_SPEC "\ %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ + " FBSD_LINK_PG_NOTE " \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ |