Wrong extension when cross-compiling a shared library
I have a multi-platform library declared in buck that can be compiled for iOS, Android and OSX. The build process is hosted on an OSX machine and compiles fine for the mentioned platforms. I built an Ubuntu 16.04 x86_64 toolchain using crosstool-ng. I was able to use it with the following .buckconfig configuration.
[cxx#crossubuntu]
cpp = /Volumes/Untitled/x-tool/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-gcc
cc = /Volumes/Untitled/x-tool/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-gcc
cxxpp = /Volumes/Untitled/x-tool/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-g++
cxx = /Volumes/Untitled/x-tool/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-g++
ld = /Volumes/Untitled/x-tool/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-g++
linker_platform = GNU
default_platform = linux-x86_64
Then calling buck build //src/mylib:mylib#crossubuntu,shared
The resulting library is a valid ELF file but the filename is terminated with ".dylib". I can simply add a genrule to rename it but it would be nice to have a .so generated instead since I declared the default_platform
to be linux-x86_64
.
Another strange thing is that if instead of the crossubuntu
flavor I use linux-x86_64
, it does not work.
[cxx#linux-x86_64]
cpp = ...
...
default_platform = linux-x86_64
buck build //src/mylib:mylib#linux-x86_64,shared
fails because it is not able to find the linux-x86_64
platform...