Here are notes about my crosscompiling experience.

As we cannot run arm binaries on i?86/x86_64 I skip the boot stage.
Generated files were taken from the native build directory. So, there
are no boot binaries, only master versions. This is related to both
android/ios.

CMake can use predefined set of rules (toolchain) for crosscompiling.
When toolchains for Android is powerful
(https://code.google.com/p/android-cmake/ ,
https://github.com/taka-no-me/android-cmake), the iOS toolchains is
not so great (https://code.google.com/p/ios-cmake/). The problem with
iOS toolchains is that Apple changes things in iOS/Xcode rather
frequently and users do not use cmake for them very often.

Android:
CMake toolchain - https://github.com/taka-no-me/android-cmake
I built all main binaries, libraries, plugins, examples for Android
(of course including fbclient, Engine12), architecture - arm v7
32-bit.
I did two small changes to build the code: http://pastebin.com/nBXD2Rq6
It seems Android NDK API (I used ANDROID_NATIVE_API_LEVEL=android-21)
does not have qsort_r, 3rd argument for open.
The changes may be a little incorrect, but for my tests, it was ok.

iOS:
I used following config: OS X 10.10.1, Xcode 6.1, iOS target version -
8.1, target arch - arm v7 32-bit, AppleClang 6.0, CMake toolchain -
https://code.google.com/p/ios-cmake/
List of initial source code changes: http://pastebin.com/rYMjgXdU
The line in src/remote/protocol.h "arch_arm = 7," uses the free value
in enum. As I said this is only for testing purposes.

For iPhone 6 simulator (i386) the error is:
duplicate symbol
__ZTIN8Firebird15InstanceControl12InstanceLinkINS_12InitInstanceIN12_GLOBAL__N_121DatabaseDirectoryListEEELNS0_12DtorPriorityE3EEE
in:
    
/Users/egor/dev/firebird_cmake/build_ios/src/Debug-iphonesimulator/libengine12_common.a(jrd.o)
    
/Users/egor/dev/firebird_cmake/build_ios/src/Debug-iphonesimulator/libcommon.a(db_alias.o)
duplicate symbol
__ZTSN8Firebird15InstanceControl12InstanceLinkINS_12InitInstanceIN12_GLOBAL__N_121DatabaseDirectoryListEEELNS0_12DtorPriorityE3EEE
in:
    
/Users/egor/dev/firebird_cmake/build_ios/src/Debug-iphonesimulator/libengine12_common.a(jrd.o)
    
/Users/egor/dev/firebird_cmake/build_ios/src/Debug-iphonesimulator/libcommon.a(db_alias.o)
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

For iOS 8.1 (arm v7) the error is:
The build currently stops on linking libfbclient.dylib:
Undefined symbols for architecture armv7:
  "_libiconv", referenced from:
      (anonymous namespace)::IConv::convert(Firebird::AbstractString&,
void*) in libcommon.a(isc_file.o)
  "_libiconv_open", referenced from:
      (anonymous namespace)::IConv::openIconv(char const*, char
const*) in libcommon.a(isc_file.o)
  "_libiconv_close", referenced from:
      (anonymous namespace)::IConv::closeIconv(void*) in libcommon.a(isc_file.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I did not investigate these errors really careful.
Also there were some issues with code signing. I turned it off during
test builds.

On 29 December 2014 at 13:14, Alex Peshkoff <peshk...@mail.ru> wrote:
> On 12/28/14 22:09, Egor Pugin wrote:
>
>> p.s. Alex asked here about crosscompiling with CMake.
>> I built Firebird on Windows using Android NDK for ARMv7 architecture.
>> iOS build starts but does not complete because of lack of some support in
>> Firebird sources (missing defines etc.).
>>
>
> That's nice. Does client (yvalve) build successfully?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
Egor Pugin

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to