You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've read the meson's cross-compilation doc
very carefully and more than once, and I have
to say it doesn't explain a tiny bit. I'll try to
formulate questions, but I don't have a basic
understanding, so even that is challenging. :)
So I have a cross file with c = 'clang',
whereas the doc has c = 'x86_64-w64-mingw32-gcc'
as an example. While its quite clear what
happens with the documented mingw
example, clang needs passing the -target option to cross-compile
(-target means host in meson't notation).
And meson doesn't seem to pass this...
Does meson think that whatever I
put into a cross file, can be invoked
as-is, like is the case with mingw?
Speaking of "host", again, the doc
doesn't say how exactly meson evaluates
the host triplet. It just basically suggests
to hard-code some values and access
them from meson.build... Nice, but this
is what I am doing with plain makefiles
w/o any problems. I thought meson can
look up the host triplet for me by analysing
the host description in a toolchain file,
AND by looking up what binutils are
available for suitable cross-prefixes.
For example, I describe host as this:
[host_machine]
system = 'linux'
cpu_family = 'x86'
cpu = 'i386'
endian = 'little'
But there are huge variety of cross-prefixes
that can suit that: i686-linux-gnu, i386-linux-gnu,
x86_64-linux-gnu (in that case as will need --32
and ld will need specific -m for 32bits) and so on.
So I though meson can look up the suitable
binutils, and pass the appropriate -target
to clang (I am using c_ld = 'bfd' which is
why I supposed it would look for binutils),
but it doesn't do anything of that kind and
I don't see anything in the doc saying how
to ask him to do that.
Now, my project uses nasm, but, because
I also use cpp (c preprocessor), I had to
write ['nasm', 'c'] in the project description.
It seems otherwise I can't use preprocessor.
And this seems to be enough for meson to
use C compiler (clang in my case) for linking!
I suppose if the project would mention only
nasm, then meson would use the linker
directly, but since I need preprocessor,
meson uses clang... How can I tell him to
not use C compiler for linking, as my project
only uses cpp? Of course if I find the way
to tell meson to not use clang for linking,
then immediately I'll need to stop him from
using plain ld.bfd and find the suitable
cross-binutils...
Sorry for such a long posting.
Cross-compilation is a difficult subject,
but the existing doc makes it even more
difficult by explaining nothing but discussing
what is build-host-target in a great lengths...
But people know what is build-host-target.
People (me :) don't know how to use meson
for cross-compiling.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi guys.
I've read the meson's cross-compilation doc
very carefully and more than once, and I have
to say it doesn't explain a tiny bit. I'll try to
formulate questions, but I don't have a basic
understanding, so even that is challenging. :)
So I have a cross file with
c = 'clang'
,whereas the doc has
c = 'x86_64-w64-mingw32-gcc'
as an example. While its quite clear what
happens with the documented mingw
example, clang needs passing the
-target
option to cross-compile(
-target
means host in meson't notation).And meson doesn't seem to pass this...
Does meson think that whatever I
put into a cross file, can be invoked
as-is, like is the case with mingw?
Speaking of "host", again, the doc
doesn't say how exactly meson evaluates
the host triplet. It just basically suggests
to hard-code some values and access
them from meson.build... Nice, but this
is what I am doing with plain makefiles
w/o any problems. I thought meson can
look up the host triplet for me by analysing
the host description in a toolchain file,
AND by looking up what binutils are
available for suitable cross-prefixes.
For example, I describe host as this:
But there are huge variety of cross-prefixes
that can suit that: i686-linux-gnu, i386-linux-gnu,
x86_64-linux-gnu (in that case as will need --32
and ld will need specific -m for 32bits) and so on.
So I though meson can look up the suitable
binutils, and pass the appropriate
-target
to clang (I am using
c_ld = 'bfd'
which iswhy I supposed it would look for binutils),
but it doesn't do anything of that kind and
I don't see anything in the doc saying how
to ask him to do that.
Now, my project uses nasm, but, because
I also use cpp (c preprocessor), I had to
write
['nasm', 'c']
in the project description.It seems otherwise I can't use preprocessor.
And this seems to be enough for meson to
use C compiler (clang in my case) for linking!
I suppose if the project would mention only
nasm, then meson would use the linker
directly, but since I need preprocessor,
meson uses clang... How can I tell him to
not use C compiler for linking, as my project
only uses cpp? Of course if I find the way
to tell meson to not use clang for linking,
then immediately I'll need to stop him from
using plain
ld.bfd
and find the suitablecross-binutils...
Sorry for such a long posting.
Cross-compilation is a difficult subject,
but the existing doc makes it even more
difficult by explaining nothing but discussing
what is build-host-target in a great lengths...
But people know what is build-host-target.
People (me :) don't know how to use meson
for cross-compiling.
Beta Was this translation helpful? Give feedback.
All reactions