summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Kimura <yasu@utahime.org>2022-10-13 15:22:02 +0900
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-05 19:03:01 +0000
commit90b66dc73deb9ef303690370395cf831425547c7 (patch)
treeff42c359213aec994bf28a9cd7615dbb09a2ff27
parent159a6b5118a6d8a7ed1660620657337e09c58eaa (diff)
Fix incompatibility issue of GNU binutils 2.36 and later on FreeBSD.
Commit a6d4d6223ef75119d5373fa4cc04161bcdb4e769 fixes incompatibility issue of GNU binutils 2.36 and later. If I check the diff of the commit, there seems to be asumption that the issue is specific to Linux. But it also happens on FreeBSD if user installs GNU binutils from FreeBSD ports/packages collections and '/usr/local/bin' comes before '/usr/bin' in the value of PATH enviroment variable. So fix the issue also on FreeBSD with following way. 1. Introduce new macro 'HasGnuAr'. 2. Change Imake.tmpl so it defines 'ArCmd' as 'ArCmdBase cq' if 'HasGnuAr' is defined. 3. Define 'HasGnuAr' in both FreeBSD.cf and linux.cf. Since 'ar' command of FreeBSD base system simply ignores 'l' option, it also works fine even if GNU binutils isn't installed.
-rw-r--r--FreeBSD.cf3
-rw-r--r--Imake.tmpl2
-rw-r--r--linux.cf4
3 files changed, 8 insertions, 1 deletions
diff --git a/FreeBSD.cf b/FreeBSD.cf
index 8f9cac3..4a49bda 100644
--- a/FreeBSD.cf
+++ b/FreeBSD.cf
@@ -153,6 +153,9 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe
#ifndef HasFlex
#define HasFlex YES
#endif
+#ifndef HasGnuAr
+#define HasGnuAr YES
+#endif
#ifndef HasMktemp
#if (OSMajorVersion >= 4) || (OSMajorVersion == 3 && OSMinorVersion >= 1) || \
diff --git a/Imake.tmpl b/Imake.tmpl
index 8c26d56..0f8832f 100644
--- a/Imake.tmpl
+++ b/Imake.tmpl
@@ -1078,7 +1078,7 @@ TCLIBDIR = TclLibDir
#define ArCmdBase ar
#endif
#ifndef ArCmd
-#if HasLargeTmp || SystemV4 || LinuxBinUtilsMajorVersion
+#if HasLargeTmp || SystemV4 || HasGnuAr
#define ArCmd ArCmdBase cq
#else
#define ArCmd ArCmdBase clq
diff --git a/linux.cf b/linux.cf
index cf39960..c035565 100644
--- a/linux.cf
+++ b/linux.cf
@@ -90,6 +90,10 @@ XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.220 2003/12/30 22:38:33 tsi
# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion
#endif
+#ifndef HasGnuAr
+#define HasGnuAr YES
+#endif
+
XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
XCOMM libc: (LinuxCLibMajorVersion./**/LinuxCLibMinorVersion./**/LinuxCLibTeenyVersion)
XCOMM binutils: (LinuxBinUtilsMajorVersion)