Open codewithpassion opened 9 months ago
Hi @codewithpassion
Thanks very much for your question.
As you describe it, it seems this would be mostly a sdl
recipe issue than a Conan issue. If Conan can cross-compile and works for other recipes and packages, then it is very likely that there is some limitation in the sdl2
recipe that disallows or difficults the cross-compilation.
This kind of issue is a bit challenging to solve, it requires some mastery in the specifics of the project build, in this case sdl2, which might not be straightforward.
The error is about -m64
flag:
aarch64-oe4t-linux-gcc: error: unrecognized command-line option ‘-m64’
But I am checking and it seems that this flag is not being injected by Conan. So this might be something hardcoded in the sdl
CMakeLists scripts
Have you tried latest 2.28.5? That might contain fixes for the architecture
So this might be something hardcoded in the sdl CMakeLists scripts
There is no -m64
hardcoded in any file of sdl 2.26.1 (except in config.guess
not used at all in sdl recipe since recipe relies on upstream CMakeLists).
Hi @memsharded AND @SpaceIm
Thanks for your answerS.
I have tried 2.28.5
with the same result.
I do have a little bit more insight since yesterday.
If I run conan first without -pr:b default -pr:h armv8
, so it's compiling for the default profile first, the subsequent run works.
In addition, what I forgot to mention yesterday, as this is in a yocto cross compiler environment, I had run an script that sets environment variables. Including CC, CXX, and others.
I think what happens is, when trying to build SDL as for ARM, somehow it's getting first compiled for X86, which fails because CC/CXX is set.
The additional flags like -m64
seems to come from the environment.
I'm trying to move the contents from the environment setup file into the profile at the moment.
What is your question?
I'm trying to cross compile an application in a Yocto SDK environment. I can cross compile executables and dependent conan packages, so the general setup is working.
My Conan version is: 2.0.14
Now, I tried to add
sdl/2.26.1
and things are breaking.here are my profiles:
What happens, I think, is that
sdl
is creating it's own toolchain file, without respecting neither theuser_toolchain
nor the built/target architectures. Which causes the generated package references to be wrong. I canconan install
the dependencies, likeexpat
, but if I'm trying to installsdl
it still want's to compile dependencies like theexpat
one that I just compiled/installed again as the reference now is different, presumable because the arch is not passed properly.I'm using this command to install
sdl
:The error is:
Did anyone come across this?
Thanks Dom
Have you read the CONTRIBUTING guide?