Re: Linux emulation: Compiling with binary distributed libraries

2023-04-01 Thread Mayuresh
On Sat, Apr 01, 2023 at 08:17:36PM +0200, Martin Husemann wrote:
> Yes, and I'm not quite sure I understand the "how". It depends how you
> run the Vivado stuff, one easy way would be to use a chroot to a
> full Linux userland, and there it just would use the C compiler from that
> userland.
> 
> The other option is to have enough libs installed in the emul dir and use
> Vivado w/o chroot, then you could place the linux gcc wherever you like
> and just point at it (via $PATH or whatever mechanisms Vivado offers
> for configuration).

As far as running things not involving compilation is concerned, I have
just kept vivado installation under /opt/xilinx (outside /emul) and it
seems to work fine.

For usage involving compilation, unfortunately Vivado has hard coded the
path /usr/bin/gcc in some binary component. So chroot will be the option.

I have installed Void Linux on a qemu disk and installed gcc on it. Now
after switching off the VM, I have mounted the disk using vnconfig.

Now if I try to run the binaries e.g. /mnt/void/usr/bin/ls, it says No
such file or directory. I have even set /mnt/void/usr/lib (which soft
links to lib64) in LD_LIBRARY_PATH, but that doesn't seem to help.

Do I need to be mounting this somewhere under /emul/linux? (I think I have
tried even that, but that led to the same error.)

Basically, given I have a raw disk image of Void Linux mounted on NetBSD,
what is a good way to run things from its /usr/bin on NetBSD?

-- 
Mayuresh


Re: Linux emulation: Compiling with binary distributed libraries

2023-04-01 Thread Martin Husemann
On Sat, Apr 01, 2023 at 11:28:39PM +0530, Mayuresh wrote:
> Is it possible to use NetBSD's native compiler for this scenario (C
> sources and .so files that come with Vivado, meant for Linux)? (It doesn't
> work. I'll post errors if this is supposed to work.)

No (or at least it is probably the mostly complex possible solution).

> Alternatively, shall I be using even gcc's Linux version through Linux
> emulation? If yes, how?

Yes, and I'm not quite sure I understand the "how". It depends how you
run the Vivado stuff, one easy way would be to use a chroot to a
full Linux userland, and there it just would use the C compiler from that
userland.

The other option is to have enough libs installed in the emul dir and use
Vivado w/o chroot, then you could place the linux gcc wherever you like
and just point at it (via $PATH or whatever mechanisms Vivado offers
for configuration).

Martin



Linux emulation: Compiling with binary distributed libraries

2023-04-01 Thread Mayuresh
I am attempting to use Xilinx Vivado Linux version, distributed in binary
form, on NetBSD 9.2 amd64.

The product officially doesn't support more than a couple of widely used
Linux distros, but I find it working fine on Void Linux.

On NetBSD, through Linux emulation, I can get some of the tools in this
product (like verilog and vhdl compilers) working fine.

Now, when it comes to simulation, Vivado generates some C code that needs
to be compiled and linked with some of the libraries it provides which are
distributed in binary form.

Is it possible to use NetBSD's native compiler for this scenario (C
sources and .so files that come with Vivado, meant for Linux)? (It doesn't
work. I'll post errors if this is supposed to work.)

Alternatively, shall I be using even gcc's Linux version through Linux
emulation? If yes, how?

-- 
Mayuresh