Error compiling for board NodeMCU 1.0 (ESP-12E Module) with AzureIoT headers - iot

Hey guys am sure you are tired of seeing this question on many posts, truth is until now I have not come close to a solution and time is running out.
Below is a sample of the error a, getting please help me in any way. Thanks
Arduino: 1.8.10 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Multiple libraries were found for "AzureIoTUtility.h"
Used: C:\Users\Agent
Not used: C:\Users\Agent
Multiple libraries were found for "AzureIoTProtocol_MQTT.h"
In file included from C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:16:0,
Used: C:\Users\Agent
Not used: C:\Users\Agent
from C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTHub\src\internal/iothub_client_private.h:9,
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\Agent
Not used: C:\Users\Agent
from C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTHub\src\iothub_client_ll_uploadtoblob.c:20:
Multiple libraries were found for "DHT.h"
C:\Users\Agent 96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:114:30:
error: pasting "MOCKABLE_" and "/*this creates a new constbuffer from a memory area*/" does not give
a valid preprocessing token
Used: C:\Users\Agent
#define EXPAND_PROD_ENTRY(A) MOCKABLE_##A
Multiple libraries were found for "ESP8266WiFi.h"
^
Used: C:\Users\Agent
Multiple libraries were foun d for "AzureIoTHub.h"
Used: C:\Users\Agent
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTHub\src/azure_macro_utils/macro_utils_generated.h: 9020:1:
note: in expansion of macro 'EXPAND_PROD_ENTRY'
X(P1) \
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:35:21:
note: in expansion of macro 'MU_FOR_EACH_1_9'
#define MU_C2_(x,y) x##y
^
C:\Users\Agent 96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:119:5: note:
in expansion of macro 'MU_FOR_EACH_1'
MU_FOR_EACH_1(EXPAND_PROD_ENTRY, __VA_ARGS__)
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:35:1: note:
in expansion of macro 'MOCKABLE_INTERFACE'
MOCKABLE_INTERFACE(constbuffer,
^
C:\Users\Agent 96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:11
4:30: error: pasting "MOCKABLE_" and "/*this creates a new constbuffer from an existing BU
FFER_HANDLE*/" does not give a valid preprocessing token
#define EXPAND_PROD_ENTRY(A) MOCKABLE_##A
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTHub\src/azure_macro_utils/macro_utils_generated.h:9024:1:
note: in expansion of macro 'EXPAND_PROD_ENTRY'
X(P1) \
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTHub\src/azure_macro_utils/macro_utils_generated.h:9021:1:
note: in expansion of macro 'MU_FOR_EACH_1_8'
MU_FOR_EACH_1_8(X, P2, P3, P4, P5, P6, P7, P8, P9)
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:35:21:
note: in expansion of macro 'MU_FOR_EACH_1_9'
#define MU_C2_(x,y) x##y
^
C:\Users\Agent 96\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:119:5:
note: in expansion of macro 'MU_FOR_EACH_1'
MU_FOR_EACH_1(EXPAND_PROD_ENTRY, __VA_ARGS__)
^
C:\Users\Agent
96\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:35:1: note:
in expansion of macro 'MOCKABLE_INTERFACE'
MOCKABLE_INTERFACE(constbuffer,
^
C:\Users\Agent 96\Documents\Arduino\libraries\AzureIoTHub\src\iothub_client_ll_uploadtoblob.c:26:27:
fatal error: internal/blob.h: No such file or directory
#include "internal/blob.h"
^
compilation terminated.
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Related

golang gocv error when go run ./cmd/version/main.go

I'm pretty new in Golang and i have some problems to install gocv.
I don't know weather it is impotent to know, but
I use Manjaro Linux on version 5.19.3, the current go- version is 1.14.2 and last but not least gccgo on version 10.1.0 (amd64).
I installed gocv as described on https://gocv.io/getting-started/linux/
go get -u -d gocv.io/x/gocv
cd $GOPATH/pkg/mod/gocv.io/
make install
If it works correctly, following message should be desplayed:
gocv version: 0.24.0
opencv lib version: 4.4.0
# gocv.io/x/gocv
In file included from features2d.cpp:1:
features2d.h:22:21: error: 'SIFT' is not a member of 'cv'
22 | typedef cv::Ptr<cv::SIFT>* SIFT;
| ^~~~
features2d.h:22:21: error: 'SIFT' is not a member of 'cv'
features2d.h:22:25: error: template argument 1 is invalid
22 | typedef cv::Ptr<cv::SIFT>* SIFT;
| ^
features2d.cpp: In function 'int* SIFT_Create()':
features2d.cpp:434:28: error: 'SIFT' is not a member of 'cv'; did you mean 'SIFT'?
434 | return new cv::Ptr<cv::SIFT>(cv::SIFT::create());
| ^~~~
In file included from features2d.cpp:1:
features2d.h:22:28: note: 'SIFT' declared here
22 | typedef cv::Ptr<cv::SIFT>* SIFT;
| ^~~~
features2d.cpp:434:28: error: 'SIFT' is not a member of 'cv'; did you mean 'SIFT'?
434 | return new cv::Ptr<cv::SIFT>(cv::SIFT::create());
| ^~~~
In file included from features2d.cpp:1:
features2d.h:22:28: note: 'SIFT' declared here
22 | typedef cv::Ptr<cv::SIFT>* SIFT;
| ^~~~
features2d.cpp:434:32: error: template argument 1 is invalid
434 | return new cv::Ptr<cv::SIFT>(cv::SIFT::create());
| ^
features2d.cpp:434:38: error: 'cv::SIFT' has not been declared
434 | return new cv::Ptr<cv::SIFT>(cv::SIFT::create());
| ^~~~
features2d.cpp: In function 'KeyPoints SIFT_Detect(SIFT, Mat)':
features2d.cpp:443:9: error: base operand of '->' is not a pointer
443 | (*d)->detect(*src, detected);
| ^~
features2d.cpp: In function 'KeyPoints SIFT_DetectAndCompute(SIFT, Mat, Mat, Mat)':
features2d.cpp:460:9: error: base operand of '->' is not a pointer
460 | (*d)->detectAndCompute(*src, *mask, detected, *desc);
| ^~
Fehler: Prozess beendet mit Rückgabewert 2.
I tried to find a solution on in the internet, but I don't even understand the problem.
I hope someone can help me.
best regards
Felix
SIFT (Scale-Invariant Feature Transform) algorithm is a patented algorithm that requires user to import a non-free header file if you need to use it as below :
#include <opencv2/nonfree/nonfree.hpp>
However, the patent is already expired as of now. (OpenCV 4.4.0) So this package is moved to main repository of opencv (check release highlightes https://opencv.org/opencv-4-4-0/)
As a result,the gocv repository which using SIFT has been updated to get this algorithm from the opencv main repository as below, (in gocv v0.24.0 change log: https://github.com/hybridgroup/gocv/commit/04b71cbb6d82e8c396ccbbf0d65b446a80a0e8fa)
typedef cv::Ptr<cv::SIFT>* SIFT;
This is the line of code updated which causes you failed to build.(You will only get this error if you are not using opencv 4.4.0, you may check the MakeFile that you are using)
To solve this problem, you may try get/update the gocv repository again now as they have updated all MakeFile to use opencv 4.4.0 already. Or you may just manually update your MakeFile to change the opencv version to 4.4.0

qemu-irix fails to build under Alpine 3.10 (GCC 8.3)

Just for fun, I'm attempting to build the irixxxx's qemu-irix as a Docker image.
It builds successfuly under Debian Buster (using GCC 8 container). However, it fails to build under Alpine 3.10 (it fails only when I selected the Irix targets), with the following errors (at the make stage):
CC util/oslib-posix.o
In file included from util/oslib-posix.c:39:
/usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Wcpp]
#warning redirecting incorrect #include <sys/signal.h> to <signal.h>
^~~~~~~
CC util/qemu-openpty.o
util/qemu-openpty.c: In function 'qemu_openpty_raw':
util/qemu-openpty.c:123:9: warning: implicit declaration of function 'openpty'; did you mean 'openat'? [-Wimplicit-function-declaration]
if (openpty(&amaster, aslave, pty_buf, NULL, NULL) < 0) {
^~~~~~~
openat
util/qemu-openpty.c:123:9: warning: nested extern declaration of 'openpty' [-Wnested-externs]
(...)
CC irix-linux-user/linux-user/syscall.o
/qemu-irix/linux-user/syscall.c:6784:22: error: 'F_EXLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_EXLCK),
^~~~~~~
/qemu-irix/linux-user/syscall.c:6779:51: note: in definition of macro 'TRANSTBL_CONVERT'
#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a }
^
/qemu-irix/linux-user/syscall.c:6785:22: error: 'F_SHLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_SHLCK),
^~~~~~~
/qemu-irix/linux-user/syscall.c:6779:51: note: in definition of macro 'TRANSTBL_CONVERT'
#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a }
^
In file included from /qemu-irix/linux-user/syscall.c:121:
/qemu-irix/linux-user/syscall.c: In function 'target_to_host_sigevent':
/qemu-irix/linux-user/syscall.c:7422:27: error: 'struct sigevent' has no member named '_sigev_un'; did you mean 'sigev_value'?
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~
/qemu-irix/linux-user/qemu.h:501:5: note: in definition of macro '__get_user_e'
((x) = (typeof(*hptr))( \
^
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/syscall.c:7422:36: error: '(const bitmask_transtbl *)&<erroneous-expression>' is a pointer; did you mean to use '->'?
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^
/qemu-irix/linux-user/qemu.h:501:5: note: in definition of macro '__get_user_e'
((x) = (typeof(*hptr))( \
^
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/qemu.h:506:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
(hptr)), (void)0)
^
/qemu-irix/linux-user/qemu.h:510:31: note: in expansion of macro '__get_user_e'
# define __get_user(x, hptr) __get_user_e(x, hptr, be)
^~~~~~~~~~~~
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/syscall.c: In function 'do_syscall':
/qemu-irix/linux-user/syscall.c:13545:25: warning: implicit declaration of function 'sethostid'; did you mean 'gethostid'? [-Wimplicit-function-declaration]
ret = get_errno(sethostid(arg1));
^~~~~~~~~
gethostid
/qemu-irix/linux-user/syscall.c:13545:25: warning: nested extern declaration of 'sethostid' [-Wnested-externs]
make[1]: *** [/qemu-irix/rules.mak:66: linux-user/syscall.o] Error 1
make: *** [Makefile:472: subdir-irix-linux-user] Error 2
The command '/bin/sh -c make && DESTDIR=/tmp/qemu make install' returned a non-zero code: 2
I researched about the differences between Debian's and Alpine's GCC (in fact, libc6 and musl) about similar failures, but I haven't found any information about how to solve this without modifying the code.
So, where can I find more information about this issue and which packages may solve it? Thanks.
Dockerfiles and full log here. Docker container image (Debian Buster) here.
The difference seems to be caused by the underlying libc implementations: glibc of Debian, vs musl-libc of Alpine.
While GNU libc is the defacto standard libc implementation in Linux, musl libc is used by a handful of distributions, such as Alpine Linux and Void Linux. musl is a minimalistic strict-POSIX libc implementation, and is generally not compatible with glibc. Usually, software projects have to be ported to musl libc to be supported on Alpine, especially non trivial applications.
The compilation of syscall.c breaks on several places, the first being:
/qemu-irix/linux-user/syscall.c:6784:22: error: 'F_EXLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_EXLCK)
The F_EXLCK is macro is not defined in musl libc's fcntl.h. However, it could be easily patched by defining it manually, for example with make CFLAGS='"-DF_EXLCK=4"'. This is how qemu is patched for musl for non-irix targets (patch link).
However, there are more undefined macros down the road, such as __SIGRTMIN and __SIGRTMAX, the macro TRANSTBL_CONVERT, and probably others. Patching them ad-hoc may not be enough - so it appears to be that the qemu-irix project has to be properly ported for Alpine and musl libc.
If you're willing, you could try following existing qemu musl patches, and attempt to patch it yourself for qemu-irix:
- https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg04773.html
- https://github.com/NixOS/nixpkgs/pull/46449/files
Off topic comment, use make -j to build parallely, which will end much faster.

llvm-link error when using memcpy in C code and compiling with wasm target

I am trying to compile two *.c files to LLVM bitcode via clang, link them together using llvm-link, and make a single *.wasm file out of it. I built LLVM on my machine via the Makefile provided by https://github.com/yurydelendik/wasmception
This works fine until I use memcpy in the C code. Then llvm-link stops with error:
Intrinsic has incorrect argument type!
void (i8*, i8*, i32, i1)* #llvm.memcpy.p0i8.p0i8.i32
The following is a minimal example to reproduce the issue:
one.c
#define EXPORT __attribute__((visibility("default")))
#include <string.h>
char* some_str();
EXPORT void do_something() {
char* cpy_src = some_str();
char other_str[15];
memcpy(other_str, cpy_src, strlen(cpy_src));
}
two.c
char* some_str() {
return "Hello World";
}
Execute the following commands:
$ clang --target=wasm32-unknown-unknown-wasm --sysroot=../wasmception/sysroot -S -emit-llvm -nostartfiles -fvisibility=hidden one.c -o one.bc
[...]
$ clang --target=wasm32-unknown-unknown-wasm --sysroot=../wasmception/sysroot -S -emit-llvm -nostartfiles -fvisibility=hidden two.c -o two.bc
[...]
Note that no optimization is done because that would eliminate the unnecessary memcpy call here. As I said, this is a minimal example out of context to show the error.
$ llvm-link one.bc two.bc -o res.bc -v
Loading 'one.bc'
Linking in 'one.bc'
Loading 'two.bc'
Linking in 'two.bc'
Intrinsic has incorrect argument type!
void (i8*, i8*, i32, i1)* #llvm.memcpy.p0i8.p0i8.i32
llvm-link: error: linked module is broken!
When I comment out the memcpy call in the example file, the error is gone. Of course this is not an option in the real project I am working at.
Am I doing something wrong? Is it a bad idea in general to use memcpy in a WebAssembly context? Can this be a bug in LLVM/Clang?
Reading through these github issues, it seems the memcpy intrinsic is not currently supported by the WASM backend:
https://github.com/WebAssembly/design/issues/236
https://github.com/WebAssembly/design/issues/1003
As a workaround, you could instruct clang to disable intrinsic expansion using -fno-builtin, so that the generated code will call the actual memcpy function.

compiling cocoa lumberjack with Xcode 8.3.2 results in errors in DDOSLogger.m

Trying to build cocoa lumberjack/swift via cocoa pods.
Compiling the latest tag 3.2.0 ends up with errors in DDOSLogger.m
Here a sample:
.../Pods/CocoaLumberjack/Classes/DDOSLogger.m:68:17: error: static_assert failed "formatters/labels/descriptions must be a constant string"
os_log_debug(OS_LOG_DEFAULT, msg);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:271:9: note: expanded from macro 'os_log_debug'
os_log_with_type(log, OS_LOG_TYPE_DEBUG, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:175:9: note: expanded from macro 'os_log_with_type'
OS_LOG_CALL_WITH_FORMAT(_os_log_impl, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/trace_base.h:59:28: note: expanded from macro 'OS_LOG_CALL_WITH_FORMAT'
OS_LOG_PRAGMA_PUSH OS_LOG_STRING(LOG, _os_fmt_str, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/trace_base.h:50:9: note: expanded from macro 'OS_LOG_STRING'
_Static_assert(__builtin_constant_p(_str), \
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
.../Pods/CocoaLumberjack/Classes/DDOSLogger.m:68:17: error: array initializer must be an initializer list or string literal
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:271:9: note: expanded from macro 'os_log_debug'
os_log_with_type(log, OS_LOG_TYPE_DEBUG, format, ##__VA_ARGS__)
^
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:175:9: note: expanded from macro 'os_log_with_type'
OS_LOG_CALL_WITH_FORMAT(_os_log_impl, \
^
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/trace_base.h:59:47: note: expanded from macro 'OS_LOG_CALL_WITH_FORMAT'
OS_LOG_PRAGMA_PUSH OS_LOG_STRING(LOG, _os_fmt_str, fmt); \
^
.../Pods/CocoaLumberjack/Classes/DDOSLogger.m:68:46: error: os_log() format argument is not a string constant
os_log_debug(OS_LOG_DEFAULT, msg);
^~~
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:271:50: note: expanded from macro 'os_log_debug'
os_log_with_type(log, OS_LOG_TYPE_DEBUG, format, ##__VA_ARGS__)
^~~~~~
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/log.h:176:55: note: expanded from macro 'os_log_with_type'
(&__dso_handle, _log_tmp, _type_tmp), format, ##__VA_ARGS__); \
^~~~~~
In module 'os' imported from .../Pods/CocoaLumberjack/Classes/DDOSLogger.m:18:
/Applications/Xcode 8.3.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/os/trace_base.h:60:65: note: expanded from macro 'OS_LOG_CALL_WITH_FORMAT'
uint8_t _os_fmt_buf[__builtin_os_log_format_buffer_size(fmt, ##__VA_ARGS__)]; \
^~~
I've updated cocoa pods, tried this with the last Xcode 8.3.1, cleaned everything, etc... no luck.
What surprises me is that I can't find any discussion of this... apparently I didn't get the message because everyone else either has this working or is using an older tag.
Using tag 3.1.0 works fine, I believe among other things it doesn't have the DDOSLogger included.
I'm not sure if you've managed to fix this, but a similar issue is described here - https://github.com/CocoaLumberjack/CocoaLumberjack/issues/883
Essentially it was a bug in the CocoaLumberjack that appeared with new version of Xcode and it has already been fixed.

Building a C library (GMP) for arm64 iOS

I'm trying to build a C library (GMP 6.0.0) for arm64 for use on iOS. I'm running the configure script with the invocation below (compiler is as found using xcrun --find).
./configure \
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" \
CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" \
CPPFLAGS="-target arm64-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -miphoneos-version-min=7.0" \
--host=aarch64-apple-darwin
However this fails at the following line ("long long reliability test 1"):
checking compiler /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -O2 -pedantic -target arm64-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -miphoneos-version-min=7.0... no, long long reliability test 1
configure: error: could not find a working compiler, see config.log for details
Full config.log available here. It shows multiple warning and errors for the long long reliability test compile, including the following:
conftest.c:9:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
^
conftest.c:10:44: error: implicit declaration of function 'h' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
^
conftest.c:10:48: error: implicit declaration of function 'g' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
^
conftest.c:10:100: warning: control reaches end of non-void function [-Wreturn-type]
for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
^
Using --host=none it works fine, but I'd really like to figure out how to build it with assembly optimized for arm64.
My system is x86_64-apple-darwin13.1.0 (or coreisbr-apple-darwin13.1.0 according to config.guess), an early '11 Core i7 MBP running OS X v10.9.2. I'm using Xcode 5.1 (5B130a).
Any help appreciated.
EDIT 1
Compiling for ARMv7 passes configure, but fails on make (full configure/make output here), apparently while compiling some assembly:
tmp-dive_1.s:165:18: error: unexpected token in '.section' directive
.section .rodata
^
EDIT 2
#MarcGlisse: By forcing clang to ignore the errors as suggested (-Wno-...) arm64 passes configure, but then fails on make (full output here):
tmp-mul_1.s:59:2: error: unrecognized instruction mnemonic
bcc Lfi1
^
tmp-mul_1.s:60:2: error: unrecognized instruction mnemonic
beq Lfi2
^
As a side note: these commits, I assume intended to remove the need for suppressing the error, don't seem to work i.e. I get the same error when removing the supression.
For armv7, using these commits as suggested fixes the .section error, but make fails later on with the following (full output here):
tmp-mode1o.s:64:2: error: unknown directive
.protected ___gmp_binvert_limb_table
^
EDIT 3
Using the suggested edits, armv7, armv7s, i386 and x86_64 now all compile with assembly!
For arm64 the edits get it past the previous error, but now gives several errors about an invalid input constraint 'rZ', all in the same file (full output here):
divrem_1.c:237:5: error: invalid input constraint 'rZ' in asm
udiv_qrnnd_preinv (*qp, r, r, nshift, d, dinv);
^
../gmp-impl.h:3062:2: note: expanded from macro 'udiv_qrnnd_preinv'
add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
^
../longlong.h:551:7: note: expanded from macro 'add_ssaaaa'
: "rZ" (ah), "rZ" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
EDIT 4
After commenting out add_ssaaaa and sub_ddmmss in longlong.h and editing some more assembly instructions in gcd_1.asm (blo to b.lo etc.), it now fails with several of the following errors (full output here):
tmp-invert_limb.s:75:22: error: immediate value expected for shifter operand
add x1, x1, x2, lsr 1
^
tmp-invert_limb.s:75:22: error: invalid operand for instruction
add x1, x1, x2, lsr 1
^
I'll post a total diff later.
EDIT 5
Ok, that gets us another step further, but it now hits into (full output here):
tmp-invert_limb.s:52:2: error: ADR/ADRP relocations must be GOT relative
adrp x1, approx_tab
^
If this keeps going it might be better to continue this via email.
"Support for ARM64 alias Aarch64 alias ARMv8"
https://gmplib.org/gmp6.0
Copyright issues aside...
GMP may not be compatible with Apple's proprietary CPU, and may not be compatible with Clang/LLVM. Being a GNU project it is probably more thoroughly tested with GCC on non-proprietary chipsets.
A quick search shows historically at least there have been issues compiling GMP with clang.
You really should email the GMP community and ask for help on this one.

Resources