From ae7217806b3e7cae444a7f4be86a856f68fc3e46 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 7 Mar 2022 14:05:57 +0000 Subject: [PATCH] common.mak: remove `LINK` and `LINKXX` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we've concluded that the compiler is used for calling the actual linker, it doesn't make much sense to select a different compiler for linking. Even worse, it's prone to error. A naive user might try to compile s390-tools using clang as follows: $ make -C genprotimg CC=clang ... CC genprotimg/src/utils/curl.o LINK genprotimg/src/genprotimg /usr/bin/ld: genprotimg.o: `stderr@@GLIBC_2.2' non-PLT reloc for symbol defined in shared library and accessed from executable (rebuild file with -fPIC ?) /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status Therefore it makes sense to use the same compiler for linking as well. Signed-off-by: Marc Hartmayer Acked-by: Jan Höppner Signed-off-by: Jan Höppner --- common.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.mak b/common.mak index d83134ca..e2be6449 100644 --- a/common.mak +++ b/common.mak @@ -59,10 +59,8 @@ define cmd_define endef $(eval $(call cmd_define, AS," AS ",$(CROSS_COMPILE)as)) -$(eval $(call cmd_define, LINK," LINK ",$(CROSS_COMPILE)gcc)) $(eval $(call cmd_define, CC," CC ",$(CROSS_COMPILE)gcc)) $(eval $(call cmd_define, HOSTCC," HOSTCC ",gcc)) -$(eval $(call cmd_define, LINKXX," LINKXX ",$(CROSS_COMPILE)g++)) $(eval $(call cmd_define, CXX," CXX ",$(CROSS_COMPILE)g++)) $(eval $(call cmd_define, CPP," CPP ",$(CROSS_COMPILE)gcc -E)) $(eval $(call cmd_define, AR," AR ",$(CROSS_COMPILE)ar)) @@ -83,6 +81,8 @@ CHECKTOOL = $(call echocmd," CHECK ",/$@)$(CHECK_SILENT) SKIP = echo " SKIP $(call reldir) due to" INSTALL = install +LINK = $(CC) +LINKXX = $(CXX) CP = cp ifneq ("${V}","1") MAKEFLAGS += --quiet