All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] selftests/sgx
@ 2022-05-07 20:03 Jarkko Sakkinen
  2022-05-08 21:38 ` Peter Seiderer
  0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2022-05-07 20:03 UTC (permalink / raw)
  To: buildroot

Hi,

When specifying "BR2_PACKAGE_LINUX_TOOLS_SELFTESTS=y", for some reason
tools/testing/selftests/sgx/ build results, i.e. "sgx:test_sgx", does
not get included to the rootfs image, nor is it listed in 
kselftest-list.txt.

If I manually compile and install selftests, it does get included. Any
ideas what could be wrong?

BR, Jarkko
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] selftests/sgx
  2022-05-07 20:03 [Buildroot] selftests/sgx Jarkko Sakkinen
@ 2022-05-08 21:38 ` Peter Seiderer
  2022-05-17 17:06   ` Jarkko Sakkinen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2022-05-08 21:38 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: buildroot

Hello Jarkko,

On Sat, 07 May 2022 23:03:57 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:

> Hi,
> 
> When specifying "BR2_PACKAGE_LINUX_TOOLS_SELFTESTS=y", for some reason
> tools/testing/selftests/sgx/ build results, i.e. "sgx:test_sgx", does
> not get included to the rootfs image, nor is it listed in 
> kselftest-list.txt.
> 
> If I manually compile and install selftests, it does get included. Any
> ideas what could be wrong?

For which architecture do you (cross) compile (what is your target architecture)?

According to e.g. [1]:

[...]
  7 CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh $(CC) \
  8   
[...]
 19 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
 20 
 21 ifeq ($(CAN_BUILD_X86_64), 1)
 22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
 23 endif
[...]

test_sgx is only compiled for x86_64 (and/or CAN_BUILD_X86_64 is true)...

Regards,
Peter

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/sgx/Makefile?h=v5.17.5


> 
> BR, Jarkko
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] selftests/sgx
  2022-05-08 21:38 ` Peter Seiderer
@ 2022-05-17 17:06   ` Jarkko Sakkinen
  2022-05-17 20:48     ` Peter Seiderer
  0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2022-05-17 17:06 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

On Sun, 2022-05-08 at 23:38 +0200, Peter Seiderer wrote:
> Hello Jarkko,
> 
> On Sat, 07 May 2022 23:03:57 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:
> 
> > Hi,
> > 
> > When specifying "BR2_PACKAGE_LINUX_TOOLS_SELFTESTS=y", for some reason
> > tools/testing/selftests/sgx/ build results, i.e. "sgx:test_sgx", does
> > not get included to the rootfs image, nor is it listed in 
> > kselftest-list.txt.
> > 
> > If I manually compile and install selftests, it does get included. Any
> > ideas what could be wrong?
> 
> For which architecture do you (cross) compile (what is your target architecture)?
> 
> According to e.g. [1]:
> 
> [...]
>   7 CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh $(CC) \
>   8   
> [...]
>  19 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
>  20 
>  21 ifeq ($(CAN_BUILD_X86_64), 1)
>  22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
>  23 endif
> [...]

Hi,

My config is contained fully here:

https://github.com/jarkkojs/buildroot-sgx/blob/master/configs/sgx_x86_64_defconfig

And my kernel config is here:

https://github.com/jarkkojs/buildroot-sgx/blob/master/board/sgx/x86_64/linux.config

I.e. can be built with "make sgx_x86_64_defconfig && make".

> test_sgx is only compiled for x86_64 (and/or CAN_BUILD_X86_64 is true)...
> 
> Regards,
> Peter

BR, Jarkko
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] selftests/sgx
  2022-05-17 17:06   ` Jarkko Sakkinen
@ 2022-05-17 20:48     ` Peter Seiderer
  2022-05-18  1:45       ` Jarkko Sakkinen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2022-05-17 20:48 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: buildroot

Hello Jarkko,

On Tue, 17 May 2022 20:06:51 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:

> On Sun, 2022-05-08 at 23:38 +0200, Peter Seiderer wrote:
> > Hello Jarkko,
> > 
> > On Sat, 07 May 2022 23:03:57 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:
> >   
> > > Hi,
> > > 
> > > When specifying "BR2_PACKAGE_LINUX_TOOLS_SELFTESTS=y", for some reason
> > > tools/testing/selftests/sgx/ build results, i.e. "sgx:test_sgx", does
> > > not get included to the rootfs image, nor is it listed in 
> > > kselftest-list.txt.
> > > 
> > > If I manually compile and install selftests, it does get included. Any
> > > ideas what could be wrong?  
> > 
> > For which architecture do you (cross) compile (what is your target architecture)?
> > 
> > According to e.g. [1]:
> > 
> > [...]
> >   7 CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh $(CC) \
> >   8   
> > [...]
> >  19 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
> >  20 
> >  21 ifeq ($(CAN_BUILD_X86_64), 1)
> >  22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
> >  23 endif
> > [...]  
> 
> Hi,
> 
> My config is contained fully here:
> 
> https://github.com/jarkkojs/buildroot-sgx/blob/master/configs/sgx_x86_64_defconfig
> 
> And my kernel config is here:
> 
> https://github.com/jarkkojs/buildroot-sgx/blob/master/board/sgx/x86_64/linux.config
> 
> I.e. can be built with "make sgx_x86_64_defconfig && make".
> 

The original error message from linux-5.17.7/tools/testing/selftests/sgx is
(Note: no global failure in linux-tools/selftests in case one or more of the
test case compiles fail):

  .../host/bin/x86_64-buildroot-linux-gnu-gcc -Wall -Werror -g -I../../../../tools/include -fPIC -z noexecstack -c sigstruct.c -o .../build/linux-5.17.7/tools/testing/selftests/kselftest/sgx/sigstruct.o
  sigstruct.c:15:10: fatal error: openssl/err.h: No such file or directory
     15 | #include <openssl/err.h>
        |          ^~~~~~~~~~~~~~~
  compilation terminated.

You need to enable 'BR2_PACKAGE_OPENSSL' in your defconfig and apply
the following buildroot patch:

--- a/package/linux-tools/linux-tool-selftests.mk.in
+++ b/package/linux-tools/linux-tool-selftests.mk.in
@@ -18,6 +18,10 @@ endif
 
 SELFTESTS_DEPENDENCIES = libcap-ng popt
 
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+SELFTESTS_DEPENDENCIES += openssl
+endif
+
 SELFTESTS_MAKE_FLAGS = \
        $(LINUX_MAKE_FLAGS) \
        ARCH=$(SELFTESTS_ARCH)


Regards,
Peter


> > test_sgx is only compiled for x86_64 (and/or CAN_BUILD_X86_64 is true)...
> > 
> > Regards,
> > Peter  
> 
> BR, Jarkko
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] selftests/sgx
  2022-05-17 20:48     ` Peter Seiderer
@ 2022-05-18  1:45       ` Jarkko Sakkinen
  0 siblings, 0 replies; 5+ messages in thread
From: Jarkko Sakkinen @ 2022-05-18  1:45 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

On Tue, 2022-05-17 at 22:48 +0200, Peter Seiderer wrote:
> Hello Jarkko,
> 
> On Tue, 17 May 2022 20:06:51 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:
> 
> > On Sun, 2022-05-08 at 23:38 +0200, Peter Seiderer wrote:
> > > Hello Jarkko,
> > > 
> > > On Sat, 07 May 2022 23:03:57 +0300, Jarkko Sakkinen <jarkko.sakkinen@iki.fi> wrote:
> > >   
> > > > Hi,
> > > > 
> > > > When specifying "BR2_PACKAGE_LINUX_TOOLS_SELFTESTS=y", for some reason
> > > > tools/testing/selftests/sgx/ build results, i.e. "sgx:test_sgx", does
> > > > not get included to the rootfs image, nor is it listed in 
> > > > kselftest-list.txt.
> > > > 
> > > > If I manually compile and install selftests, it does get included. Any
> > > > ideas what could be wrong?  
> > > 
> > > For which architecture do you (cross) compile (what is your target architecture)?
> > > 
> > > According to e.g. [1]:
> > > 
> > > [...]
> > >   7 CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh $(CC) \
> > >   8   
> > > [...]
> > >  19 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
> > >  20 
> > >  21 ifeq ($(CAN_BUILD_X86_64), 1)
> > >  22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
> > >  23 endif
> > > [...]  
> > 
> > Hi,
> > 
> > My config is contained fully here:
> > 
> > https://github.com/jarkkojs/buildroot-sgx/blob/master/configs/sgx_x86_64_defconfig
> > 
> > And my kernel config is here:
> > 
> > https://github.com/jarkkojs/buildroot-sgx/blob/master/board/sgx/x86_64/linux.config
> > 
> > I.e. can be built with "make sgx_x86_64_defconfig && make".
> > 
> 
> The original error message from linux-5.17.7/tools/testing/selftests/sgx is
> (Note: no global failure in linux-tools/selftests in case one or more of the
> test case compiles fail):
> 
>   .../host/bin/x86_64-buildroot-linux-gnu-gcc -Wall -Werror -g -I../../../../tools/include -fPIC -z noexecstack -c sigstruct.c -o .../build/linux-
> 5.17.7/tools/testing/selftests/kselftest/sgx/sigstruct.o
>   sigstruct.c:15:10: fatal error: openssl/err.h: No such file or directory
>      15 | #include <openssl/err.h>
>         |          ^~~~~~~~~~~~~~~
>   compilation terminated.
> 
> You need to enable 'BR2_PACKAGE_OPENSSL' in your defconfig and apply
> the following buildroot patch:
> 
> --- a/package/linux-tools/linux-tool-selftests.mk.in
> +++ b/package/linux-tools/linux-tool-selftests.mk.in
> @@ -18,6 +18,10 @@ endif
>  
>  SELFTESTS_DEPENDENCIES = libcap-ng popt
>  
> +ifeq ($(BR2_PACKAGE_OPENSSL),y)
> +SELFTESTS_DEPENDENCIES += openssl
> +endif
> +
>  SELFTESTS_MAKE_FLAGS = \
>         $(LINUX_MAKE_FLAGS) \
>         ARCH=$(SELFTESTS_ARCH)
> 
> 
> Regards,
> Peter

Thank you that explains it.

I think that more appropriate would be:

ifeq ($(NORMALIZED_ARCH),x86_64)
SELFTESTS_DEPENDENCIES += openssl
endif

BR, Jarkko
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-18  1:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 20:03 [Buildroot] selftests/sgx Jarkko Sakkinen
2022-05-08 21:38 ` Peter Seiderer
2022-05-17 17:06   ` Jarkko Sakkinen
2022-05-17 20:48     ` Peter Seiderer
2022-05-18  1:45       ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.