Hi Marcel
Thanks for your response, It seems that my google search superpowers
are not in their best shape these days. I have been messing around for
a couple of days now with no good results (besides a terrible headache
:) .
Let me explain a bit better what do OpenEmbedded provides:
A folder with all the requirements to cross-build a binary under:
/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0/recipe-sysroot/
and
/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0/recipe-sysroot-native/
This includes EVERYTHING: cross-compiler, libraries, tools.... It also
sets the CC, CFLAGS et al variables:
CC=x86_64-poky-linux-gcc -m64 -march=btver1 -mtune=btver1
--sysroot=/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0/recipe-sysroot
CFLAGS= -O2 -pipe -g -feliminate-unused-debug-types
-fdebug-prefix-map=/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0=/usr/src/debug/bazel-cpp-tutorial/git-r0
-fdebug-prefix-map=/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0/recipe-sysroot-native=
-fdebug-prefix-map=/home/ricardo/curro/qt5022/build-qt5022-pyro/build/tmp/work/bobcat_64-poky-linux/bazel-cpp-tutorial/git-r0/recipe-sysroot=
it also modifies LD_PRELOAD to add some logic to detect host
cross-contaminations:
LD_PRELOAD=libpseudo.so
I have prepared (now manually, later automated) a CROSSTOOL file that
makes use of OE sysroot (attached). I have not been able to find
documentation for all the fields of that file, so I have done my best.
But apparently this is not enough. I also have to prepare a BUILD file
and wrappers for the binary (is this right?)
bazel --output_user_root=./bazel_out build --cpu=oe-target
--verbose_failures main/hello-world
WARNING: ignoring LD_PRELOAD in environment.
ERROR: No toolchain found for cpu 'oe-target'. Valid cpus are: [
k8,
armeabi-v7a,
x64_windows_msvc,
x64_windows_msys,
s390x,
ios_x86_64,
].
INFO: Elapsed time: 0.240s
All this seems like a lot of work for what it my head sounds much
more simple. Am I misunderstanding something? Cant there be a bazel
cpu that is just respect all the standard variables (CFLAGS, CC, CXX,
CXXFLAGS, LDFLAGS.....)?
Regards!
--
Ricardo Ribalda