Thread (9 messages) flat view 9 messages, 4 authors, 2014-12-04

Re: [PATCH v5] selftest: size: Add size test for Linux kernel

From: Tim Bird <hidden>
Date: 2014-12-04 16:39:41
Also in: lkml

On 12/03/2014 04:08 PM, Michael Ellerman wrote:
On Wed, 2014-12-03 at 08:29 -0800, Tim Bird wrote:
quoted
On 12/02/2014 07:43 PM, Michael Ellerman wrote:
quoted
On Tue, 2014-12-02 at 19:36 -0800, Tim Bird wrote:
quoted
This test shows the amount of memory used by the system.
Note that this is dependent on the user-space that is loaded
when this program runs.  Optimally, this program would be
run as the init program itself.
Sorry to only chime in at v5.
quoted
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
new file mode 100644
index 0000000..47f8e9c
--- /dev/null
+++ b/tools/testing/selftests/size/Makefile
@@ -0,0 +1,15 @@
+#ifndef CC
+	CC = $(CROSS_COMPILE)gcc
+#endif
I think the following is preferable:

  CC := $(CROSS_COMPILE)$(CC)


It allows optionally setting a custom CC, as well as optionally CROSS_COMPILE.
I'm not sure I follow this.

If CC is unset, you get only the CROSS_COMPILE prefix.
CC is never unset. The default value is 'cc'.
Yeah - I found that out by experimentation yesterday.  So my whole
idea for configuring it based on an unset CC was misguided.
quoted
If CC is set to e.g. 'gcc', then you get a nicely formatted toolchain string.
Right.
quoted
But if CC already has the prefix applied, then this will result in
  having it duplicated, which surely won't work correctly.
That's just PEBKAC. Don't specify CROSS_COMPILE and also a fully specified CC.
Try it with the kernel Makefile and see how well it works.
quoted
CROSS_COMPILE prefix usage looks a bit uncoordinated in the tools directory, but most
tests seem to be favoring $(CROSS_COMPILE)gcc.
That doesn't make it right :)
Agreed. I'd like to separate this issue from the rest of the patch.
Shuah has accepted the patch as it currently is, but I'd like
to start working on the best way to support cross compilation
throughout the kselftest suite.

Ideally we can have CC set properly in a higher-level Makefile,
and not reference CROSS_COMPILE at all in the sub-directory Makefiles.
This may involve copying how CROSS_COMPILE and CFLAGS work in
the rest of the kernel tree, or making some kselftest-specific
modifications.

 -- Tim
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help