PIN tool unknown ABI error - c++

I installed the latest version of PIN from here. And I modified the created a file to trace calls to gets() using a copy of malloctrace.cpp. However, while compiling, I get an error:
In file included from ./include/pin/pin.H:41:0, from
tools/ManualExamples/inputtrace.cpp:32:
./include/pin/compiler_version_check2.H:83:3: error: #error "Unknown
target architecture" # error "Unknown target architecture" ^
./include/pin/compiler_version_check2.H:98:2: error: #error "internal
error pin compiler configuration not available " #error "internal
error pin compiler configuration not available " ^
./include/pin/compiler_version_check2.H:102:2: error: #error The C++
ABI of your compiler does not match the ABI of the pin kit. #error
The C++ ABI of your compiler does not match the ABI of the pin kit.
^ ./include/pin/compiler_version_check2.H:122:2: error: #error Kit has
unknown compiler ABI #error Kit has unknown compiler ABI ^ In file
included from ./include/pin/level_base.PLH:66:0,
from ./include/pin/pin.H:43,
from tools/ManualExamples/inputtrace.cpp:32:
./include/pin/foundation.PLH:25:28: fatal error: types_marker.TLH: No
such file or directory #include "types_marker.TLH"
^
compilation terminated.
I did make sure that the version of PIN I installed was the latest. But the problem persists.
Can someone help me in this regard?
Update: I am using a linux machine x86-64 and the compiler is gcc version 4.8.4

Adding this as an answer since, I do not have the required reputation to make a comment.
Unless you tell us the exact parameters you used for running make, I am afraid a clear and direct answer to your question will not be possible.
This might be a total stab in the dark. But, I ran into a similar problem recently, like you have specified above. I am using an x86_64 Linux system and I was trying to cross-compile my PinTool for ia-32 architecture.
If you do not have 32-bit shared libraries in your system, or if you get the TARGET parameter in make wrong, it would result in
Unknown target architecture
For me running the below command, made it build successfully. Use the following to build for ia32 architecture.
make TARGET=ia32

Related

cmsis_compiler.h: No such file or directory while compiling Arduino Tensorflow lite library for Arduino Due

I am trying to compile the Arduino Tensorflow lite Library example file for Arduino Due board, but at the time of compilation I got error of missing cmsis_compiler.h file error. I also tried to compile the code for STM32F103C8 board on Arduino version 1.8.12 with the Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled library but still the same error. Here is the complete error
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/third_party/gemmlowp/fixedpoint/fixedpoint.h:24,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/kernels/internal/reference/add.h:18,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:16:
c:\users\strange lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnsupportfunctions.h:33:0,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnfunctions.h:163,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:18:
C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/DSP/Include/arm_math.h:382:28: fatal error: cmsis_compiler.h: No such file or directory
#include "cmsis_compiler.h"
^
compilation terminated.
Using library Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled in folder: C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite
exit status 1
Error compiling for board Generic STM32F103C series.```
I can understand that may be the Arduino Due is not officially supported but I think the STM32F103C8 board is supported. So is there anything which I am missing here?
I hope you have found an answer yourself since posting this question, but for anyone else fumbling their way in here; it seems like the current tensorflow-lite library (as I'm writing this it is: 2.1.0-APLHA-precompiled) only works with MbedOS-boards (Portenta H7 and Nano 33 BLE).
Hope you could use this answer :D

Mingw32 errors when building OpenCV 3.2.0 on Windows 7

I'm trying to build OpenCV 3.2.0 vc14 from its sources with MinGW 5.3.0 32 bit in order to use its functionality from Qt 5.8. My platform is Windows 7 64 bit.
The main instruction I follow is here, on Qt's wiki. On several steps, I encounter errors for which I haven't found solutions yet. As I am a newbie, I apologize for my helplessness and will appriciate any suggestions.
Error 1. On the stage of generating build files.
In cmake-gui (cmake-3.2.1-win32-x86), I precisely follow the steps specified in the Qt wiki article mentioned above. However, during the final generation, the following CMake error occurs at the end:
CMake Error in modules/highgui/CMakeLists.txt:
No known features for CXX compiler
"GNU"
version 5.3.0.
Generating done
I wonder how it affects the project files and if it causes the next errors.
Error 2. When trying to build OpenCV
The build process is interrupted midway, logging the following:
In file included from C:/Qt/Tools/mingw530_32/i686-w64-
mingw32/include/c++/type_
traits:35:0,
from C:/Qt/5.8/mingw53_32/include/QtCore/qglobal.h:45,
from C:/Qt/5.8/mingw53_32/include/QtCore/QtCore:4,
from C:/Qt/5.8/mingw53_32/include/QtOpenGL/QtOpenGLDepends:3,
from C:/Qt/5.8/mingw53_32/include/QtOpenGL/QtOpenGL:3,
from C:/opencv/sources/modules/highgui/src/window_QT.h:46,
from C:\opencv\sources\modules\highgui\src\window_QT.cpp:47:
C:/Qt/Tools/mingw530_32/i686-w64-
mingw32/include/c++/bits/c++0x_warning.h:32:2:
error: #error This file requires compiler and library support for the ISO
C++ 2011 standard. This support is currently experimental, and must be
enabled with the -std=c++11 or -std=gnu++11 compiler options.
(...)
C:/Qt/5.8/mingw53_32/include/QtCore/qcompilerdetection.h:562:6: error:
#error Qt requires a C++11 compiler and yours does not seem to be that.
(...)
^
C:/Qt/5.8/mingw53_32/include/QtCore/qtypeinfo.h:62:40: error: expected
primary-expression before '>' token isIntegral = std::is_integral<T>::value,
^
C:/Qt/5.8/mingw53_32/include/QtCore/qtypeinfo.h:62:41: error: '::value' has
not been declared isIntegral = std::is_integral<T>::value,
NOTE: I also had sprintf() family security error. So I followed Alex's suggestion to add add_definitions(-DSTRSAFE_NO_DEPRECATE) to the beginning of CMakeLists.txt to suppress the error.
Thank you for your time.

How to get an appropriate C++ for compiling CMAKE

I use MinGW64+msys on Winodws7 64bit
Now I’m trying to build CMAKE but I can’t.
When I typed ./configure soon an error happened. .
---------------------------------------------
CMake 3.2.3, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
I also find error messages in Bootstrap.cmk/cmake_bootstrap.log like bellow.
[First Message in the log file]
In file included from c:/mingw64/x86_64-w64-mingw32/include/c++/iosfwd:40:0,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/ios:38,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/ostream:38,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/iostream:39,^M
from cmake_bootstrap_4468_test.cxx:3:^M
c:/mingw64/x86_64-w64-mingw32/include/c++/bits/postypes.h:40:35: fatal error: cw
char: No such file or directory^M
compilation terminated.^M
[Second Message in the log file]
cmake_bootstrap_4468_test.cxx:5:23: fatal error: iostream.h: No such file or dir
ectory^M
compilation terminated.^M
Test failed to compile
They said cwchar and iostream.h doesn't exist, although I have them and set their path to environmental variable.
The first massage said my C++ compiler isn’t appropriate. I installed it by mingw-get.exe.
Does anyone know, how can I get appropriate C++ compiler?
You mixed two compilers. I recommend: delete your old one and install msys2+mingw64.

unknown attribute `extern_c` warning in C++

I’m building a Cocos2d-x game for Android on a Mac, using Android NDK, and I get many warnings like this when compiling the C++ part:
/usr/include/module.map:1662:22: warning: unknown attribute 'extern_c' [-Wignored-attributes]
Is it dangerous? How can I fix it?
I'm guessing that extern_c is a compiler directive for the module map saying it is referencing functions from C++ that were written in the C language (different call frame structure).
The LLVM portion of the CLANG compiler is probably having a version mismatch.
http://clang.llvm.org/docs/Modules.html#module-maps
Try a command line $ clang -v
You may have to verify the compiler library version
xcode->preferences->locations->command line tools.
Ultimately you will want to clear this up so your stack frames match the arguments and your not referencing a C language function.

apple clang and sse instructions form armv7 ( mobile processors )

I have problems cross compiling some c++ sources that contain sse instruction.
I manage to compile them for simulator (with no extra c++ flag), but for armv7 i get the following error:
#error "SSE instruction set not enabled"
( and following other errors such as:
... unknown type name '__m128'
)
I have looked into clang flags for a flag to activate sse instructions, but did not find
( the source file that i'm trying to compile is gdalgrid.cpp in project gdal,
http://fossies.org/dox/gdal-1.10.1/gdalgrid_8cpp_source.html
)
thx in advance
Similar problem; trying to compile 'make' an altcoin wallet application on ARM7 hardware, the gcc compiler bombs out with
/usr/share/gccxml-0.9/GCC/4.7/xmmintrin.h:32:3: error: #error "SSE instruction
set not enabled"
src/scrypt_mine.cpp: In function ‘void* scrypt_buffer_alloc()’:
src/scrypt_mine.cpp:66:19: error: ‘SCRYPT_BUFFER_SIZE’ was not declared in this scope
src/scrypt_mine.cpp: In function ‘void scrypt(const void*, size_t, uint32_t*, void*)’:
src/scrypt_mine.cpp:87:21: error: ‘scrypt_core’ was not declared in this scope
Makefile:1909: recipe for target 'build/scrypt_mine.o' failed
make: *** [build/scrypt_mine.o] Error 1
What I think is going on is that some implementations of scrypt got made to be so totally dependent on sse instructions on one brand of cpu that they won't compile for another.
Now the solution requires a better answer from the Litecoin people, as what I got to work is only applicable to bitcoin and other sha256d coins:
Ditch any scrypt based coins, as those are limited to a particular brand of cpu which does sse. Compile for sha256d based coins as those are more portable and wallets can work on ARM7 devices including raspberry pi.