diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 2921623dc..8ca9c9e4b 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -136,11 +136,15 @@ if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_12}" ]; then patch -p1 -i "${ROOT}/patch-cpython-configure-target-triple-musl-3.12.patch" fi -# Python 3.11 supports using a provided Python to use during bootstrapping -# (e.g. freezing). Normally it only uses this Python during cross-compiling. -# This patch forces always using it. See comment related to -# `--with-build-python` for more. -patch -p1 -i "${ROOT}/patch-always-build-python-for-freeze.patch" +# Link the native build helpers with only the modules from `Modules/Setup.bootstrap` +# so other built-in modules can depend on the helpers' output. +# https://github.com/python/cpython/pull/160537 +patch -p1 -i "${ROOT}/patch-bootstrap-helpers.patch" +if [ "${PYTHON_MAJMIN_VERSION}" = "3.11" ]; then + patch -p1 -i "${ROOT}/patch-bootstrap-helpers-configure-3.11.patch" +else + patch -p1 -i "${ROOT}/patch-bootstrap-helpers-configure.patch" +fi # Add a make target to write the PYTHON_FOR_BUILD variable so we can # invoke the host Python on our own. @@ -567,9 +571,7 @@ if [ -n "${CPYTHON_LTO}" ]; then CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto=full" fi -# Python 3.11 introduces a --with-build-python to denote the host Python. -# It is required when cross-compiling. But we always build a host Python -# to avoid complexity with the bootstrap Python binary. +# Supply the matching host interpreter to CPython's build configuration. CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-build-python=${TOOLS_PATH}/host/bin/python${PYTHON_MAJMIN_VERSION}" if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then @@ -1385,6 +1387,11 @@ for d in ${OBJECT_DIRS}; do fi done +# Exclude helper-specific objects that conflict with interpreter objects +# when downstream consumers relink them. +rm -f "${ROOT}/out/python/build/Modules"/{config_bootstrap,getbuildinfo_bootstrap,getpath_noop}.o +rm -f "${ROOT}/out/python/build/Programs"/{_bootstrap_python,_freeze_module}.o + # The object files need to be linked against library dependencies. So copy # library files as well. mkdir "${ROOT}/out/python/build/lib" diff --git a/cpython-unix/patch-always-build-python-for-freeze.patch b/cpython-unix/patch-always-build-python-for-freeze.patch deleted file mode 100644 index 55d3cf39b..000000000 --- a/cpython-unix/patch-always-build-python-for-freeze.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index c62a565eb6..5a5a076f06 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -178,24 +178,13 @@ AC_MSG_CHECKING([for Python interpreter freezing]) - AC_MSG_RESULT([$PYTHON_FOR_FREEZE]) - AC_SUBST([PYTHON_FOR_FREEZE]) - --AS_VAR_IF([cross_compiling], [yes], -- [ -- dnl external build Python, freezing depends on Programs/_freeze_module.py -- FREEZE_MODULE_BOOTSTRAP='$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py' -- FREEZE_MODULE_BOOTSTRAP_DEPS='$(srcdir)/Programs/_freeze_module.py' -- FREEZE_MODULE='$(FREEZE_MODULE_BOOTSTRAP)' -- FREEZE_MODULE_DEPS='$(FREEZE_MODULE_BOOTSTRAP_DEPS)' -- PYTHON_FOR_BUILD_DEPS='' -- ], -- [ -- dnl internal build tools also depend on Programs/_freeze_module and _bootstrap_python. -- FREEZE_MODULE_BOOTSTRAP='./Programs/_freeze_module' -- FREEZE_MODULE_BOOTSTRAP_DEPS="Programs/_freeze_module" -- FREEZE_MODULE='$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py' -- FREEZE_MODULE_DEPS="_bootstrap_python \$(srcdir)/Programs/_freeze_module.py" -- PYTHON_FOR_BUILD_DEPS='$(BUILDPYTHON)' -- ] --) -+dnl external build Python, freezing depends on Programs/_freeze_module.py -+FREEZE_MODULE_BOOTSTRAP='$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py' -+FREEZE_MODULE_BOOTSTRAP_DEPS='$(srcdir)/Programs/_freeze_module.py' -+FREEZE_MODULE='$(FREEZE_MODULE_BOOTSTRAP)' -+FREEZE_MODULE_DEPS='$(FREEZE_MODULE_BOOTSTRAP_DEPS)' -+PYTHON_FOR_BUILD_DEPS='' -+ - AC_SUBST([FREEZE_MODULE_BOOTSTRAP]) - AC_SUBST([FREEZE_MODULE_BOOTSTRAP_DEPS]) - AC_SUBST([FREEZE_MODULE]) diff --git a/cpython-unix/patch-bootstrap-helpers-configure-3.11.patch b/cpython-unix/patch-bootstrap-helpers-configure-3.11.patch new file mode 100644 index 000000000..99662c6db --- /dev/null +++ b/cpython-unix/patch-bootstrap-helpers-configure-3.11.patch @@ -0,0 +1,29 @@ +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -7148,8 +7148,8 @@ + AC_MSG_NOTICE([creating Makefile]) + $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ + -s Modules \ +- Modules/Setup.local $MODULES_SETUP_STDLIB Modules/Setup.bootstrap $srcdir/Modules/Setup +-mv config.c Modules ++ Modules/Setup.local $MODULES_SETUP_STDLIB -b Modules/Setup.bootstrap $srcdir/Modules/Setup ++mv config.c config_bootstrap.c Modules + + if test -z "$PKG_CONFIG"; then + AC_MSG_WARN([pkg-config is missing. Some dependencies may not be detected correctly.]) +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -951,9 +951,9 @@ + -s Modules \ + Modules/Setup.local \ + @MODULES_SETUP_STDLIB@ \ +- Modules/Setup.bootstrap \ ++ -b Modules/Setup.bootstrap \ + $(srcdir)/Modules/Setup +- @mv config.c Modules ++ @mv config.c config_bootstrap.c Modules + @echo "The Makefile was updated, you may need to re-run make." + + .PHONY: regen-test-frozenmain diff --git a/cpython-unix/patch-bootstrap-helpers-configure.patch b/cpython-unix/patch-bootstrap-helpers-configure.patch new file mode 100644 index 000000000..fd2e8d8e4 --- /dev/null +++ b/cpython-unix/patch-bootstrap-helpers-configure.patch @@ -0,0 +1,33 @@ +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -7604,12 +7604,12 @@ + AC_MSG_NOTICE([creating Makefile]) + $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ + -s Modules \ +- Modules/Setup.local Modules/Setup.stdlib Modules/Setup.bootstrap $srcdir/Modules/Setup ++ Modules/Setup.local Modules/Setup.stdlib -b Modules/Setup.bootstrap $srcdir/Modules/Setup + if test $? -ne 0; then + AC_MSG_ERROR([makesetup failed]) + fi + +-mv config.c Modules ++mv config.c config_bootstrap.c Modules + + if test -z "$PKG_CONFIG"; then + AC_MSG_WARN([pkg-config is missing. Some dependencies may not be detected correctly.]) +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1039,9 +1039,9 @@ + -s Modules \ + Modules/Setup.local \ + Modules/Setup.stdlib \ +- Modules/Setup.bootstrap \ ++ -b Modules/Setup.bootstrap \ + $(srcdir)/Modules/Setup +- @mv config.c Modules ++ @mv config.c config_bootstrap.c Modules + @echo "The Makefile was updated, you may need to re-run make." + + .PHONY: regen-test-frozenmain diff --git a/cpython-unix/patch-bootstrap-helpers.patch b/cpython-unix/patch-bootstrap-helpers.patch new file mode 100644 index 000000000..a6f651a9f --- /dev/null +++ b/cpython-unix/patch-bootstrap-helpers.patch @@ -0,0 +1,332 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -25,6 +25,13 @@ + MODDISABLED_NAMES= _MODDISABLED_NAMES_ + MODOBJS= _MODOBJS_ + MODLIBS= _MODLIBS_ ++# Objects and libraries of the bootstrap modules (Modules/Setup.bootstrap) ++# only. These are the only static modules linked into the build helper ++# programs (Programs/_freeze_module, _bootstrap_python), so that other ++# builtin modules (Modules/Setup.local, MODULE_BUILDTYPE=static) may depend ++# on products of those helpers (frozen modules, getpath). ++BOOTSTRAP_MODOBJS= _BOOTSTRAP_MODOBJS_ ++BOOTSTRAP_MODLIBS= _BOOTSTRAP_MODLIBS_ + + # === Variables set by configure + VERSION= @VERSION@ +@@ -320,10 +327,13 @@ + + ########################################################################## + # Modules ++MODULE_OBJS_COMMON= \ ++ Modules/main.o \ ++ Modules/gcmodule.o ++ + MODULE_OBJS= \ + Modules/config.o \ +- Modules/main.o \ +- Modules/gcmodule.o ++ $(MODULE_OBJS_COMMON) + + IO_H= Modules/_io/_iomodule.h + +@@ -506,4 +516,17 @@ + Modules/getpath.o \ + Python/frozen.o ++ ++# objects that get linked into the build helper programs ++# (Programs/_freeze_module, _bootstrap_python): the core, plus the bootstrap ++# modules only (see BOOTSTRAP_MODOBJS). Does not include frozen modules nor ++# getpath, which the helpers are used to build. ++BOOTSTRAP_LIBRARY_OBJS= \ ++ Modules/getbuildinfo_bootstrap.o \ ++ $(PARSER_OBJS) \ ++ $(OBJECT_OBJS) \ ++ $(PYTHON_OBJS) \ ++ Modules/config_bootstrap.o \ ++ $(MODULE_OBJS_COMMON) \ ++ $(BOOTSTRAP_MODOBJS) + + LINK_PYTHON_OBJS=@LINK_PYTHON_OBJS@ +@@ -1028,7 +1051,7 @@ + Modules/Setup.stdlib: $(srcdir)/Modules/Setup.stdlib.in config.status + ./config.status $@ + +-Makefile Modules/config.c: Makefile.pre \ ++Makefile Modules/config.c Modules/config_bootstrap.c: Makefile.pre \ + $(srcdir)/Modules/config.c.in \ + $(MAKESETUP) \ + $(srcdir)/Modules/Setup \ +@@ -1075,9 +1098,9 @@ + + Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS) + +-_bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local +- $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(LIBRARY_OBJS_OMIT_FROZEN) \ +- Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(MODLIBS) $(SYSLIBS) ++_bootstrap_python: $(BOOTSTRAP_LIBRARY_OBJS) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local ++ $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(BOOTSTRAP_LIBRARY_OBJS) \ ++ Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(BOOTSTRAP_MODLIBS) $(SYSLIBS) + # Dummy pybuilddir.txt is needed for _bootstrap_python to be runnable + @echo "none" > ./pybuilddir.txt + +@@ -1095,6 +1118,9 @@ + # + # Standard build process: + # 1) compile minimal core objects for Py_Compile*() and PyMarshal_Write*(). ++# Only the bootstrap modules (Modules/Setup.bootstrap) are part of these ++# objects (see BOOTSTRAP_LIBRARY_OBJS), so other builtin modules may ++# depend on the output of the following steps. + # 2) build Programs/_freeze_module binary. + # 3) create frozen module headers for importlib and getpath. + # 4) build _bootstrap_python binary. +@@ -1165,8 +1191,8 @@ + + Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile + +-Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) +- $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) ++Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(BOOTSTRAP_LIBRARY_OBJS) ++ $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(BOOTSTRAP_LIBRARY_OBJS) $(LIBS) $(BOOTSTRAP_MODLIBS) $(SYSLIBS) + + # We manually freeze getpath.py rather than through freeze_modules + Python/frozen_modules/getpath.h: Modules/getpath.py $(FREEZE_MODULE_BOOTSTRAP_DEPS) +@@ -1342,11 +1368,24 @@ + $(MODOBJS) \ + $(DTRACE_OBJS) \ + $(srcdir)/Modules/getbuildinfo.c +- $(CC) -c $(PY_CORE_CFLAGS) \ ++ $(CC) -c $(PY_CORE_CFLAGS) $(GETBUILDINFO_CFLAGS) \ ++ -o $@ $(srcdir)/Modules/getbuildinfo.c ++ ++# Separate object for the build helper programs: it must not depend on ++# $(MODOBJS), which may in turn depend on the helpers' output. ++Modules/getbuildinfo_bootstrap.o: $(PARSER_OBJS) \ ++ $(OBJECT_OBJS) \ ++ $(PYTHON_OBJS) \ ++ $(MODULE_OBJS_COMMON) \ ++ $(BOOTSTRAP_MODOBJS) \ ++ $(srcdir)/Modules/getbuildinfo.c ++ $(CC) -c $(PY_CORE_CFLAGS) $(GETBUILDINFO_CFLAGS) \ ++ -o $@ $(srcdir)/Modules/getbuildinfo.c ++ ++GETBUILDINFO_CFLAGS= \ + -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ + -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ +- -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ +- -o $@ $(srcdir)/Modules/getbuildinfo.c ++ -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" + + Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS) + $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ +@@ -1816,3 +1855,3 @@ + +-$(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS) ++$(LIBRARY_OBJS) $(MODOBJS) Modules/config_bootstrap.o Programs/python.o: $(PYTHON_HEADERS) + +@@ -2715,5 +2754,5 @@ + -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ + tags TAGS \ +- config.cache config.log pyconfig.h Modules/config.c ++ config.cache config.log pyconfig.h Modules/config.c Modules/config_bootstrap.c + -rm -rf build platform + -rm -rf $(PYTHONFRAMEWORKDIR) +diff --git a/Modules/makesetup b/Modules/makesetup +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -4,17 +4,22 @@ + # Convert templates into Makefile and config.c, based on the module + # definitions found in the file Setup. + # +-# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...] ++# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-b Setup] ... ++# [-n [Setup] ...] + # + # Options: + # -s directory: alternative source directory (default .) + # -l directory: library source directory (default derived from $0) + # -c file: alternative config.c template (default $libdir/config.c.in) +-# -c -: don't write config.c ++# -c -: don't write config.c (nor config_bootstrap.c) + # -m file: alternative Makefile template (default ./Makefile.pre) + # -m -: don't write Makefile + # + # Remaining arguments are one or more Setup files (default ./Setup). ++# The Setup file following a -b option holds the *bootstrap* modules: ++# the static modules that the build helper programs (_freeze_module, ++# _bootstrap_python) are linked with. They are also regular modules of ++# the final build. + # Setup files after a -n option are used for their variables, modules + # and libraries but not for their .o files. + # +@@ -28,6 +33,9 @@ + # + insert 'extern PyObject* PyInit_(void);' before MARKER 1 + # + insert '{"", PyInit_},' before MARKER 2 + # ++# Copying config.c.in to config_bootstrap.c (only with a -b Setup file): ++# - same as config.c, but only for the modules of the -b Setup file ++# + # Copying Makefile.pre to Makefile: + # - insert an identifying comment at the start + # - replace _MODBUILT_NAMES_ by the list of *static* and *shared* modules +@@ -37,6 +45,8 @@ + # - replace _MODOBJS_ by the list of objects from Setup (except for + # Setup files after a -n option) + # - replace _MODLIBS_ by the list of libraries from Setup ++# - replace _BOOTSTRAP_MODOBJS_ and _BOOTSTRAP_MODLIBS_ by the objects and ++# libraries of the -b Setup file + # - for each object file mentioned in Setup, append a rule + # '.o: .c; ' to the end of the Makefile + # - for each module mentioned in Setup, append a rule +@@ -47,13 +57,14 @@ + # Loop over command line options + usage=' + usage: makesetup [-s srcdir] [-l libdir] [-c config.c.in] [-m Makefile.pre] +- [Setup] ... [-n [Setup] ...]' ++ [Setup] ... [-b Setup] ... [-n [Setup] ...]' + srcdir='.' + libdir='' + config='' + makepre='' + noobjects='' + doconfig=yes ++bootstrap= + while : + do + case $1 in +@@ -105,5 +116,6 @@ + case $i in + -n) echo '*noobjects*';; +- *) echo '*doconfig*'; cat "$i";; ++ -b) echo '*bootstrap*';; ++ *) echo '*doconfig*'; cat "$i"; echo ''; echo '*nobootstrap*';; + esac + done | +@@ -125,6 +137,10 @@ + LIBS= + LOCALLIBS= + BASELIBS= ++ BOOTMODS= ++ BOOTOBJS= ++ BOOTLIBS= ++ havebootstrap= + while read line + do + # to handle backslashes for sh's that don't automatically +@@ -147,6 +163,8 @@ + noobjects=yes; + continue;; + '*doconfig*') doconfig=yes; continue;; ++ '*bootstrap*') bootstrap=yes; havebootstrap=yes; continue;; ++ '*nobootstrap*') bootstrap=; continue;; + '*static*') doconfig=yes; continue;; + '*noconfig*') doconfig=no; continue;; + '*shared*') doconfig=no; continue;; +@@ -215,6 +233,16 @@ + # Detected multiple rules for a module, first rule wins. This + # allows users to disable modules in Setup.local. + echo 1>&2 "maksetup: '$mod' was handled by previous rule." ++ case $bootstrap in ++ yes) ++ # A bootstrap module overridden by an earlier rule ++ # (e.g. in Setup.local): the build helpers get the ++ # overriding static module, if any. ++ eval "BOOTMODS=\"\$BOOTMODS \${STATICMOD_$mod}\"" ++ eval "BOOTOBJS=\"\$BOOTOBJS \${STATICOBJS_$mod}\"" ++ eval "BOOTLIBS=\"\$BOOTLIBS \${STATICLIBS_$mod}\"" ++ ;; ++ esac + continue 2;; + esac + CONFIGURED="$CONFIGURED,${mod}," +@@ -224,6 +252,12 @@ + LIBS="$LIBS $libs" + MODS="$MODS $mods" + BUILT="$BUILT $mods" ++ case $bootstrap in ++ yes) ++ BOOTLIBS="$BOOTLIBS $libs" ++ BOOTMODS="$BOOTMODS $mods" ++ ;; ++ esac + ;; + no) + BUILT="$BUILT $mods" +@@ -274,7 +308,20 @@ + echo "$rule" >>$rulesf + done + case $doconfig in +- yes) OBJS="$OBJS $objs";; ++ yes) ++ OBJS="$OBJS $objs" ++ case $bootstrap in ++ yes) BOOTOBJS="$BOOTOBJS $objs";; ++ esac ++ # Remember static modules so that a later bootstrap rule ++ # for the same module can pick them up (see above). ++ for mod in $mods ++ do ++ eval "STATICMOD_$mod='$mod'" ++ eval "STATICOBJS_$mod='$objs'" ++ eval "STATICLIBS_$mod='$libs'" ++ done ++ ;; + esac + for mod in $mods + do +@@ -304,24 +351,31 @@ + DEFS="BASEMODLIBS=$BASELIBS$NL$DEFS" + DEFS="LOCALMODLIBS=$LOCALLIBS$NL$DEFS" + +- EXTDECLS= +- INITBITS= +- for mod in $MODS +- do +- EXTDECLS="${EXTDECLS}extern PyObject* PyInit_$mod(void);$NL" +- INITBITS="${INITBITS} {\"$mod\", PyInit_$mod},$NL" +- done +- +- +- case $config in +- -) ;; +- *) sed -e " ++ # Generate a config.c from the template for the given modules ++ genconfig() { ++ out=$1; shift ++ EXTDECLS= ++ INITBITS= ++ for mod ++ do ++ EXTDECLS="${EXTDECLS}extern PyObject* PyInit_$mod(void);$NL" ++ INITBITS="${INITBITS} {\"$mod\", PyInit_$mod},$NL" ++ done ++ sed -e " + 1i$NL/* Generated automatically from $config by makesetup. */ + /MARKER 1/i$NL$EXTDECLS + + /MARKER 2/i$NL$INITBITS + +- " $config >config.c ++ " $config >$out ++ } ++ ++ case $config in ++ -) ;; ++ *) genconfig config.c $MODS ++ case $havebootstrap in ++ yes) genconfig config_bootstrap.c $BOOTMODS;; ++ esac + ;; + esac + +@@ -340,6 +394,9 @@ + echo "s%_MODBUILT_NAMES_%$BUILT%" >>$sedf + echo "s%_MODSHARED_NAMES_%$BUILT_SHARED%" >>$sedf + echo "s%_MODDISABLED_NAMES_%$DISABLED%" >>$sedf ++ # _BOOTSTRAP_* first: _MODOBJS_ is a substring of _BOOTSTRAP_MODOBJS_ ++ echo "s%_BOOTSTRAP_MODOBJS_%$BOOTOBJS%" >>$sedf ++ echo "s%_BOOTSTRAP_MODLIBS_%$BOOTLIBS%" >>$sedf + echo "s%_MODOBJS_%$OBJS%" >>$sedf + echo "s%_MODLIBS_%$LIBS%" >>$sedf + echo "/Definitions added by makesetup/r $sedr" >>$sedf