Coder Social home page Coder Social logo

gmp's People

Contributors

cgutman avatar rupan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmp's Issues

x86 & MIPS binaries

Hi,

Thanks for the latest repo update it works a treat.

Would you please if possible include x86 and MIPS compiled binaries to the set.

I have tried to build gmp-5.0.5 myself using Cygwin under Win 7 Ultimate x64 but have got errors I have not been able to resolve.
I am busy building an Ubuntu v12.04 machine (using VM Virtual box) so that I have the same build environment you describe but have not completed it yet.

In the meantime I would apreciate any pointers with where my problem may be in building the library,

I changed the first export command (in compile-gmp.sh) to export NDK="/cygdrive/f/Android/android-ndk-r8b" (which is the correct path for the NDK) and I get the following when running the script,

Deon Marais@Deon-Desktop-Ne /cygdrive/f/Android/gmp-5.0.5
$ ./compile-gmp.sh
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=standard
checking compiler arm-linux-androideabi-gcc -O2 -pedantic -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=2 ... yes
checking whether ARM gcc unsigned division works... yes
checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-androideabi-gcc accepts -g... yes
checking for arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking for arm-linux-androideabi-gcc option to accept ISO C99... -std=gnu99
checking for arm-linux-androideabi-gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking how to run the C preprocessor... arm-linux-androideabi-gcc -std=gnu99 -E
checking build system compiler arm-linux-androideabi-gcc -std=gnu99... no
checking build system compiler arm-linux-androideabi-gcc -std=gnu99 -O2 -pedantic -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=2 ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
make: *** No targets specified and no makefile found. Stop.
make: Nothing to be done for install'. ./compile-gmp.sh: line 45: cd: armeabi-v7a-neon: No such file or directory make: *** No rule to make targetdistclean'. Stop.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=standard
checking compiler arm-linux-androideabi-gcc -O2 -pedantic -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp ... yes
checking whether ARM gcc unsigned division works... yes
checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-androideabi-gcc accepts -g... yes
checking for arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking for arm-linux-androideabi-gcc option to accept ISO C99... -std=gnu99
checking for arm-linux-androideabi-gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking how to run the C preprocessor... arm-linux-androideabi-gcc -std=gnu99 -E
checking build system compiler arm-linux-androideabi-gcc -std=gnu99... no
checking build system compiler arm-linux-androideabi-gcc -std=gnu99 -O2 -pedantic -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
make: *** No targets specified and no makefile found. Stop.
make: Nothing to be done for install'. ./compile-gmp.sh: line 53: cd: armeabi-v7a: No such file or directory make: *** No rule to make targetdistclean'. Stop.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=standard
checking compiler arm-linux-androideabi-gcc -O2 -pedantic -fomit-frame-pointer ... yes
checking whether ARM gcc unsigned division works... yes
checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-androideabi-gcc accepts -g... yes
checking for arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking for arm-linux-androideabi-gcc option to accept ISO C99... -std=gnu99
checking for arm-linux-androideabi-gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking how to run the C preprocessor... arm-linux-androideabi-gcc -std=gnu99 -E
checking build system compiler arm-linux-androideabi-gcc -std=gnu99... no
checking build system compiler arm-linux-androideabi-gcc -std=gnu99 -O2 -pedantic -fomit-frame-pointer ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
make: *** No targets specified and no makefile found. Stop.
make: Nothing to be done for install'. ./compile-gmp.sh: line 61: cd: armeabi: No such file or directory make: *** No rule to make targetdistclean'. Stop.

Thanks again.

localeconv reference issue in API 19

Hello Rupan,

Firstly a big thanks for this repo. I have used it for my work and it is working pretty fine with android API 23. But, I am facing "dlopen failed: cannot locate symbol "localeconv" referenced by libgmp.so" error while accessing the same for API 19. Kindly suggest me a fix.

Thanks

Shared Library Objects include Text Relocations

Using the latest 6.1.2 version of your pre-built libraries, I noticed when compiling on Android 7 (Nougat) using "compileSdkVersion 22" the system presented the warning "Detected problems with app native libraries (please consult log for detail): libgmp.so: text relocations". If I increased the "compileSdkVersion" to 23 or above, the warning changes to a FATAL ERROR, preventing the app from running.

It seems newer versions of Android are disallowing libraries that include text relocations (TEXTRELs) within them. Doing research shows that a GCC compiler flag, -fPIC, can be used to remove text relocations when compiling. Further research showed that GMP shared libraries should use the -fPIC compiler flag by default. This prompted me to check which shared libraries included the TEXTRELs and of the 3 I was using, only the "armeabi" and "armeabi-v7a" libraries included them. Continuing my research showed -fPIC is unable to remove all text relocations from some architecture builds if the TEXTRELs are hand written in assembly; namely ARM builds.

I am logging this issue to ask if -fPIC was indeed enabled for the "armeabi" and "armeabi-v7a" builds. If so, has anyone fixed this issue in another way?

I am discussing the issue on the GMP Discussion email chain now and will most likely move to submitting it as a "bug". However, I want to make sure -fPIC was indeed used to compile the libraries before I mark it as such.

Static Lib

Hi

I'm using your precompiled library, but I get seg faults when I use for example:
mpz_divexact(z, deg, fac);

Would using a static library perhaps solve this issue? Or is there something that I'm doing wrong?

Every thing builds and links fine when build with ndk-build.

configure failed. Please help.

Here's my config.log starting from line 340. Any ideas?

configure:10521: checking C++ compiler aarch64-linux-android-g++  -O2 -g -pedantic -fomit-frame-pointer -Wa,--noexecstack -ffunction-sections -funwind-tables -no-canonical-prefixes -fno-strict-aliasing -fstack-protector-strong -finline-limit=300 -funswitch-loops
Test compile: 
configure:10535: aarch64-linux-android-g++  -O2 -g -pedantic -fomit-frame-pointer -Wa,--noexecstack -ffunction-sections -funwind-tables -no-canonical-prefixes -fno-strict-aliasing -fstack-protector-strong -finline-limit=300 -funswitch-loops conftest.cc >&5
clang80++: warning: optimization flag '-finline-limit=300' is not supported [-Wignored-optimization-argument]
clang80++: warning: optimization flag '-funswitch-loops' is not supported [-Wignored-optimization-argument]
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find crtbegin_dynamic.o: No such file or directory
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -lc++
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find crtend_android.o: No such file or directory
clang80++: error: linker command failed with exit code 1 (use -v to see invocation)
configure:10538: $? = 1
failed program was:

int main (void) { return 0; }
configure:10650: result: no
configure:10521: checking C++ compiler aarch64-linux-android-g++  -g -O2
Test compile: 
configure:10535: aarch64-linux-android-g++  -g -O2 conftest.cc >&5
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find crtbegin_dynamic.o: No such file or directory
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -lc++
/home/hongwu/devel/2020/Android/my-toolchain/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find crtend_android.o: No such file or directory
clang80++: error: linker command failed with exit code 1 (use -v to see invocation)
configure:10538: $? = 1
failed program was:

int main (void) { return 0; }
configure:10650: result: no
configure:10666: error: C++ compiler not available, see config.log for details

Application.mk and Android.mk

Would you mind providing examples for steps 2 and 3?

  1. Add "gmp" to APP_MODULES in jni/Application.mk
  2. Add "gmp" to LOCAL_SHARED_LIBRARIES in your module's Android.mk as required.

I may have other issues, but I wanted to make sure following steps 2 and 3 were not one of them.

Here is what I have at the moment:

Application.mk
APP_MODULES := gmp

Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := foo
LOCAL_SRC_FILES := foo.cpp

LOCAL_SHARED_LIBRARIES := gmp

include $(BUILD_SHARED_LIBRARY)

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.