pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Successfully bootstrapped pkgsrc-2025Q4 on Solaris 9/sparc with patches



On 2/7/2026 7:43 AM, Jonathan Perkin wrote:
* On 2026-02-07 at 12:24 GMT, Greg Troxel wrote: 
When you post, it would be good to describe solaris 2.9 in terms of
release date, EOL date and how it relates to current solaris.  Also how
bootstrap/README.Solaris is or is not correct.
It is very very EOL.  While officially 2014, in reality much earlier than that. 
My last bulk build for Solaris 9/sparc is here: 
  https://mail-index.netbsd.org/pkgsrc-bulk/2006/12/01/msg003723.html 
nearly 20 years ago, and even that was a year after the 9/05 update release of Solaris 9 which was the last update for it. 


It's funny that you mention pkgsrc-2006Q3 here since, as I found with my messing around, that's the last bootstrap that works out of the box for Solaris 8 & Solaris 9 if you're using gcc. The move to cwrappers for SunOS for Q4 causes issues with Sun's ld; something is getting transformed somewhere into incompatible ld options, which still exists today. I haven't spent enough time trying to find a license for Solaris Studio/Sunpro to see if it's just a gcc + Sun ld problem or not.


You're going to have more issues with third party software support than pkgsrc infrastructure, by a long way.  Especially as support in GCC for Solaris 9 was dropped in GCC 5, so even C++ is going to be a huge burden.

This is where a pkgsrc-legacy branch would be useful, but there has never been enough interest in it. 


Agreed. Additionally, just getting a post-2.95.3 version of gcc isn't super easy (for 32-bit Solaris 9, at least). Your choices are to find an old mirror of sunfreeware to get 3.4.6, the legacy mirror of OpenCSW for 4.0.2, or roll your own.


That said, too, a caveat out of the gate: I'm not a developer, but a former UNIX admin (now a hobbyist, but professional security architect, so I'm not hands-on-keyboard as much). I had to fumble around a bit to figure this out. 


I haven't gotten any farther (yet) than getting the bootstrap process to compile cleanly. It's going to take a bit of work to go past that, as I don't believe any ssl implementation compiles out of the box on Solaris; getting curl/wget2 working will be fun, but it's needed for any sort of ability to fetch consistently.


System Details:


Issues Found & Fixed/Mitigated:


As for the patches:

For lang/nawk

patch-awk.h 
--- awk.h.orig
+++ awk.h
@@ -38,6 +38,17 @@ typedef unsigned char uschar;
 
 #define xfree(a)        { free((void *)(intptr_t)(a)); (a) = NULL; }
 /*
+ * Solaris 9 and earlier declare but don't implement these C99 functions
+ */
+#if defined(__sun) && !defined(HAVE_ISINF)
+#define isinf(x) (!isnan(x) && isnan((x) - (x)))
+#endif
+#if defined(__sun) && !defined(HAVE_SIGNBIT)
+#define signbit(x) ((x) < 0.0 || ((x) == 0.0 && 1.0/(x) < 0.0))
+#endif
+
+/*  * We sometimes cheat writing read-only pointers to NUL-terminate them
  * and then put back the original value
  */


For archivers/libarchive:

--- archive_platform.h.orig     Fri Feb  6 16:45:59 2026
+++ archive_platform.h  Fri Feb  6 16:46:36 2026
@@ -210,4 +210,22 @@
 #define        __LA_FALLTHROUGH
 #endif
 
+/*
+ * Solaris 9 and earlier declare strtoimax/strtoumax in headers
+ * but don't actually implement them in libc. Use strtoll/strtoull
+ * which are equivalent on these platforms.
+ */
+#if defined(__sun) && !defined(HAVE_STRTOIMAX)
+#include <stdlib.h>  /* for strtoll/strtoull */
+static inline intmax_t
+strtoimax(const char *nptr, char **endptr, int base)
+{
+    return strtoll(nptr, endptr, base);
+}
+static inline uintmax_t
+strtoumax(const char *nptr, char **endptr, int base)
+{
+    return strtoull(nptr, endptr, base);
+}
+#endif
 #endif /* !ARCHIVE_PLATFORM_H_INCLUDED */

--- archive_read_support_filter_bzip2.c.orig    Fri Feb  6 16:48:32 2026
+++ archive_read_support_filter_bzip2.c Fri Feb  6 16:49:26 2026
@@ -39,6 +39,7 @@
 #include <unistd.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif


--- archive_read_support_filter_bzip2.c.orig    Fri Feb  6 16:48:32 2026
+++ archive_read_support_filter_bzip2.c Fri Feb  6 16:49:26 2026
@@ -39,6 +39,7 @@
 #include <unistd.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif


--- archive_read_support_format_7zip.c.orig     Fri Feb  6 16:54:10 2026
+++ archive_read_support_format_7zip.c  Fri Feb  6 16:55:36 2026
@@ -35,6 +35,7 @@
 #include <stdlib.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #ifdef HAVE_LZMA_H


--- archive_read_support_format_xar.c.orig      Fri Feb  6 16:54:10 2026
+++ archive_read_support_format_xar.c   Fri Feb  6 16:55:52 2026
@@ -42,6 +42,7 @@
 #include <xmllite.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #if HAVE_LZMA_H


--- archive_read_support_format_zip.c.orig      Fri Feb  6 16:54:10 2026
+++ archive_read_support_format_zip.c   Fri Feb  6 16:56:01 2026
@@ -52,6 +52,7 @@
 #include <zlib.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #ifdef HAVE_LZMA_H


--- archive_util.c.orig Fri Feb  6 16:54:11 2026
+++ archive_util.c      Fri Feb  6 16:56:07 2026
@@ -62,6 +62,7 @@
 #include <lzma.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #ifdef HAVE_LZ4_H


+++ archive_version_details.c   Fri Feb  6 16:56:15 2026
@@ -39,6 +39,7 @@
 #include <lzma.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #ifdef HAVE_LZ4_H
 


--- archive_write_set_format_7zip.c.orig        Fri Feb  6 16:54:11 2026
+++ archive_write_set_format_7zip.c     Fri Feb  6 16:56:30 2026
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #if HAVE_LZMA_H


--- archive_write_set_format_xar.c.orig Fri Feb  6 16:54:11 2026
+++ archive_write_set_format_xar.c      Fri Feb  6 16:56:36 2026
@@ -44,6 +44,7 @@
 #define XAR_WRITER_HAS_XML
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #if HAVE_LZMA_H


--- archive_write_set_format_zip.c.orig Fri Feb  6 16:54:12 2026
+++ archive_write_set_format_zip.c      Fri Feb  6 16:56:47 2026
@@ -56,6 +56,7 @@
 #include <lzma.h>
 #endif
 #ifdef HAVE_BZLIB_H
+#include <stdio.h>  /* Required before bzlib.h on Solaris */
 #include <bzlib.h>
 #endif
 #ifdef HAVE_ZSTD_H







Home | Main Index | Thread Index | Old Index