lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 Feb 2007 22:06:19 -0800
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	olecom@...wer.upol.cz, sam@...nborg.org, zippel@...ux-m68k.org
Subject: kbuild feature/question: default ARCH

Hi,

I'd like for kbuild to default ARCH to the already-symlinked
arch in include/asm-$(ARCH) if ARCH is not specified on the
command line or in the environment.  I have a non-working patch,
complete with a circular dependency which is dropped:

make: Circular ' <- ' dependency dropped.

Any suggestions for how to complete this?

Thanks.
---

From: Randy Dunlap <randy.dunlap@...cle.com>

If ARCH is unspecified (command line or environment) and if
include/asm is already a symlink to include/asm-$ARCH,
use that ARCH as the default instead of the host ARCH.
Undo the effect of this by using 'make mrproper' or just 'rm include/asm'.

This allows us to drop 'ARCH=fobr' for subsequent builds of the same
ARCH, after using it in a build one time (not counting make *config).

Signed-off-by: Randy Dunlap <randy.dunlap@...cle.com>
---
 Makefile |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

--- linux-2.6.20-git9.orig/Makefile
+++ linux-2.6.20-git9/Makefile
@@ -172,6 +172,10 @@ SUBARCH := $(shell uname -m | sed -e s/i
 # make ARCH=ia64
 # Another way is to have ARCH set in the environment.
 # The default ARCH is the host where make is executed.
+#
+# However, if include/asm is already a symlink to include/asm-$ARCH,
+# use that ARCH as the default instead of the host ARCH.
+# Undo the effect of this by using 'make mrproper' or just 'rm include/asm'.
 
 # CROSS_COMPILE specify the prefix used for all executables used
 # during compilation. Only gcc and related bin-utils executables
@@ -182,6 +186,20 @@ SUBARCH := $(shell uname -m | sed -e s/i
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
+# if ARCH is unspecified & symlink include/asm exists, set ARCH to
+# its symlink arch
+@...o '  CHK DEF ARCH -> include/asm:'
+$(Q)if [ "$(ARCH)" == "" -a -h $(srctree)/include/asm ]; then \
+	symlink=`readlink include/asm` \
+	len=`expr length $symlink` \
+	if [ len -le 4 ]; then \
+		@echo '    no symlink for include/asm' \
+	else \
+		ARCH=${symlink:4} \
+		@echo '    ARCH symlink to ${ARCH}' \
+	fi \
+fi
+
 ARCH		?= $(SUBARCH)
 CROSS_COMPILE	?=
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ