[Toybox] Poking at llvm again, now in aosp prebuilts.

enh enh at google.com
Thu Aug 22 14:39:41 PDT 2019


remember that clang is always a cross compiler: that compiler builds
all the things for all the architectures. you need to tell it to
target Android. here it's defaulting to building for what you're
running it on.

(but you don't want to use the platform prebuilts anyway. use the NDK.
and if you want something that acts more like a regular single-target
compiler: https://developer.android.com/ndk/guides/standalone_toolchain#building_open_source_projects_using_standalone_toolchains
)

On Thu, Aug 22, 2019 at 2:29 PM Rob Landley <rob at landley.net> wrote:
>
> So I have an android checking lying around, and I went "does the prebuilt
> toolchain in THAT build toybox", so I did:
>
> $ ln -s clang android/aosp/prebuilts/clang/host/linux-x86/clang-r353983c/bin/llvm-cc
> $ LDFLAGS=--static
> CROSS_COMPILE=~/android/aosp/prebuilts/clang/host/linux-x86/clang-r353983c/bin/llvm-
> make clean oldconfig toybox
>
> And I got:
>
> generated/obj/id.o: In function `do_id':
> id.c:(.text.do_id+0x1b7): warning: Using 'getgrouplist' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
> generated/obj/lib_xwrap.o: In function `xsetuser':
> xwrap.c:(.text.xsetuser+0xb): warning: Using 'initgroups' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
> generated/obj/lib_xwrap.o: In function `xgetgrgid':
> xwrap.c:(.text.xgetgrgid+0x4): warning: Using 'getgrgid' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
>
> And so on.
>
> Um... not bionic? This is an llvm toolchain building against the host glibc?
>
> Why?
>
> (I think I asked this before, but don't remember the answer? Wouldn't it be more
> portable to statically link all the prebuilts against bionic instead of
> dynamically link them against the host libc? Dynamic library version skew is
> common-ish, kernel syscall version skew is quite _uncommon_. And thinking of
> this as a cross compiler toolchain... those provide their own libraries.)
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



More information about the Toybox mailing list