Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] ltp-testsuite: build kernel modules when appropriate
Date: Tue, 5 Apr 2016 11:23:21 +0200	[thread overview]
Message-ID: <57038409.20600@mind.be> (raw)
In-Reply-To: <57026754.50205@free.fr>

On 04/04/16 15:08, Mason wrote:
> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>
> If we're building a kernel, we can also build LTP's test modules.
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---
>   package/ltp-testsuite/ltp-testsuite.mk | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk
> index 8adfdef68d69..1c1c2a0d4f6b 100644
> --- a/package/ltp-testsuite/ltp-testsuite.mk
> +++ b/package/ltp-testsuite/ltp-testsuite.mk
> @@ -13,6 +13,14 @@ LTP_TESTSUITE_CONF_OPTS += \
>   	--with-power-management-testsuite \
>   	--with-realtime-testsuite
>
> +ifeq ($(BR2_LINUX_KERNEL),y)
> +LTP_TESTSUITE_DEPENDENCIES += linux
> +LTP_TESTSUITE_MAKE_ENV = ARCH=$(KERNEL_ARCH)

  Have you actually tested the defconfig that Thomas suggested? This still 
doesn't work, because it tries to build with host gcc instead of cross-gcc:

Building modules: ltp_block_dev.c
/usr/bin/make -C 
/home/arnout/src/buildroot/out/wandboard/build/linux-86429847b5152f040f190015faedcac49b243328 
M=output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel
make[7]: Entering directory 
'output/build/linux-86429847b5152f040f190015faedcac49b243328'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/.tmp_versions 
; rm -f 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/.tmp_versions/*
/usr/bin/make -f scripts/Makefile.build 
obj=output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel
(cat /dev/null; echo 
kernel/output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.ko;) 
 > 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/modules.order
gcc 
-Wp,-MD,output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/.ltp_block_dev.o.d 
-nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/5/include 
-Ioutput/build/linux-86429847b5152f040f190015faedcac49b243328/arch/arm/include 
-Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h 
-D__KERNEL__ -mlittle-endian -Iarch/arm/mach-mx6/include 
-Iarch/arm/plat-mxc/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs 
-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration 
-Wno-format-security -fno-delete-null-pointer-checks -Os -fno-dwarf2-cfi-asm 
-fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux 
-mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a 
-msoft-float -Uarm -fno-omit-frame-pointer -fno-optimize-sibling-calls 
-DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=#s" 
-D"KBUILD_BASENAME=KBUILD_STR(ltp_block_dev)" 
-D"KBUILD_MODNAME=KBUILD_STR(ltp_block_dev)" -c -o 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/.tmp_ltp_block_dev.o 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
rm -f 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/built-in.o; 
ar rcsD 
output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/built-in.o
gcc: error: unrecognized argument in option '-mabi=aapcs-linux'
gcc: note: valid arguments to '-mabi=' are: ms sysv
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mapcs'
gcc: error: unrecognized command line option '-mno-sched-prolog'
gcc: error: unrecognized command line option '-mno-thumb-interwork'
scripts/Makefile.build:311: recipe for target 
'output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.o' 
failed
make[8]: *** 
[output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.o] 
Error 1
make[8]: *** Waiting for unfinished jobs....
Makefile:1360: recipe for target 
'_module_output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel' 
failed
make[7]: *** 
[_module_output/build/ltp-testsuite-20160126/testcases/kernel/device-drivers/block/block_dev_kernel] 
Error 2
make[7]: Leaving directory 
'output/build/linux-86429847b5152f040f190015faedcac49b243328'
../../../../../include/mk/module.mk:59: recipe for target '.dep_modules' failed
make[6]: [.dep_modules] Error 2 (ignored)


  Can you try instead to set

LTP_TESTSUITE_MAKE_ENV = $(LINUX_MAKE_FLAGS)

  The problem is that autotools sets CC and CROSS_COMPILE correctly for its own 
Makefiles, but doesn't export them so they are not used for the kernel build system.


  Regards,
  Arnout

> +LTP_TESTSUITE_CONF_OPTS += --with-linux-dir=$(LINUX_DIR)
> +else
> +LTP_TESTSUITE_CONF_OPTS += --without-modules
> +endif
> +
>   # Needs libcap with file attrs which needs attr, so both required
>   ifeq ($(BR2_PACKAGE_LIBCAP)$(BR2_PACKAGE_ATTR),yy)
>   LTP_TESTSUITE_DEPENDENCIES += libcap
>


-- 
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

  reply	other threads:[~2016-04-05  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 14:02 [Buildroot] [PATCH] ltp-testsuite: build kernel modules when appropriate Mason
2016-03-24 21:25 ` Thomas Petazzoni
2016-03-28 12:49   ` Mason
2016-03-29 19:12     ` Arnout Vandecappelle
2016-04-04 13:08       ` [Buildroot] [PATCH v2] " Mason
2016-04-05  9:23         ` Arnout Vandecappelle [this message]
2016-04-05 11:09           ` [Buildroot] [PATCH v3] " Mason
2016-04-14 19:29             ` Mason
2016-04-18 19:42             ` Thomas Petazzoni
2016-04-18 20:03               ` Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57038409.20600@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox