Support cross-compiling to ppc
Hi,
I have a cross compiler powerpc64le-rhel7-linux-gnu-gcc.
How to cross-compile V source file by this cross compiler?
Thanks.
V doesn't (currently) support ppc, so you will need to do a 2-step process.
First, compile V to C:
v -o name.c name.v
Then, compile the C file as you normally would
powerpc64le-rhel7-linux-gnu-gcc -o name name.c
Or whatever your favorite options may be.
I would also recommend updating your OS to something more recent... rhel 9 has been our for several months.
But name.c depends on libgc.a .
Does it need to be built manually?
Will the V dev team plan to support this kind of cross-build scenario?
In general we'll need support from the community to be able to implement and maintain these kinds of lesser known targets. So if anyone reads this and is capable of fixing it, please chip in.
@harens & @barracuda156, would you be interested in collaborating with @likema on this due to your involvement also in PPC hardware?
@ylluminate From what I understand, ppc64le is substantially different from ppc and ppc64 on Darwin, but I am interested in the topic. Thank you for tagging me.
@ylluminate From what I understand,
ppc64leis substantially different fromppcandppc64on Darwin, but I am interested in the topic. Thank you for tagging me.
Yes, ppc64le is an architecture of Power 8/9 on Linux.
Not only ppc64le, but also loongarch64 cross-compile need to be supported.
I suggest something is similar with CMake toolchain file:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR ppc64le)
set(CMAKE_C_COMPILER powerpc64le-rhel7-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER powerpc64le-rhel7-linux-gnu-g++)
@likema By the way, why cross, why not build natively?
@likema By the way, why cross, why not build natively?
For saving cost
@likema By the way, why cross, why not build natively?
For saving cost
@likema But does it build natively? For ppc it does. ppc64 not sure.
By the way, I am interested to implement ppc64 support, if it is lacking. Primarily for BE, but LE should be easier in fact.
By the way, I am interested to implement
ppc64support, if it is lacking. Primarily for BE, but LE should be easier in fact.
Thanks.
I also have powerpc64-rhel6-linux-gnu-gcc , which is big endian.
All of my cross compilers are built on Linux x86_64 by crosstool-ng
V doesn't (currently) support ppc, so you will need to do a 2-step process.
@JalonSolov It actually builds on PPC systems (ppc32 at least): https://trac.macports.org/ticket/64913
Should have said - it doesn't currently support cross-compiling to ppc. If you can run it natively, it'll be fine... but the question was specifically about cross-compiling.