Adding a version_script help needed

346 views
Skip to first unread message

Minseong Kim

unread,
Apr 27, 2017, 10:47:39 AM4/27/17
to Android Building

I am trying use lld for Android linker which does not support exclude-libs linker option.

So I want to use version script to mimic the behavior of the missing option.

However, when I added a version script to a module (specifically bionic/linker/Android.bp) it complains about unrecognized property "arch.arm64.version_script".
-------------------
arch: {
        arm: {
            srcs: ["arch/arm/begin.S"],

            cflags: ["-D__work_around_b_24465209__"],
        },
        arm64: {
            srcs: ["arch/arm64/begin.S"],
            version_script: "linker.arm64.map",
        },
        x86: {
            srcs: ["arch/x86/begin.c"],

            cflags: ["-D__work_around_b_24465209__"],
        },
        x86_64: {
            srcs: ["arch/x86_64/begin.S"],
        },
-------------------

The error is as the following:
-------------------
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja 
out/soong/.bootstrap/bin/soong_build -t -b out/soong -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
error: bionic/linker/Android.bp:51:27: unrecognized property "arch.arm64.version_script"
ninja: build stopped: subcommand failed.
10:28:29 soong bootstrap failed with: exit status 1
make: *** [run_soong_ui] Error 1

#### make failed to build some targets (3 seconds) ####
-------------------

There seems no docs explaining howtos of version script dynamics for Android. Can anyone shed light on the above problem ?

Much appreciated.

cheers,
-- Min

Colin Cross

unread,
Apr 27, 2017, 1:51:42 PM4/27/17
to android-...@googlegroups.com
version_script is implemented for cc_library, but linker is a
cc_binary. If you want a local hack, just add the necessary
"-Wl,--version-script,..." flag to ldflags, and remove the check for
version script arguments at
https://android.googlesource.com/platform/build/soong/+/master/cc/check.go#76
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Minseong Kim

unread,
Apr 29, 2017, 12:28:10 PM4/29/17
to Android Building
Thanks Colin~

Your solution does work successfully. 

cheers,
-- Min
Reply all
Reply to author
Forward
0 new messages