ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] endian_switch01: Add HAVE_GETAUXVAL guarder
Date: Fri, 5 May 2023 18:34:36 +0200	[thread overview]
Message-ID: <CAASaF6w=6dOVtH_FYrMuUQPOrwXdMHM_dHD7e-74KHHaimeQWg@mail.gmail.com> (raw)
In-Reply-To: <20230505162822.15676-1-pvorel@suse.cz>

On Fri, May 5, 2023 at 6:28 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> From: Petr Vorel <petr.vorel@gmail.com>
>
> This fixes compilation on uClibc / uClibc-ng (and also older glibc),
> which does not provide this header.
>
> Fixes: 03b76a20c ("endian_switch01.c: drop unused main4()")
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
> Hi Jan,
>
> can you please have a look, I'd prefer to merge this before release
> (build fix on Buildroot).

Looks reasonable (on my phone), ack.

>
> Kind regards,
> Petr
>
>  testcases/kernel/syscalls/switch/endian_switch01.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/switch/endian_switch01.c b/testcases/kernel/syscalls/switch/endian_switch01.c
> index d965aed56..fac9e2382 100644
> --- a/testcases/kernel/syscalls/switch/endian_switch01.c
> +++ b/testcases/kernel/syscalls/switch/endian_switch01.c
> @@ -2,7 +2,7 @@
>  /*
>   * Copyright (c) International Business Machines Corp., 2008
>   * Copyright (c) Paul Mackerras, IBM Corp., 2008
> - * Copyright (c) 2018 Linux Test Project
> + * Copyright (c) 2018-2023 Linux Test Project
>   */
>
>  /*
> @@ -15,16 +15,20 @@
>  #include <stdlib.h>
>  #include <unistd.h>
>  #include <elf.h>
> -#include <sys/auxv.h>
>  #include <sys/types.h>
>  #include <sys/wait.h>
> +
>  #include "tst_test.h"
>
>  #if defined(__powerpc64__) || defined(__powerpc__)
> +
>  # ifndef PPC_FEATURE_TRUE_LE
> -# define PPC_FEATURE_TRUE_LE              0x00000002
> +#  define PPC_FEATURE_TRUE_LE              0x00000002
>  # endif
>
> +# ifdef HAVE_GETAUXVAL
> +#  include <sys/auxv.h>
> +
>  /*
>   * Make minimal call to 0x1ebe. If we get ENOSYS then syscall is not
>   * available, likely because of:
> @@ -98,6 +102,10 @@ static struct tst_test test = {
>         .forks_child = 1,
>  };
>
> +# else
> +TST_TEST_TCONF("Toolchain does not have <sys/auxv.h>");
> +# endif /* HAVE_GETAUXVAL */
> +
>  #else /* defined (__powerpc64__) || (__powerpc__) */
>  TST_TEST_TCONF("This system does not support running of switch() syscall");
>  #endif
> --
> 2.40.1
>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-05-05 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 16:28 [LTP] [PATCH] endian_switch01: Add HAVE_GETAUXVAL guarder Petr Vorel
2023-05-05 16:34 ` Jan Stancek [this message]
2023-05-05 16:36   ` Petr Vorel
2023-05-12  6:37     ` Petr Vorel

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='CAASaF6w=6dOVtH_FYrMuUQPOrwXdMHM_dHD7e-74KHHaimeQWg@mail.gmail.com' \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).