It turns out that the symlink may exists already by the time the
toolchain Makefile gets an opportunity to run.  While we asked to
replace the target, ln doesn't do so until after dereferencing the
existing symlink.  This results in an unintended symlink that refers to
itself.  Instead, create the link without dereferencing any
symlinks by using the -n option.

Signed-off-by: John Szakmeister <[email protected]>
---

Here's the patch with my Signed-off-by.  Thank you for the feedback Florian!

-John

 toolchain/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/Makefile b/toolchain/Makefile
index bdfb29e..763381a 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -63,7 +63,7 @@ ifneq ($(ARCH),)
                $(if $(QUIET),,set -x;) \
                mkdir -p "$$dir"; \
                cd "$$dir"; \
-               ln -sf lib lib64; \
+               ln -nsf lib lib64; \
                mkdir -p stamp lib usr/include usr/lib ; \
        ); done
        @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) 
$(TOPDIR)/toolchain/info.mk $@
-- 
1.8.2

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to