Is there a third-party builder besides LLVM and LLVM-GCC? - iphone

I wish to build a lib (written in C language) with a thrid-party builder(not LLVM or GCC), and use it in my Xcode project. The lib itself can indeed be compiled with LLVM or GCC, but my manager wants to know whether it can be compiled by other compilers because he want to get a best performance.
PS: I used the ARM compiler (armcc 5.01 Build 94, in ARM DS-5 IDE) and also Keil uVision 4.54 on my machine. The compilers work well on compiling but their generation cannot be used as a lib for Xcode, for the formating of their compiled object are not correct, and I cannot figure out how to compile and run this binary on iOS.

Related

Vala: Compile for a lower GTK version

My PC is running Ubuntu 17.10 and has GTK+ 3.22.
When compiled from this environment the binaries cannot be run under Ubuntu 16.04 since the only GTK+ 3.18 is compatible with Ubuntu 16.04. How do I compile for a lower GTK runtime level?
The other way around should work though.
Compile the binary on the older OS version and it should work fine on the newer one.
The usual solution is to not provide binaries at all, but let the users and the distribution developers / packagers deal with the problem.
Just make sure your app is easy to compile, which means use standard build system tools like mesonbuild and add some build instruction in a README.md file.
It depends what are your real dependencies on the GTK+ API.
Each function has at the end of its documentation a Since: field that tells on which version of GTK+ it first appeared. Both of your target versions are GTK+ 3, so they are ABI-compatible. So you just need to check which symbols are not found when you run your binaries compiled for 3.22 on your 3.18. Every symbol that isn't found has been added after 3.18. Every symbol with Since: > 3.18 can't be used, you need to use the smallest common denominator. Once the symbols > 3.18 are identified, you have 2 choices:
either you do it the 3.18 way, and change your code to use no symbol introduced after 3.18. This means you might have to use deprecated symbols, but they will be there until the next API break (ie. GTK+ 4).
or try to get the latest features from both versions, using something like:
.
#if GTK_CHECK_VERSION(3, 20, 0)
// Do it the GTK+ >= 3.20 way
#else
// Do it the GTK 3.18 way
// (and ensure you have checks in your configure.ac or similar to make
// sure configuration breaks if trying to build with a GTK+ < 3.18)
#endif

shared library issues while migrating from CodeSourcery armel to Linaro armhf compiler

I am migrating a Xilinx Zynq board from from the CodeSourcery armel (gnueabi) toolchain (from Vivado 2015.2) to a Linaro armhf, so we could instal Debian/Ubuntu armhf (gnueabihf).
While attempting to dlopen() and dlsym() a shared library, we get the next error from dlerror():
/.../controller.so: undefined symbol: _ZTVN10__cxxabiv119__pointer_type_infoE
The issue is present if the Linaro toolchain is used while software compiled with the CodeSourcery toolchain works properly.
I checked both libraries for the reported symbol and it is present in both:
$ grep -r cxxabiv119__pointer_type_info .
./controller.so.armel.simbols:U _ZTVN10__cxxabiv119__pointer_type_infoE
./controller.so.armhf.simbols:U _ZTVN10__cxxabiv119__pointer_type_infoE
It seems that if controller.so contains only C code (no C++ code) it works properry with Linaro. But the difference might be something else than the language used.
Regards,
Iztok Jeras
There was no simple answer to this problem, in the end I switched from cross compiling to a native compiler inside a QEMU emulated ARM environment. This was suggested by various Raspberry PI users. On the other hand every cross compiler solution just unearthed a new set of problems.

Using clang++ for code analysis in an Autotools project in Eclipse

I am using Eclipse 4.2 on Mac OS 10.8, with the command line tools (Xcode 4.6.3) installed. The clang compiler supports C++11 by means of using the following flags: -std=c++11 -stdlib=libc++.
I have an Autotools-managed project in Eclipse. Real compilation works as expected after overriding CXX and CXXFLAFGS environment variables when configure is called. However, the static code analysis in Eclipse continues to use GCC (the version installed with Xcode is GCC 4.2), so there is no support for C++11, and lots of lines display errors that are not real ones, making static code analysis almost useless.
Using homebrew I also installed GCC 4.7, but I have not succeeded to make Eclipse use that version (or clang++) for performing static code analysis.
Is it possible, when using an Autotools-managed project, to make Eclipse use a different compiler for the static code analysis? Where should I specify that?
After installing Xcode 5, and following the directions in this question, I managed to solve the problem (I cannot test anymore whether this applies to Xcode 4.6 too).
The solution is to go to Project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT GCC Built-in Compiler Settings, and in Command to get compiler specs: append -std=c++11 -stdlib=libc++.
After doing that change, the line should look like:
${COMMAND} -E -P -v -dD ${INPUTS} -std=c++11 -stdlib=libc++

Arm-angstrom gcc compiler skips openCV libs

I'm cross-compiling my first program with OpenCV on the BeagleBone.
I use Eclipse Juno IDE, arm-angstrom-linux-gnueabi-gcc compiler and the last OpenCV library.
I've successfully built program with OpenCV on my PC, I've successfully cross-compiled "Hello Wolrd" onto my BB, then I've tried to cross-compile OpenCV on BB.
I just linked OpenCV libraries (opencv_highgui, without changing my "hello world" code) and after compiling got the following errors:
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libopencv_highgui.so when searching for -lopencv_highgui
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libopencv_highgui.a when searching for -lopencv_highgui
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lopencv_highgui
Arm compiler ignores this lib, and I don't know why.
How can I fix this problem?

Compiling external C++ library (Octave) for iPhone (Fortran compiler missing?)

A friend of mine asked me if it would be possible to port the Octave project to the iPhone. I haven't compiled an external package for an iPhone project before, so I downloaded the source code, and then used some scripts found on a couple of different Web sites (one, two) to try and build the libraries. However, when I try either of these scripts (which are nearly identical), they eventually die during the configure phase with the following error output:
[...snip checks...]
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking how to get verbose linking output from ... configure: WARNING: compilation failed
checking for Fortran 77 libraries of ... rm: conftest.dSYM: is a directory
checking for dummy main to link with Fortran 77 libraries... rm: conftest.dSYM: is a directory
none
checking for Fortran 77 name-mangling scheme... configure: error: cannot compile a simple Fortran program
See `config.log' for more details.
Is the problem that the iPhone SDK/Xcode doesn't include a Fortran cross-compiler, or am I doing something wrong?
The iPhone SDK does not include a FORTRAN compiler. Apple's last FORTRAN product was for the Apple ][, although 3rd party and/or open source compilers have existed for most systems Apple has built.
You could configure and build gfortran, but it's going to be a PITA. You'll likely need to merge in changes from Apple's customized GCC 4.2 fork found under iPhone here with a recipe for building it for Darwin, such as this.
You might try f2c as the Octave project suggests.