ld STRINGIFY
authorAlan Modra <amodra@gmail.com>
Sat, 26 Aug 2023 01:06:54 +0000 (10:36 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 26 Aug 2023 01:27:00 +0000 (10:57 +0930)
Delete support for old compilers that don't support string
concatentation.

* Makefile.am (stringify.sed): Delete rule.
(GEN_DEPENDS, DISTCLEANFILES): Adjust.
* configure.ac (STRINGIFY): Delete.
* emultempl/beos.em: Use stringify.sed from srcdir.
* emultempl/elf.em: Likewise.
* emultempl/generic.em: Likewise.
* emultempl/msp430.em: Likewise.
* emultempl/pdp11.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/stringify.sed: Renamed from..
* emultempl/astring.sed: ..this.
* emultempl/ostring.sed: Delete.
* Makefile.in: Regenerate.
* configure: Regenerate.

14 files changed:
ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.ac
ld/emultempl/astring.sed [deleted file]
ld/emultempl/beos.em
ld/emultempl/elf.em
ld/emultempl/generic.em
ld/emultempl/msp430.em
ld/emultempl/ostring.sed [deleted file]
ld/emultempl/pdp11.em
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/emultempl/stringify.sed [new file with mode: 0644]

index da885b683709a46d57c7cbe3db08a9bb8f22f87c..49dd3b5056e1eb9f2a31cd6caa1a52ef4382e400 100644 (file)
@@ -623,16 +623,13 @@ ldemul-list.h: Makefile
 ldscripts/stamp:
        $(AM_V_GEN)test -d $(@D) || mkdir $(@D); touch $@
 
-stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
-       $(AM_V_GEN)cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-
 if AMDEP
   GENDEPDIR=$(DEPDIR)
 else
   GENDEPDIR=
 endif
 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
-GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed ldscripts/stamp
+GEN_DEPENDS = $(srcdir)/genscripts.sh ldscripts/stamp
 
 @TDIRS@
 
@@ -826,7 +823,7 @@ doc/ld/index.html: ld.texi $(ld_TEXINFOS)
        $(AM_V_GEN)$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
          --split=node -I$(srcdir) $(srcdir)/ld.texi -o doc/ld
 
-DISTCLEANFILES = site.exp development.exp enablings.exp site.bak stringify.sed
+DISTCLEANFILES = site.exp development.exp enablings.exp site.bak
 distclean-local:
        rm -rf ldscripts
 
index 38c3b5f9f5f6a8141e3621d7ce9f768c284729c2..10278dd6c1b86e17adf7aec17408f2664f3ac48e 100644 (file)
@@ -462,7 +462,6 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
-STRINGIFY = @STRINGIFY@
 STRIP = @STRIP@
 TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
 TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
@@ -1010,7 +1009,7 @@ BLD_POTFILES = $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
 @AMDEP_FALSE@GENDEPDIR = 
 @AMDEP_TRUE@GENDEPDIR = $(DEPDIR)
 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
-GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed ldscripts/stamp
+GEN_DEPENDS = $(srcdir)/genscripts.sh ldscripts/stamp
 
 # We need this for automake to use YLWRAP.
 # Allow dependency tracking to work for these files, too.
@@ -1075,7 +1074,7 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.@OBJEXT@ spu_icache.s
 EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.@OBJEXT@_c \
             emultempl/spu_icache.@OBJEXT@_c deffilep.c deffilep.h $(man_MANS)
 
-DISTCLEANFILES = site.exp development.exp enablings.exp site.bak stringify.sed
+DISTCLEANFILES = site.exp development.exp enablings.exp site.bak
 all: $(BUILT_SOURCES) config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -2353,9 +2352,6 @@ ldemul-list.h: Makefile
 ldscripts/stamp:
        $(AM_V_GEN)test -d $(@D) || mkdir $(@D); touch $@
 
-stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
-       $(AM_V_GEN)cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-
 @TDIRS@
 
 e%.c:
index 960d54f1aeadea5a5b10e72fcd31e763380abf2a..d2cdf256b89e9a751837075b2587248b76cc1928 100755 (executable)
@@ -646,7 +646,6 @@ EMUL
 elf_plt_unwind_list_options
 elf_shlib_list_options
 elf_list_options
-STRINGIFY
 ZSTD_LIBS
 ZSTD_CFLAGS
 zlibinc
@@ -11656,7 +11655,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11659 "configure"
+#line 11658 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11762,7 +11761,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11765 "configure"
+#line 11764 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 fi
 
 
-# When converting linker scripts into strings for use in emulation
-# files, use astring.sed if the compiler supports ANSI string
-# concatenation, or ostring.sed otherwise.  This is to support the
-# broken Microsoft MSVC compiler, which limits the length of string
-# constants, while still supporting pre-ANSI compilers which do not
-# support string concatenation.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ANSI C string concatenation works" >&5
-$as_echo_n "checking whether ANSI C string concatenation works... " >&6; }
-if ${ld_cv_string_concatenation+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-char *a = "a" "a";
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ld_cv_string_concatenation=yes
-else
-  ld_cv_string_concatenation=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_cv_string_concatenation" >&5
-$as_echo "$ld_cv_string_concatenation" >&6; }
-if test "$ld_cv_string_concatenation" = "yes"; then
-  STRINGIFY=astring.sed
-else
-  STRINGIFY=ostring.sed
-fi
-
-
 # target-specific stuff:
 
 all_targets=
index 14628e5dceff53e8fb29ca3872b7cd4e46946bba..c3ebd3ec7e4f8bd7942b041185b488f2daf412bd 100644 (file)
@@ -392,25 +392,6 @@ fi
 AM_ZLIB
 AC_ZSTD
 
-# When converting linker scripts into strings for use in emulation
-# files, use astring.sed if the compiler supports ANSI string
-# concatenation, or ostring.sed otherwise.  This is to support the
-# broken Microsoft MSVC compiler, which limits the length of string
-# constants, while still supporting pre-ANSI compilers which do not
-# support string concatenation.
-AC_MSG_CHECKING([whether ANSI C string concatenation works])
-AC_CACHE_VAL(ld_cv_string_concatenation,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [char *a = "a" "a";])],
-  ld_cv_string_concatenation=yes,
-  ld_cv_string_concatenation=no)])
-AC_MSG_RESULT($ld_cv_string_concatenation)
-if test "$ld_cv_string_concatenation" = "yes"; then
-  STRINGIFY=astring.sed
-else
-  STRINGIFY=ostring.sed
-fi
-AC_SUBST(STRINGIFY)
-
 # target-specific stuff:
 
 all_targets=
diff --git a/ld/emultempl/astring.sed b/ld/emultempl/astring.sed
deleted file mode 100644 (file)
index 08bd8a6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-s/["\\]/\\&/g
-s/$/\\n\\/
-1 s/^/"/
-25s/\\$/"/
-26s/^/"/
-50s/\\$/"/
-51s/^/"/
-75s/\\$/"/
-76s/^/"/
-100s/\\$/"/
-101s/^/"/
-$ s/$/n"/
-$ s/\\n"n"$/\\n"/
index 521d92797ecb0edcdf4e8bb63d01c2001a5067c7..e597f34ae57c9d088fc2ad939dba038a23120339 100644 (file)
@@ -718,7 +718,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
index 3f67f8b09d94a61f5d18e8630ccd4059225f446b..1c5030d5e1ccb64dc1fa0942f35f54e1b234be80 100644 (file)
@@ -199,7 +199,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
index c280ed3a46a245dd7e951111c23265f4095d22de..b37a1e7e95c8dde66af5097cf4b0444ad49e2792 100644 (file)
@@ -86,7 +86,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
index 33fff78495e6d83dbd2510b353f31f28e9c6813e..65be0452ee95fcd9363491edc236e6607c8b0748 100644 (file)
@@ -104,7 +104,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
diff --git a/ld/emultempl/ostring.sed b/ld/emultempl/ostring.sed
deleted file mode 100644 (file)
index a526d3f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-s/["\\]/\\&/g
-s/$/\\n\\/
-1 s/^/"/
-$ s/$/n"/
index c6dbdeedd6a267a25fab8ec19e35d64652245917..f5d2f4f5256fe9028380c21ac6c6f0dad81fdca6 100644 (file)
@@ -101,7 +101,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
index 36f60d53ea3ccd7070b44fc59bddb22a1d1f77ac..24dc19afff334bb0fdea1f0f2c31087d6efd50ae 100644 (file)
@@ -2511,7 +2511,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
index 1df959a6a50a5f16f6c0fc59705ddedcac4fdd6c..289c72e30368134ff11166525d7c9c6af9cd9841 100644 (file)
@@ -2342,7 +2342,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+sc="-f ${srcdir}/emultempl/stringify.sed"
 
 fragment <<EOF
 {
diff --git a/ld/emultempl/stringify.sed b/ld/emultempl/stringify.sed
new file mode 100644 (file)
index 0000000..08bd8a6
--- /dev/null
@@ -0,0 +1,13 @@
+s/["\\]/\\&/g
+s/$/\\n\\/
+1 s/^/"/
+25s/\\$/"/
+26s/^/"/
+50s/\\$/"/
+51s/^/"/
+75s/\\$/"/
+76s/^/"/
+100s/\\$/"/
+101s/^/"/
+$ s/$/n"/
+$ s/\\n"n"$/\\n"/