# MultiArch?



## fredvs (Jul 16, 2015)

Hello.

Is it possible to have MultiArch in FreeBSD 64 ?
If yes, what must be installed ?

Thanks.

Fre;D


----------



## protocelt (Jul 16, 2015)

Are you asking if you can run 32bit applications on a 64bit FreeBSD system? If so, yes you can. Select the lib32 option from the installer when installing FreeBSD.


----------



## fredvs (Jul 16, 2015)

Yep, perfect. Hum, where/when can iI find lib32 option from the installer ?
Many thanks.


----------



## fredvs (Jul 16, 2015)

Re-hello.
Is it possible enable lib32 option when fFreeBSD 64 is already installed ?
Thanks.


----------



## protocelt (Jul 16, 2015)

Sure. Which version of FreeBSD do you have installed?

Edit: You can fetch and install it from the command line.

`fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/[B]10.1[/B]-RELEASE/lib32.txz`

`# tar -xvpJf lib32.txz -C /`
If you're using another supported release version just change *10.1* to that release number.


----------



## fredvs (Jul 17, 2015)

Hello and thanks for answer.

I have install FreeBSD 64 +
`fetch [URL]ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/[/URL][B]10.1[/B]-RELEASE/lib32.txz`
`tar -xvpJf lib32.txz -C /`

=> perfect and out of the box. 
	

	
	
		
		

		
			





Before that I have compiled/tested a hyper simple GUI application on FreeBSD 32.

Sadly, when I try to run it on FreeBSD 64 =>

```
Shared object "libX11.so.6" not found, required by "simple_test".
```

Huh, could it be possible that FreeBSD does the same than Linux Mint and Fedora that are real multiarch os?

With Mint64 and Fedora64 you may run all 32 bit applications...

Does FreeBSD have plan to became a real multiarch os ?

Many thanks.

Fre;D


----------



## kpa (Jul 17, 2015)

The trouble is that you'd have to cross-compile the X11 libraries for i386 and have them installed somehow alongside the amd64 versions on the same system. This is not supported at the moment, the 32-bit compatibility libraries cover only the base system. You could create an i386 jail and use that for compiling and running i386 software, that shouldn't be too hard.


----------



## fredvs (Jul 17, 2015)

kpa => many thanks for clarification.



kpa said:


> You could create an i386 jail and use that for compiling and running i386 software, that shouldn't be too hard.



Not sure I understood...
"create an i386 jail"?  Huh, do you mean create a i386 directory with all the needed 32 bit libraries?

But how will FreeBSD know what libraries to use (32 or 64 bit)? Adding a path with LD_LIBRARY_PATH=?

Thanks.

Fre;D


----------



## kpa (Jul 17, 2015)

A jail(8) is lightweight chroot(8) like environment with a full installation of the OS inside it. Start with the handbook section on jails:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html

The idea would be to put all 32-bit i386 programs you need to run inside the i386 jail, the jail would be almost identical to a real FreeBSD i386 installation with some differences that are not significant enough to prevent the programs from working.


----------



## fredvs (Jul 17, 2015)

kpa => excellent and many thanks.

OK, I will study it (and write you later).

Fre;D


----------



## fredvs (Jul 20, 2015)

Hello.

Thanks for your light.
After lot of thinking, i decide to create a new fFreeBSD distro, that will be real MultiArch 64/32 OS and focused on cross-compiling development.
That distro will include all the tools for developers (C, Java, Python and Pascal).

https://github.com/fredvs/polydev

PS: Actually, polYdev is only a fork from FreeBSD 10.1.

Advices are hypra welcome.

Fre;D


----------

