Skip to contentSkip to conversation

gcc-final: hard link TARGET-cc -> TARGET-gcc

PATCH New Steven Noonan 3 participants 4 messages Nov 4, 2015 – Nov 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc-final: hard link TARGET-cc -> TARGET-gcc

Doing a symlink results in incorrect behavior:

    $ x86_64-buildroot-linux-gnux32-cc
    --version
    ccache: error: execv of [...]/x86_64-buildroot-linux-gnux32-cc.br_real.br_real failed: No such file or directory
    $ x86_64-buildroot-linux-gnux32-gcc --version
    x86_64-buildroot-linux-gnux32-gcc.br_real (Buildroot 2015.11-git-00965-g8d89653-dirty) 5.2.0
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note the double .br_real on the invocation by toolchain-wrapper.

---
 package/gcc/gcc-final/gcc-final.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/gcc-final/gcc-final.mk +1 -1
index 8ac2968..7ccc533 100644
@@ -91,7 +91,7 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
 # Make sure we have 'cc'
 define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
 	if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
-		ln -snf $(GNU_TARGET_NAME)-gcc \
+		cp -l $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \
 			$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
 	fi
 endef
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 gcc-final: hard link TARGET-cc -> TARGET-gcc

Quoted 12 lines · Steven Noonan

Doing a symlink results in incorrect behavior:

    $ x86_64-buildroot-linux-gnux32-cc
    --version
    ccache: error: execv of [...]/x86_64-buildroot-linux-gnux32-cc.br_real.br_real failed: No such file or directory
    $ x86_64-buildroot-linux-gnux32-gcc --version
    x86_64-buildroot-linux-gnux32-gcc.br_real (Buildroot 2015.11-git-00965-g8d89653-dirty) 5.2.0
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Quoted 3 lines

Note the double .br_real on the invocation by toolchain-wrapper.

However...

Quoted 9 lines
---
 package/gcc/gcc-final/gcc-final.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/gcc-final/gcc-final.mk +0 -0
index 8ac2968..7ccc533 100644

package/gcc/gcc-final/gcc-final.mk HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) · line 94

Quoted 5 lines
package/gcc/gcc-final/gcc-final.mk +1 -1
@@ -91,7 +91,7 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
 # Make sure we have 'cc'
 define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
 	if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
-		ln -snf $(GNU_TARGET_NAME)-gcc \
+		cp -l $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \

Why not ln -f instead of cp -l?

Regards,
Arnout

Quoted 4 lines
package/gcc/gcc-final/gcc-final.mk +0 -0
 			$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
 	fi
 endef
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 gcc-final: hard link TARGET-cc -> TARGET-gcc

Quoted 25 lines · Arnout Vandecappelle
Quoted 12 lines · Steven Noonan

Doing a symlink results in incorrect behavior:

    $ x86_64-buildroot-linux-gnux32-cc
    --version
    ccache: error: execv of [...]/x86_64-buildroot-linux-gnux32-cc.br_real.br_real failed: No such file or directory
    $ x86_64-buildroot-linux-gnux32-gcc --version
    x86_64-buildroot-linux-gnux32-gcc.br_real (Buildroot 2015.11-git-00965-g8d89653-dirty) 5.2.0
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Quoted 3 lines

Note the double .br_real on the invocation by toolchain-wrapper.

However...

Quoted 4 lines
---
 package/gcc/gcc-final/gcc-final.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

package/gcc/gcc-final/gcc-final.mk HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) · line 94

Quoted 10 lines
package/gcc/gcc-final/gcc-final.mk +1 -1
index 8ac2968..7ccc533 100644
@@ -91,7 +91,7 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
 # Make sure we have 'cc'
 define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
      if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
-             ln -snf $(GNU_TARGET_NAME)-gcc \
+             cp -l $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \

Why not ln -f instead of cp -l?

Could do that too. It just didn't occur to me because I've always used the 'cp' command for the job.

Quoted 16 lines

Regards,
Arnout

package/gcc/gcc-final/gcc-final.mk HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) · line 97

Quoted 4 lines
package/gcc/gcc-final/gcc-final.mk +0 -0
                      $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
      fi
 endef

--

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 gcc-final: hard link TARGET-cc -> TARGET-gcc

In reply to Steven Noonan

Dear Steven Noonan,

Quoted 12 lines · Steven Noonan

Doing a symlink results in incorrect behavior:

    $ x86_64-buildroot-linux-gnux32-cc
    --version
    ccache: error: execv of [...]/x86_64-buildroot-linux-gnux32-cc.br_real.br_real failed: No such file or directory
    $ x86_64-buildroot-linux-gnux32-gcc --version
    x86_64-buildroot-linux-gnux32-gcc.br_real (Buildroot 2015.11-git-00965-g8d89653-dirty) 5.2.0
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Quoted 6 lines

Note the double .br_real on the invocation by toolchain-wrapper.

---
 package/gcc/gcc-final/gcc-final.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied after changing to use 'ln -f' instead of 'cp -l', as suggested by Arnout. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com