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
__mips__ is defined for both 32 and 64bit mips on Android #813
Comments
This has been mentioned before (here for example). That file (curlbuild.h as it appears in the distribution tarball) is really not intended to be used on systems that can run configure and generate its proper header, which should include most systems that can run on MIPS. When configure runs, it outputs a generated version for that particular system. I could still see a value in fixing this so that maybe we can work on, long-term, move (back) toward not generating a system specific curlbuild.h at build time. Can you suggest a full patch that you deem proper for this to build fine for you? |
In understand that it's a generic header not meant to be used, but when building for Android from Windows using jni, there are no easy way to run configure The fix I suggested that checks if |
And you really need |
Yeah I meant the |
Something like this? diff --git a/include/curl/curlbuild.h.dist b/include/curl/curlbuild.h.dist
index 58323d0..ae95095 100644
--- a/include/curl/curlbuild.h.dist
+++ b/include/curl/curlbuild.h.dist
@@ -525,13 +525,13 @@
/* ===================================== */
/* KEEP GENERIC GCC THE LAST ENTRY */
/* ===================================== */
#elif defined(__GNUC__)
-# if defined(__ILP32__) || \
+# if !defined(__LP64__) && (defined(__ILP32__) || \
defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
- defined(__sparc__) || defined(__mips__) || defined(__sh__)
+ defined(__sparc__) || defined(__mips__) || defined(__sh__))
# define CURL_SIZEOF_LONG 4
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_FORMAT_OFF_T "%lld" |
That might work I guess, I did it different, as mentioned in my initial bug report, trying to add a patch here but the formatting keeps messing it up. |
|
Right, I prepended that 64bit check because I figured it is such an important define that if set on any platform it implies 64bit. |
That will work |
Thanks! |
I did this
Custom compile script for Android, compiling for mips64 fails due to CURL_SIZEOF_LONG not matching sizeof(long)
I expected the following
curlbuild.h line 532
defined(__mips__)
is true for both 32 and 64 bit mips when compiling for Android, changing it to(defined(__mips__) && !defined(__LP64__))
fixes it.curl/libcurl version
version 7.48
OS version
Compiling for Android in Windows 7
The text was updated successfully, but these errors were encountered: