All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] 回复:[PATCH v1] include/mk/env_post.mk: enable __ANDROID__ definition for Android build
Date: Wed, 17 Apr 2019 19:06:51 +0200	[thread overview]
Message-ID: <20190417170651.GA26229@x230> (raw)
In-Reply-To: <20190417163923.GG124555@google.com>

Hi Sandeep,

> > Have you tried to build out-of-aosp? :-)

> Yes, I did that now and ran into a build error with pread02 pasted at the
> end of this email.

> This was much easier than I thought and I think I can start sending trivial
> fixes as I go. Here's what I did.

> 1. Download the ndk20 beta from - https://developer.android.com/ndk/downloads
> 2. Set up ndk toolchains for autoconf as shown in
>    https://developer.android.com/ndk/guides/other_build_systems#autoconf
Thanks for a hint. I was using standalone toolchain [1], created with NKD r19,
but see according a doc that it was deprecated even for r19.

[1] https://developer.android.com/ndk/guides/standalone_toolchain

> 3. In LTP, do
>    $ ./configure --host x86_64-linux-android --prefix=<preferred install location>
>    $ make ANDROID=1

I'm also passing these flags to CFLAGS, but it might not be necessary:
 --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include

for arm host I use:
--host arm-linux-androideabi

and also define CROSS_COMPILE + other variables:
export CROSS_COMPILE=$TOOLCHAIN_ROOT/bin/arm-linux-androideabi-
export AR=${CROSS_COMPILE}ar
export AS=${CROSS_COMPILE}as
export NM=${CROSS_COMPILE}nm
export CC=${CROSS_COMPILE}gcc
export LD=${CROSS_COMPILE}ld
export RANLIB=${CROSS_COMPILE}ranlib

Only CROSS_COMPILE should be needed as, others are in
include/mk/config.mk.default, but my toolchain setup does not detect them
(include/mk/config.mk does not have cross-compile versions)

> Please let me know if this doesn't sound right? It seems a lot easier than
> the steps pasted earlier.

> - ssp


> ======================

> /usr/local/google/home/sspatil/bin/android-ndk-r20-beta2/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android28-clang -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -Werror-implicit-function-declaration -D_FORTIFY_SOURCE=2 -I/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases/kernel/syscalls/preadv -I/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases/kernel/syscalls/preadv/../utils -I../../../../include -I../../../../include -I../../../../include/old/   -L../../../../lib -L../../../../lib/android_libpthread -L../../../../lib/android_librt  preadv02.c   -lltp -o preadv02
> preadv02.c:89:7: error: implicit declaration of function 'preadv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         TEST(preadv(*tc->fd, tc->name, tc->count, tc->offset));
>              ^
I bump into the same problem

+ this one:
pwritev02.c:85:7: error: implicit declaration of function 'pwritev' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        TEST(pwritev(*tc->fd, tc->name, tc->count, tc->offset));

So for the build is needed to comment out HAVE_PREADV and HAVE_PWRITEV
definitions in include/config.h.

I don't know why autotools fails preadv and pwritev detection with AC_CHECK_FUNCS.
I considered it as problem of my setup, but maybe it's an autotools bug.

> 1 error generated.
> <builtin>: recipe for target 'preadv02' failed
> make[4]: *** [preadv02] Error 1
> make[4]: Leaving directory '/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases/kernel/syscalls/preadv'
> ../../../include/mk/generic_trunk_target.inc:93: recipe for target 'all' failed
> make[3]: *** [all] Error 2
> make[3]: Leaving directory '/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases/kernel/syscalls'
> ../../include/mk/generic_trunk_target.inc:93: recipe for target 'all' failed
> make[2]: *** [all] Error 2
> make[2]: Leaving directory '/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases/kernel'
> ../include/mk/generic_trunk_target.inc:93: recipe for target 'all' failed
> make[1]: *** [all] Error 2
> make[1]: Leaving directory '/usr/local/google/home/sspatil/dev/ssd2/ltp/testcases'
> Makefile:111: recipe for target 'testcases-all' failed
> make: *** [testcases-all] Error 2


Kind regards,
Petr

  reply	other threads:[~2019-04-17 17:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09  4:05 [LTP] [PATCH v1] include/mk/env_post.mk: enable __ANDROID__ definition for Android build Zhengwang Ruan
2019-04-09 16:45 ` [LTP] 回复:[PATCH " =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-10 14:16   ` Petr Vorel
2019-04-11  3:38     ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-11 16:27     ` Sandeep Patil
2019-04-11 17:37       ` Petr Vorel
2019-04-11 23:40         ` Petr Vorel
2019-04-12  4:45           ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-12  6:28             ` Petr Vorel
2019-04-12 16:15               ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-12 19:48                 ` Sandeep Patil
2019-04-16 12:27                   ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-17 16:39                     ` Sandeep Patil
2019-04-17 17:06                       ` Petr Vorel [this message]
2019-04-19 15:49                         ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-21 22:10                           ` Petr Vorel
2019-04-23 17:28                             ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-23 20:38                               ` Petr Vorel
2019-04-12  3:09       ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
2019-04-24  9:14 ` [LTP] [PATCH " Petr Vorel
2019-04-24 19:23   ` Steve Muckle
2019-04-24 20:19     ` Petr Vorel
2019-04-25  3:08     ` =?unknown-8bit?b?6Ziu5q2j5pe6?=

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=20190417170651.GA26229@x230 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 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.