diff mbox series

Remove support for FreeBSD 4.x (and earlier)

Message ID alpine.LSU.2.21.1805242313000.3624@anthias.pfeifer.com
State New
Headers show
Series Remove support for FreeBSD 4.x (and earlier) | expand

Commit Message

Gerald Pfeifer May 24, 2018, 9:36 p.m. UTC
FreeBSD 5.0 was released in January of 2003, and FreeBSD 4.11, the last 
on that branch in January of 2005, so it appears time to remove support 
for anything older than FreeBSD 5.x, if for no other reason to simplify 
things a bit.

This simplifies the spec file a fair bit, and I would not be surprised 
for even FreeBSD 5.x not to really work any longer.

On the way, move a now no longer relevant comment where it is still 
applicable.

What do you think?  (Let me know if you'd like me to keep the first 
sentence of the original comment.)

Gerald

2018-05-24  Gerald Pfeifer  <gerald@pfeifer.com>

	* config/freebsd-spec.h (FBSD_LIB_SPEC): Only consider FreeBSD 5
	and later.

Comments

Jeff Law May 24, 2018, 9:39 p.m. UTC | #1
On 05/24/2018 03:36 PM, Gerald Pfeifer wrote:
> FreeBSD 5.0 was released in January of 2003, and FreeBSD 4.11, the last 
> on that branch in January of 2005, so it appears time to remove support 
> for anything older than FreeBSD 5.x, if for no other reason to simplify 
> things a bit.
> 
> This simplifies the spec file a fair bit, and I would not be surprised 
> for even FreeBSD 5.x not to really work any longer.
> 
> On the way, move a now no longer relevant comment where it is still 
> applicable.
> 
> What do you think?  (Let me know if you'd like me to keep the first 
> sentence of the original comment.)
> 
> Gerald
> 
> 2018-05-24  Gerald Pfeifer  <gerald@pfeifer.com>
> 
> 	* config/freebsd-spec.h (FBSD_LIB_SPEC): Only consider FreeBSD 5
> 	and later.
Happy to trust you on what versions can be dropped and the resulting
simplifications.

Is it worth noting those old versions as deprecated/obsolete in config.gcc?

jeff
Gerald Pfeifer May 28, 2018, 6:57 a.m. UTC | #2
On Thu, 24 May 2018, Jeff Law wrote:
> Happy to trust you on what versions can be dropped and the resulting
> simplifications.
> 
> Is it worth noting those old versions as deprecated/obsolete in config.gcc?

Good catch, Jeff, thanks.  Updated patch (also wrt. comments) below.

Andreas, anyhing from your side?

Gerald

2018-05-27  Gerald Pfeifer  <gerald@pfeifer.com>

	* config.gcc: Identify FreeBSD 3.x and 4.x as unsupported.

	* config/freebsd-spec.h (FBSD_LIB_SPEC): Only consider FreeBSD 5
	and later.

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 260808)
+++ gcc/config.gcc	(working copy)
@@ -268,7 +268,7 @@
  | pdp11-*-bsd				\
  | sparc-hal-solaris2*			\
  | thumb-*-*				\
- | *-*-freebsd[12] | *-*-freebsd[12].*	\
+ | *-*-freebsd[12] | *-*-freebsd[1234].* \
  | *-*-freebsd*aout*			\
  | *-*-linux*aout*			\
  | *-*-linux*coff*			\
Index: gcc/config/freebsd-spec.h
===================================================================
--- gcc/config/freebsd-spec.h	(revision 260808)
+++ gcc/config/freebsd-spec.h	(working copy)
@@ -79,15 +79,10 @@
 #define FBSD_ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
-/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
-   required by the user-land thread model.  Before __FreeBSD_version
-   500016, select the appropriate libc, depending on whether we're
-   doing profiling or need threads support.  At __FreeBSD_version
-   500016 and later, when threads support is requested include both
-   -lc and the threading lib instead of only -lc_r.  To make matters
-   interesting, we can't actually use __FreeBSD_version provided by
-   <osreldate.h> directly since it breaks cross-compiling.  As a final
-   twist, make it a hard error if -pthread is provided on the command
+/* When threads support is requested include both -lc and the threading
+   library (which assumes FreeBSD 5.x or later, __FreeBSD_version 500016
+   to be precise).
+   And make it a hard error if -pthread is provided on the command
    line and gcc was configured with --disable-threads (this will help
    avoid bug reports from users complaining about threading when they
    misconfigured the gcc bootstrap but are later consulting FreeBSD
@@ -106,19 +101,8 @@
     %{pg:  -lc_p}							\
   }"
 #else
-#if FBSD_MAJOR < 5
 #define FBSD_LIB_SPEC "							\
   %{!shared:								\
-    %{!pg:								\
-      %{!pthread:-lc}							\
-      %{pthread:-lc_r}}							\
-    %{pg:								\
-      %{!pthread:-lc_p}							\
-      %{pthread:-lc_r_p}}						\
-  }"
-#else
-#define FBSD_LIB_SPEC "							\
-  %{!shared:								\
     %{!pg: %{pthread:-lpthread} -lc}					\
     %{pg:  %{pthread:-lpthread_p} -lc_p}				\
   }									\
@@ -126,8 +110,10 @@
     %{pthread:-lpthread} -lc						\
   }"
 #endif
-#endif
 
+/* To make matters interesting, we can't actually use __FreeBSD_version
+   provided by <osreldate.h> directly since it breaks cross-compiling.  */
+
 #if FBSD_MAJOR < 6
 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
 #else
Andreas Tobler May 28, 2018, 4:18 p.m. UTC | #3
On 28.05.18 08:57, Gerald Pfeifer wrote:
> On Thu, 24 May 2018, Jeff Law wrote:
>> Happy to trust you on what versions can be dropped and the resulting
>> simplifications.
>>
>> Is it worth noting those old versions as deprecated/obsolete in config.gcc?
> 
> Good catch, Jeff, thanks.  Updated patch (also wrt. comments) below.
> 
> Andreas, anyhing from your side?

Ok.
Thanks,
Andreas
> 
> Gerald
> 
> 2018-05-27  Gerald Pfeifer  <gerald@pfeifer.com>
> 
> 	* config.gcc: Identify FreeBSD 3.x and 4.x as unsupported.
> 
> 	* config/freebsd-spec.h (FBSD_LIB_SPEC): Only consider FreeBSD 5
> 	and later.
> 
> Index: gcc/config.gcc
> ===================================================================
> --- gcc/config.gcc	(revision 260808)
> +++ gcc/config.gcc	(working copy)
> @@ -268,7 +268,7 @@
>    | pdp11-*-bsd				\
>    | sparc-hal-solaris2*			\
>    | thumb-*-*				\
> - | *-*-freebsd[12] | *-*-freebsd[12].*	\
> + | *-*-freebsd[12] | *-*-freebsd[1234].* \
>    | *-*-freebsd*aout*			\
>    | *-*-linux*aout*			\
>    | *-*-linux*coff*			\
> Index: gcc/config/freebsd-spec.h
> ===================================================================
> --- gcc/config/freebsd-spec.h	(revision 260808)
> +++ gcc/config/freebsd-spec.h	(working copy)
> @@ -79,15 +79,10 @@
>   #define FBSD_ENDFILE_SPEC \
>     "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
>   
> -/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
> -   required by the user-land thread model.  Before __FreeBSD_version
> -   500016, select the appropriate libc, depending on whether we're
> -   doing profiling or need threads support.  At __FreeBSD_version
> -   500016 and later, when threads support is requested include both
> -   -lc and the threading lib instead of only -lc_r.  To make matters
> -   interesting, we can't actually use __FreeBSD_version provided by
> -   <osreldate.h> directly since it breaks cross-compiling.  As a final
> -   twist, make it a hard error if -pthread is provided on the command
> +/* When threads support is requested include both -lc and the threading
> +   library (which assumes FreeBSD 5.x or later, __FreeBSD_version 500016
> +   to be precise).
> +   And make it a hard error if -pthread is provided on the command
>      line and gcc was configured with --disable-threads (this will help
>      avoid bug reports from users complaining about threading when they
>      misconfigured the gcc bootstrap but are later consulting FreeBSD
> @@ -106,19 +101,8 @@
>       %{pg:  -lc_p}							\
>     }"
>   #else
> -#if FBSD_MAJOR < 5
>   #define FBSD_LIB_SPEC "							\
>     %{!shared:								\
> -    %{!pg:								\
> -      %{!pthread:-lc}							\
> -      %{pthread:-lc_r}}							\
> -    %{pg:								\
> -      %{!pthread:-lc_p}							\
> -      %{pthread:-lc_r_p}}						\
> -  }"
> -#else
> -#define FBSD_LIB_SPEC "							\
> -  %{!shared:								\
>       %{!pg: %{pthread:-lpthread} -lc}					\
>       %{pg:  %{pthread:-lpthread_p} -lc_p}				\
>     }									\
> @@ -126,8 +110,10 @@
>       %{pthread:-lpthread} -lc						\
>     }"
>   #endif
> -#endif
>   
> +/* To make matters interesting, we can't actually use __FreeBSD_version
> +   provided by <osreldate.h> directly since it breaks cross-compiling.  */
> +
>   #if FBSD_MAJOR < 6
>   #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
>   #else
>
diff mbox series

Patch

Index: gcc/config/freebsd-spec.h
===================================================================
--- gcc/config/freebsd-spec.h	(revision 260690)
+++ gcc/config/freebsd-spec.h	(working copy)
@@ -79,15 +79,9 @@ 
 #define FBSD_ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
-/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
-   required by the user-land thread model.  Before __FreeBSD_version
-   500016, select the appropriate libc, depending on whether we're
-   doing profiling or need threads support.  At __FreeBSD_version
-   500016 and later, when threads support is requested include both
-   -lc and the threading lib instead of only -lc_r.  To make matters
-   interesting, we can't actually use __FreeBSD_version provided by
-   <osreldate.h> directly since it breaks cross-compiling.  As a final
-   twist, make it a hard error if -pthread is provided on the command
+/* When threads support is requested (assuming FreeBSD 5.x and later)
+   include both -lc and the threading lib.  
+   And make it a hard error if -pthread is provided on the command
    line and gcc was configured with --disable-threads (this will help
    avoid bug reports from users complaining about threading when they
    misconfigured the gcc bootstrap but are later consulting FreeBSD
@@ -106,19 +100,8 @@ 
     %{pg:  -lc_p}							\
   }"
 #else
-#if FBSD_MAJOR < 5
 #define FBSD_LIB_SPEC "							\
   %{!shared:								\
-    %{!pg:								\
-      %{!pthread:-lc}							\
-      %{pthread:-lc_r}}							\
-    %{pg:								\
-      %{!pthread:-lc_p}							\
-      %{pthread:-lc_r_p}}						\
-  }"
-#else
-#define FBSD_LIB_SPEC "							\
-  %{!shared:								\
     %{!pg: %{pthread:-lpthread} -lc}					\
     %{pg:  %{pthread:-lpthread_p} -lc_p}				\
   }									\
@@ -126,8 +109,10 @@ 
     %{pthread:-lpthread} -lc						\
   }"
 #endif
-#endif
 
+/* To make matters interesting, we can't actually use __FreeBSD_version
+   provided by <osreldate.h> directly since it breaks cross-compiling.  */
+
 #if FBSD_MAJOR < 6
 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
 #else