Re: [PATCH] Use Solaris iconv

Rainer Orth <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
Hi Tom,

>>>>>> "Rainer" == Rainer Orth <[email protected]> writes:
>
> Rainer> However, Solaris 11.4 iconv is good enough to use: enabling its use
> Rainer> fixes 300+ failures.
>
> Rainer> Ok for trunk?
>
> I think it's fine, but my question here is whether gdb intends to
> support versions of Solaris where this might not work.

I've thought about this but decided not to care for anything but Solaris
11.4 for a couple of reasons:

* Over in GCC, I've obsoleted all versions up to and including 11.3 in
  GCC 13.  Support was finally removed in GCC 15.  In all that time, I'm
  not aware of even a single complaint about this.

* Even though GDB might well work on pre-11.4 versions, I'm certainly
  not going to test this.  Howver, unless someone else steps forward to
  do so, untested support is useless IMO

* Right now, without this patch, users get confusing warnings and tons
  of errors, so this is a massive improvement at little cost, so anyone
  using 11.4 benefits without further effort, rather than having to use
  GNU libiconv, which isn't bundled with Solaris.

* Solaris iconv certainly has it's issues.  However, when investigating
  GCC PR c++/112652, I learned that it hasn't been touched in many
  years, so it's unlikely that there are considerable changes since at
  least Solaris 11.0 15 years ago.

* Last but not least, users always have the option to use GNU libiconv
  instead.

> Rainer> -   Finally, some systems do not have iconv, or are really broken
> Rainer> -   (e.g., Solaris, which almost has all of this working, but where
> Rainer> -   just enough is broken to make it too hard to use).  Here we provide
> Rainer> -   a phony iconv which only handles a single character set, and we
>
> Ages ago I wrote this text, and it was true at the time.  IIRC, Solaris
> back then used some undocumented, idiosyncratic, system-specific wchar_t
> encoding and there was no way to convert from the regular encodings to
> wchar_t via iconv, or something like that.
>
> I don't know when Solaris changed to using Unicode.

Me neither: I'd guess it was in the Solaris 10 timeframe (21 years ago
now), when POSIX.1-2001 support was introduced.  TBH I haven't
researched since that's all ancient history now.

> Anyway I guess the question I have is whether this:
>
> Rainer> -      || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108))
> Rainer> +      || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108) \
> Rainer> +      || (defined (__sun__) && defined (__svr4__)))
>  
> ... should check some kind of Solaris version.

I guess there's no use in that.  While Studio cc predefines
__SunOS_RELEASE, gcc does not, so this would have to be done via a
configure test.  Not worth the trouble, I believe.

> If not, maybe adding some note to the commit message on this topic would
> be nice to have.

Will do.

BTW., given the benefit and no impact for other OSes, this might be a
candidate for the GDB 18 release.  Thoughts?

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.