On 13.08.2014 14:13, Arvind S Raj wrote:
On 13 August 2014 02:03, Arvind S Raj <sraj.arvind@xxxxxxxxx> wrote:Thanks for the info Ingo - the C++ source is being compiled successfully now! Currently, the build fails again when trying to build libroot.so because the object file of the newly added source file isn't present in the list(and hence several undefined references to atomic_get_and_set again). I ran the command in [1] and it succeeded and thus I've been trying to locate where to specify that this file using opengrok but haven't had much success. I ran jam with -dx but it seemed to be taking quite some time and unfortunately overwrote the earlier build logs I had(yes I probably should've saved it). The error was generated when the Link rule was called, which ran the command in [1] but without the generic_atomic.o in the list of objects. I'm calling it a day now; will continue later on. [1] http://paste.debian.net/plainh/25dfc9bI added generic_atomic.o to librootObjects in src/system/libroot/Jamfile to indicate the object file is required to create libroot.so(the grist <arm> gets added too) but jam complains it doesn't know how to make <arm>generic_atomic.o. Jam invokes the rule SharedLibrary, which invokes SharedLibraryFromObjects, which invokes LinkAgainst. In LinkAgainst, the object file is added to the NEEDLIBS for the so file. However, I couldn't figure out when or how the location of the object files in NEEDLIBS are discovered. Build output: http://paste.debian.net/hidden/c06d160c/.
Without seeing your actual changes, just from your description and the build output, I find it hard to comment. From your earlier mail I understand that you have added a generic_atomic.cpp in src/system/libroot/os/arch/generic/, which is supposed to replace the atomic.S code from src/system/libroot/os/arch/arm/.
The atomic functions are needed in libroot, the kernel, and the boot loader and need to be built for each of the three components individually. You want to replace the atomic.S in
src/system/libroot/os/arch/arm/Jamfile src/system/kernel/lib/arch/x86/Jamfile src/system/boot/JamfileThe latter is actually a bit tricky, because the Jamfile is not architecture dependent. It assumes that each architecture provides an atomic.S. You'll have to remove it there and add it to
src/system/boot/arch/<arch>/Jamfilefor all architectures <arch> instead. Save for ARM where you want to use generic_atomic.cpp, of course.
CU, Ingo