Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 May 2022 08:54:14 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Ed Maste <emaste@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Profiled libraries on freebsd-current
Message-ID:  <Ym6tJn60RmqQVsrv@troutmask.apl.washington.edu>
In-Reply-To: <CAPyFy2AcKcT3NmpA5cs0WG4B7gPCJwdax%2BPp02YHEQBmJ10ZtQ@mail.gmail.com>
References:  <Ymt%2BICLaQPxx2knx@troutmask.apl.washington.edu> <CAPyFy2CuSFd7zm8BvrWYDv%2BEgM0Ryz-bxwWNzUEMEkm0fruokA@mail.gmail.com> <Ym1XE9QSSvIy/4uo@troutmask.apl.washington.edu> <CAPyFy2AcKcT3NmpA5cs0WG4B7gPCJwdax%2BPp02YHEQBmJ10ZtQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 30, 2022 at 04:07:48PM -0400, Ed Maste wrote:
> On Sat, 30 Apr 2022 at 11:34, Steve Kargl
> <sgk@troutmask.apl.washington.edu> wrote:
> >
> > On Sat, Apr 30, 2022 at 09:39:32AM -0400, Ed Maste wrote:
> > > On Fri, 29 Apr 2022 at 01:58, Steve Kargl
> > > <sgk@troutmask.apl.washington.edu> wrote:
> > > >
> > > > If one looks at src.conf(5), one finds
> > > >
> > > >    WITH_PROFILE
> > > >          Build profiled libraries for use with gprof(8).  This option is
> > > >          deprecated and is not present in FreeBSD 14.
> > > >
> > > > I assume that the *_p.a libraries will no longer be built and
> > > > installed on FreeBSD 14 and later.  Is this correct?
> > >
> > > FreeBSD 14 is not yet released, of course, but that is indeed the
> > > intent. PR256874 reports that a GCC patch (to stop linking against
> > > _p.a) is in the works but unfortunately has not had an update for some
> > > time.
> >
> > I see.  It only took me 2+ years to get
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89125
> >
> > committed to the GCC repository.  Good luck with
> > getting your patch upstream.
> 
> Heh, thanks.
> 
> I have just now changed the WITH_PROFILE description to state "a
> future version of FreeBSD" since it may well not happen for FreeBSD
> 14.
> 
> We could also just install libc_p.a as a symlink to libc.a (and same
> for the other _p.a archives).

This works for me, but there is one addition place dealing with -pg
in freebsd-spec.h


diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
index 594487829b5..1e8ab2e1827 100644
--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -93,14 +93,22 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    (similar to the default, except no -lg, and no -p).  */
 
 #ifdef FBSD_NO_THREADS
+#if FBSD_MAJOR < 14
 #define FBSD_LIB_SPEC "							\
-  %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
+ %{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}							\
   }"
 #else
+#define FBSD_LIB_SPEC "							\
+ %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
+is built with the --enable-threads configure-time option.}		\
+  }"
+#endif
+#else
+#if FBSD_MAJOR < 14
 #define FBSD_LIB_SPEC "							\
   %{!shared:								\
     %{!pg: %{pthread:-lpthread} -lc}					\
@@ -109,6 +117,15 @@ is built with the --enable-threads configure-time option.}		\
   %{shared:								\
     %{pthread:-lpthread} -lc						\
   }"
+#else
+#define FBSD_LIB_SPEC "							\
+  %{!shared:								\
+    %{pthread:-lpthread} -lc						\
+  }									\
+  %{shared:								\
+    %{pthread:-lpthread} -lc						\
+  }"
+#endif
 #endif
 
 /* To make matters interesting, we can't actually use __FreeBSD_version
-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Ym6tJn60RmqQVsrv>