Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable armeabi-v7a-hard #366

Closed
directrix1 opened this issue Apr 23, 2015 · 4 comments
Closed

Enable armeabi-v7a-hard #366

directrix1 opened this issue Apr 23, 2015 · 4 comments

Comments

@directrix1
Copy link

I've been trying to build using armeabi-v7a-hard, by setting the ARCH in distribute.py . I'm doing this to use the hard float ABI to try and extract a bit better floating point performance out of Kivy animations. It seems to work pretty well in general, except sometimes projects either don't honor the arch or they try to explicitly link with the m library instead of m_hard. Would love a little help with this.

@directrix1
Copy link
Author

To get it working, I just set the CFLAGS and LDFLAGS to values below, commented out the lines that error out on unknown options in src/tools/liblink, and added "--with-libm=' -lm_hard '" to the python recipe's configure line. Here is what I set in distribute.py in the push_arm function if anyone cares:

    export OFLAG="-O3"

    export CFLAGS="-DANDROID -mandroid $OFLAG -fomit-frame-pointer --sysroot $NDKPLATFORM"
    CFLAGS+=" -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes "
    if [ "X$ARCH" == "Xarmeabi-v7a" ]; then
        #CFLAGS+=" -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb "
        CFLAGS+=" -march=armv7-a -mfpu=vfpv3-d16 -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch "
    fi
    export CXXFLAGS="$CFLAGS"

    export LDFLAGS=' -no-canonical-prefixes '
    if [ "X$ARCH" == "Xarmeabi-v7a" ]; then
        LDFLAGS+=" -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -lm_hard "
    else
        # that could be done only for darwin platform, but it doesn't hurt.
        LDFLAGS+="-lm"
    fi

@tito
Copy link
Member

tito commented May 16, 2015

This could be done, but first we need to analysis what phone works/don't work with this flag, and how we can support previous generation if needed.

@inclement
Copy link
Member

With a --arch option fully implemented in the new toolchain, I'm going to close this. We'd probably accept a PR to the old toolchain if anyone wants to do it.

@ZhangKuixun
Copy link

@directrix1 @inclement @tito I have same question. How do you build other versions of ABI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants