libstdc++-v3 in gcc-15 gained uses of a make function that was added
in GNU make 3.81, but ppc-vx6 is GNU make 3.80, so calling the
function returns an empty string, and the build fails.

gcc/doc/install.texi states GCC requires make 3.80 to build, so
rewrite those bits to avoid the new function.

Install locations don't need abspath because they're already supposed
to be absolute, since installation can't work with relative paths and
DESTDIR is supposed to be prependable.

$? may gain the srcdir VPATH, which would complicate dropping abspath,
so iterate over the two filenames.

Regstrapped on x86_64-linux-gnu.  Also tested with ppc-vx6's make for
i686-linux-gnu with gcc-15.  Ok to install?


for  libstdc++-v3/ChangeLog

        * src/c++23/Makefile.am (libstdc++.modules.json): Rewrite
        without abspath make function.
        (stamp-modules-bits): Likewise.
        * src/c++23/Makefile.in: Rebuilt.
---
 libstdc++-v3/src/c++23/Makefile.am |    8 +++++---
 libstdc++-v3/src/c++23/Makefile.in |    8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/libstdc++-v3/src/c++23/Makefile.am 
b/libstdc++-v3/src/c++23/Makefile.am
index 5b2812abd2288..a1acf3eb5b4aa 100644
--- a/libstdc++-v3/src/c++23/Makefile.am
+++ b/libstdc++-v3/src/c++23/Makefile.am
@@ -37,8 +37,8 @@ includebits_DATA = std.cc std.compat.cc
 # The manifest to be installed uses the relative path between install dirs.
 libstdc++.modules.json: libstdc++.modules.json.in
        relpath=$$($(toplevel_srcdir)/contrib/relpath.sh \
-                  $(abspath $(toolexeclibdir)) \
-                  $(abspath $(includebitsdir))) && \
+                   $(toolexeclibdir) \
+                   $(includebitsdir)) && \
        sed "s,@MODPATH@,$$relpath," $< > $@
 
 # The uninstalled manifest uses the relative path to builddir.
@@ -57,7 +57,9 @@ std.compat.cc: std.compat.cc.in std-clib.cc.in
 # Also put the interface units in the build-includes bits directory.
 stamp-modules-bits: $(includebits_DATA)
        @-mkdir -p $(top_builddir)/include/bits
-       -cd $(top_builddir)/include/bits && $(LN_S) $(abspath $?) . 2>/dev/null
+       -for f in $(includebits_DATA); do \
+         $(LN_S) $(abs_srcdir)/$$f $(top_builddir)/include/bits; \
+       done 2>/dev/null
        @$(STAMP) $@
 
 all-local: stamp-module-manifest stamp-modules-bits
diff --git a/libstdc++-v3/src/c++23/Makefile.in 
b/libstdc++-v3/src/c++23/Makefile.in
index 75da9c008ab60..c1407d250b1d9 100644
--- a/libstdc++-v3/src/c++23/Makefile.in
+++ b/libstdc++-v3/src/c++23/Makefile.in
@@ -845,8 +845,8 @@ uninstall-am: uninstall-includebitsDATA 
uninstall-toolexeclibDATA
 # The manifest to be installed uses the relative path between install dirs.
 libstdc++.modules.json: libstdc++.modules.json.in
        relpath=$$($(toplevel_srcdir)/contrib/relpath.sh \
-                  $(abspath $(toolexeclibdir)) \
-                  $(abspath $(includebitsdir))) && \
+                   $(toolexeclibdir) \
+                   $(includebitsdir)) && \
        sed "s,@MODPATH@,$$relpath," $< > $@
 
 # The uninstalled manifest uses the relative path to builddir.
@@ -865,7 +865,9 @@ std.compat.cc: std.compat.cc.in std-clib.cc.in
 # Also put the interface units in the build-includes bits directory.
 stamp-modules-bits: $(includebits_DATA)
        @-mkdir -p $(top_builddir)/include/bits
-       -cd $(top_builddir)/include/bits && $(LN_S) $(abspath $?) . 2>/dev/null
+       -for f in $(includebits_DATA); do \
+         $(LN_S) $(abs_srcdir)/$$f $(top_builddir)/include/bits; \
+       done 2>/dev/null
        @$(STAMP) $@
 
 all-local: stamp-module-manifest stamp-modules-bits

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to