On 25/10/17 13:18 +0100, Jonathan Wakely wrote:
In include/Makefile the stamp-bits-sup target creates a symlink called
stamp-bits:

stamp-bits-sup: stamp-bits ${bits_sup_headers}
        @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
        #                        ^^^^^^^^^^^^
        @$(STAMP) stamp-bits-sup

Should this use "$(LN_S) ${bits_sup_headers} ." instead, so it only
creates symlinks for the headers, not "stamp-bits" as well?

The broken symlink isn't a big deal but causes errors like:

libstdc++-v3$ grep -R foobar include/
grep: include/bits/stamp-bits: Too many levels of symbolic links


I've committed this to fix it. Tested powerpc64le-linux.

Another way to fi it would have been "$(LN_S) $(filter-out $<,$?) ."
but I think what I've committed is easier to grok and less fragile.

commit d2c0483f1cda88d6fb6cb76552765680fde28560
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Mon Oct 30 15:39:06 2017 +0000

    Don't create broken symlink in libstdc++-v3/include/bits
    
            * include/Makefile.am (stamp-bits-sup): Do not create broken symlink
            to stamp-bits.
            * include/Makefile.in: Regenerate.

diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 3e34dc00747..add2277df80 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1031,7 +1031,7 @@ stamp-bits: ${bits_headers}
 	@$(STAMP) stamp-bits
 
 stamp-bits-sup: stamp-bits ${bits_sup_headers}
-	@-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
+	@-cd ${bits_builddir} && $(LN_S) ${bits_sup_headers} . 2>/dev/null
 	@$(STAMP) stamp-bits-sup
 
 stamp-c_base: ${c_base_headers}

Reply via email to