[binutils-gdb] bfd: Always use CP_ACP=1 on Solaris [PR11280]

Rainer Orth via Binutils-cvs <[email protected]> Mon, 29 Jun 2026 11:26:10 +0000 (GMT)
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0e73a13ca62af0f1383ba97b40600554264498fc

commit 0e73a13ca62af0f1383ba97b40600554264498fc
Author: Rainer Orth <[email protected]>
Date:   Mon Jun 29 13:25:38 2026 +0200

    bfd: Always use CP_ACP=1 on Solaris [PR11280]
    
    bfd/configure.host defines CP_ACP=1 on Solaris 11 as a workaround for
    the lack the MS-ANSI codepage in Solaris libc iconv(3C).  However, the
    issue isn't restricted to some OpenSolaris build as the comment
    suggests, but present on Solaris in general as can be seen in the iconv -l
    output:
    
    On both Solaris 10 and 11.4, one gets
    
            CP1252 (1252, ANSI-1252, WINDOWS-1252),
    
    unlike GNU iconv which lists
    
            CP1252 MS-ANSI WINDOWS-1252
    
    Therefore, this patch applies the patch on all Solaris versions.
    
    Tested on {amd64,i386}-pc-solaris2.11 and sparc{v9,}-sun-solaris2.11.
    
    2026-06-28  Rainer Orth  <[email protected]>
    
            bfd:
            PR binutils/11280
            * configure.host (HDEFINES): Always define CP_ACP=1 on Solaris.

Diff:
---
 bfd/configure.host | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bfd/configure.host b/bfd/configure.host
index 4ec3c4e6075..6ca33a45139 100644
--- a/bfd/configure.host
+++ b/bfd/configure.host
@@ -72,11 +72,11 @@ mips*-*-sysv4*)		;;
 mips*-*-sysv*)		HDEFINES="-G 4" ;;
 mips*-*-riscos*)	HDEFINES="-G 4" ;;
 
-# Some Solaris systems (osol0906 at least) have a libc that doesn't recognise
-# the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the
-# default code page used by windres/windmc when not specified by a commandline
-# option) to select the "WINDOWS-1252" name instead.  See PR11280 for details.
-*-*-solaris2.11)	HDEFINES=-DCP_ACP=1 ;;
+# Solaris libc doesn't recognise the "MS-ANSI" code page name, so we define
+# an override for CP_ACP (sets the default code page used by windres/windmc
+# when not specified by a commandline option) to select the "WINDOWS-1252"
+# name instead.  See PR11280 for details.
+*-*-solaris2*)		HDEFINES=-DCP_ACP=1 ;;
 
 *-*-windows*)
 			HOST_64BIT_TYPE=__int64