I'm working on a project focusing on the MIPS32 arch (little endian). The vendor gave me a GNU toolchain to compile my project targeting their embedded Linux version and everything works just fine. It's a GCC+Linux+uClibc toolchain.
However, recently I've needed to add some features to my uClibc build, so I've tried to replicate the vendor's toolchain in my own box.
Everything worked fine with the help of crosstool-ng, but when I try to compile my project, I get strange linker warnings all over the place:
warning: linking abicalls files with non-abicalls files
From what I researched, these are pretty serious warnings. Analyzing my object files with readelf will give me almost identical output. There are no .abicall section anywhere in those files. This holds true for both my project's object files to my toolchain's ones.
What could be wrong here? I don't even know where to start debugging this.
Related
The issue is about linking x86_64 macOS executables statically against libavcodec, libavdevice, etc, which have some object files built against freestanding as they use YASM which isn't able to embed the macOS "tag" in the binary (see Building for macOS, but linking in object file built for free standing for detailed information on that issue).
Everything works fine under Xcode 11.6 - the following messages are here, but they are warnings.
With the Xcode 12 update they become an error.
How to make them warnings again ? I could not find anything relevant in the ld man page.
ld: in ffmpeg/lib/libavcodec.a(aacencdsp.o), building for macOS, but linking in object file built for free standing, for architecture x86_64
There is no option I have found to revert the error to a warning. Apple has been warning us about this issue for a few releases of XCode now and the warning has become an error.
Until NASM is modified, or we can use some other assembler, the only option that allows me to build and link against the libav libraries in my application is to disable assembly when compiling ffmpeg.
./configure --disable-asm
This works my my case, as the performance of the non-assembly code path is acceptable in my desktop authoring tool. The server-based renderer still uses the assembly code path as it is linux based.
You may have to configure any libaries that you are including in your ffmpeg build to also disable assembly.
Once again, this is an acceptable solution for my case, as the non-assembly code paths are fast enough for my use case.
I am building Go code that uses CGo heavily and this code must be compiled into a shared or static library (static is highly preferred). (code for reference)
It all works just fine on Linux and Mac, but on Windows it fails on linker stage either saying that all 4 modes (c-shared, shared, c-archive, archive) are not available or if invoke go tool link -shared manually complains about missing windows specific instructions.
My understanding is that all I need to build usable lib.a is to compile everything I will use into object files (*.o) and then put it through ar to produce usable static library.
Now the question is whether I can completely skip Go's linker and based on prepared .o files create .a manually?
How would I go about doing that if that is even possible?
Looks like gcc on windows is unable to automatically discover necessary shared libraries. The problem was caused by GCC and not by Go.
Although for compiling Go I had to use self-compiled master tip as current release (1.6.2) does not support shared/static libraries on windows/amd64.
Manually feeding gcc with each shared library (ntdll, winmm etc) in default location (C:\Windows\SysWOW64) has fixed the problem.
First, some background: I'm attempting to write drivers and applications for Android on the Beagleboard-xM.
I've downloaded their android development kit, installed it, and can succesfully build everything in it using the directions at http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.0_DevelopersGuide
I've been able to make my own skeleton kernel module following the steps in http://tldp.org/LDP/lkmpg/2.6/lkmpg.pdf without issues. I can copy the .ko file to the android device, insmod, rmmod, etc.
I got tired of the basic shell given by the default build and thought I'd add busybox. I tried following the directions at http://omappedia.org/wiki/Android_Installing_Busybox_Command_Line_Tools, but I get a compile error on standard libc header files.
After digging around quite a bit, I've determined that the pre-built cross compiler provided in the TI android development kit wasn't searching the right paths.
I confirmed this by creating my own .c file that included and tried to compile it with
arm-eabi-gcc blah.c -o blah
and was met with the same results (unable to find the header file in question)
'arm-eabi-gcc -print-prog-name=cc1' -v gives me this:
ignoring nonexistent directory
"/usr/local/google/home/android/cupcake_rel_root/usr/local/include"
ignoring nonexistent directory "/usr/local/lib/gcc/arm-eabi/4.4.3/include"
ignoring nonexistent directory "/usr/local/lib/gcc/arm-eabi/4.4.3/include-fixed"
ignoring nonexistent directory "/usr/local/lib/../arm-eabi/include"
ignoring nonexistent directory "/usr/local/google/home/android/cupcake_rel_root/usr/include"
None of these paths ever existed on my fresh install of ubuntu 10.04. My cross compiler I used is at /usr/TI-Android/prebuilt/linux-86/toolchain/arm-eabi-4.4.3/. I didn't do anything except run the bit .bin file that was the android development kit (which seemed more like simply extracting itself from the .bin file; I don't remember it doing anything else)
So, a few questions:
how the heck did everything else (i.e. android, x-loader, u-boot, the kernel) build by just putting the bin of the cross compile tool into $PATH (like the how-to documents say). I assume it (make menuconfig?) does some magic in fixing up the include paths based on the location of the executable, but...
Why doesn't busybox work the same way since it seems to be built with a similar looking infrastructure?
How do I make it so I can cross compile my own applications?
I assume I've missed a step and should have done some sort of install/configure on the pre-built cross compiler, but information is horribly scant. I appeal to you, open source gods, to point my way across this dark and stormy sea.
For posterity, it seems that the prebuilt tools included with the android development kit are only enough to build the kernel and don't include libc or other library header files. (The NDK tools are 'different' and the build environment is even more different because it has its own version of libc--bionic. That build environment might have been able to build what I wanted, but I would have had to muck with Androidy makefiles, etc.)
I ended up having to get Code Sourcery arm-none-linux-gnueabi (must get the linux-gnueabi one to have the linux system header files needed), and everything worked reasonably smoothly after that.
I'm trying to build a project (namely, Angband's source - http://rephial.org/downloads/3.3/angband-v3.3.2.tar.gz) with Emscripten's emcc in order to port it to Javascript and ultimately build an online version.
I've managed to get the process started with
emconfigure ./configure
make
which begins to successfully start generating LLVM bitcode .o files, but then it hangs up on main-gcu.c with 'main-gcu.c:43:11: fatal error: 'ncurses.h' file not found'
I believe main-gcu.c is the only file that references ncurses, but I just can't figure out how to include the library while compiling. Is there a way to specify including ncurses with 'make', or should I compile the main-gcu.c file individually, with 'emcc main-gcu.c -c -lncurses'? I tried doing that but that led to another error with emcc being unable to find other actually included header files two levels down (it couldn't find headers that were included by a header included by main-gcu.c - anyway to fix that?).
I'm also not certain if I have/need to install the ncurses library on Mac OSX. All I can really find are references to libncurses5-dev for Linux.
Thanks!
I think you misunderstand the compilation via Emscripten. I will try to point out a few problems you are facing.
The general rule is that all tools of Emscripten ONLY can turn LLVM formats (e.g. BITCODE) into JavaScript. emconfigure, emmake, ... modify the build environment so that your sourcecode is compiled to one of the LLVM formats (there are exceptions to the rule but nevermind). So anything you want to link against your final result has to be in a LLVM format, as well (which by default ncurses is not).
Since the output is JavaScript, there is no chance to execute any program code in different threads. While a lot of C/C++ code does use a thread for the UI and others for processing, such a model does NOT work for Emscripten. So in order to get the software compiling/running you will have to rewrite the parts that use threading. See emscripten_set_main_loop for pointers.
Even if you have the libraries compiled you then have to statically link them to Emscripten. At this point it is less of a technical problem but more of a license issue since if your library is licensed under e.g. LGPL due to static linking the GPL terms are effective.
I hope all clarity finally vanished ;)
on windows, via codelite (compiler gcc), I wrote a simple program and wanted to build it into a dll.
After I built the project, no dll came out.
Then I ported the program to dev-c++, built it, dll came out successfully.
why codelite didn't work?
Because I chose gcc?
If anyone else is having issues with creating/linking libraries with CodeLite on Windows, ensure that the output filename does not contain the .so extension. By default, CodeLite on Windows uses the Unix shared object (.so) extension, so change it to dynamically linked library (.dll) in you project options.
<_<
Spent a very annoying three hours playing with configurations and puling my hair out as to why the linker (ld) could not find my compiled libraries. Time for some much needed sleep...zzzz
CodeLite use gcc/g++ as its compiler.
probably, its gcc/g++ compiler won't work as you expect on your winOS.
use MingW or Cygwin, they will work as you expected if you stick to gcc/g++.