# [LiB] 32 + 64 Bit Libraries



## IgorGlock (Feb 27, 2010)

hello all!

I have new small problem with new gameserver... if I start elf error 

who can say me where can I download "libc.so / libc.so.5" and many other! :stud


----------



## fronclynne (Feb 27, 2010)

misc/compat5x for libc.so.5


----------



## DutchDaemon (Feb 27, 2010)

One doesn't "download libs" in FreeBSD. Indeed, it's in the compat5 port, so just install it; libc.so is always a symlink to the current libc.so.x, e.g. on FreeBSD 8:


```
lrwxr-xr-x  1 root  wheel  14 Feb 23 14:56 /usr/lib/libc.so -> /lib/libc.so.7
```


----------



## fronclynne (Feb 27, 2010)

Ja.  And depending on twat your game-server needs, you may have to install other compat ports.  Once you know the names of the files you need try grep(1)ping the names like 
	
	



```
> grep "libc.so.5" /usr/ports/misc/compat?x/*
/usr/ports/misc/compat5x/Makefile:# NOTE: libc.so.5 is built with _PATH_LOCALE defined to
/usr/ports/misc/compat5x/pkg-plist:@unexec chflags noschg %D/lib/compat/libc.so.5
/usr/ports/misc/compat5x/pkg-plist:lib/compat/libc.so.5
/usr/ports/misc/compat5x/pkg-plist:%%AMD64%%lib32/compat/libc.so.5
```

(The "libc.so.5" is enclosed in quotes because the period seems to be expanded by the shell, or something.  I'm very confused by regex, honestly: it's like palindromatic Finnish by someone with a severe rhotacism.)


----------



## IgorGlock (Feb 27, 2010)

Problem... To install the port: cd /usr/ports/misc/compat5x/ && make install clean = 32Bit only
To add the package: pkg_add -r compat5x-amd64 = doesn't work eny more witch FreeBSD 7.2


----------



## DutchDaemon (Feb 27, 2010)

```
ONLY_FOR_ARCHS= alpha [B]amd64[/B] i386 sparc64
```


```
/usr/ports/misc/compat5x]# make
=> compat5x-[B]amd64[/B]-5.4.0.8.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/lesi/compat5x/.
compat5x-[B]amd64[/B]-5.4.0.8.tar.bz2                100% of 5717 kB  202 kBps 00m00s
===>  Extracting for compat5x-[B]amd64[/B]-5.4.0.8_11
=> MD5 Checksum OK for compat5x-[B]amd64[/B]-5.4.0.8.tar.bz2.
=> SHA256 Checksum OK for compat5x-[B]amd64[/B]-5.4.0.8.tar.bz2.
===>  Patching for compat5x-[B]amd64[/B]-5.4.0.8_11
===>  Configuring for compat5x-[B]amd64[/B]-5.4.0.8_11
(done)
```


```
# pkg_add -r compat5x-[B]amd64[/B]
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/[B]amd64[/B]/packages-8-stable/Latest/compat5x-[B]amd64[/B].tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/[B]amd64[/B]/packages-8-stable/All/localedata-5.4.tbz... Done.

*******************************************************************************
*                                                                             *
* Do not forget to add COMPAT_FREEBSD5 into                                   *
* your kernel configuration (enabled by default).                             *
*                                                                             *
* To configure and recompile your kernel see:                                 *
* http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html *
*                                                                             *
*******************************************************************************
```

It's also available for 7.2:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-7.2-release/misc/compat5x-amd64-5.4.0.8_9.tbz

What are you on about?


----------



## IgorGlock (Feb 27, 2010)

```
# pkg_add -r compat5x-amd64
Error: FTP Unable to get [url]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/compat5x-amd64.tbz:[/url] File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/compat5x-amd64.tbz' by URL
#
```


----------



## DutchDaemon (Feb 28, 2010)

IgorGlock said:
			
		

> pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/*i386*/packages-7.2-release/Latest/compat5x-*amd64*.tbz' by URL
> #



Well, duh ...

Are you on 32-bit or 64-bit yourself? Trying to install a 64-bit package on a 32-bit system will not work .. In that case you'll probably need compat5x-i386 ...


----------



## IgorGlock (Mar 1, 2010)

and what is about 
libc_r.so.# + libm.so.# + libstdc++.so.# + libz.so.# 32Bit + 64Bit ... :r I can't find that for BSD ... I can find only for Fedora+OpenSuse :stud


----------



## DutchDaemon (Mar 1, 2010)

Again: one doesn't just "download libs" in FreeBSD. Libs are part of the base system, or installed by ports that need them. You're working on an OS, not Lego. If you don't have the proper libs, you have the wrong ports, the wrong compat layer(s), or a damaged base system.


----------



## fronclynne (Mar 1, 2010)

IgorGlock said:
			
		

> and what is about
> libc_r.so.# + libm.so.# + libstdc++.so.# + libz.so.# 32Bit + 64Bit ... :r I can't find that for BSD ... I can find only for Fedora+OpenSuse :stud



Since none of us are psychic (I assume): You need to be a little more clear about 
what it is you are trying to run
what you are trying to run it on ([cmd=""]uname -a[/cmd] is a good start)
what error messages you are getting


----------



## DutchDaemon (Mar 1, 2010)

On FreeBSD 8 / amd64


```
libc_r.so.# built by [FILE]/usr/src/lib/libc_r[/FILE] (don't have it installed, probably depending on some kernel option) (base system)
libm.so.# ==  /usr/lib/libm.so -> /lib/libm.so.5 (base system)
libstdc++.so.# == /usr/lib/libstdc++.so -> /usr/lib/libstdc++.so.6 (base system)
libz.so.# == /usr/lib/libz.so -> /lib/libz.so.5 (base system)
```

Most or all of these should also show up in e.g. [cmd=]ldconfig -r | grep libm.so[/cmd], [cmd=]ldconfig -r | grep libstdc++.so[/cmd], etc.


----------



## narendra1310 (Jul 16, 2010)

*Unable to run Freebsd7 32bit EXE on  Freebsd7 64bit machine*

Hi all,

I have faced the below error message when running 32bit exe (build on freebsd7 32bit machine)   on 64bit freebsd machine.

`freebsd7bit64img# ./bin/MyTestExe`

```
/libexec/ld-elf.so.1: Shared object "libc_r.so.6" not found, required by "MyTestExe"
```
Then i have executed ldd command for it, result of the command is shown below. 

`freebsd7bit64img# ldd ./bin/MyTestExe`

```
ldd: ./bin/MyTestExe: can't read program header
ldd: ./bin/MyTestExe: not a dynamic executable
```

Then i have executed locate command for it, result of the command is shown below.

`freebsd7bit64img# locate libc_r.so`

```
/usr/home/test/libc_r.so.6
/usr/home/test/mathu/libc_r.so.6
/usr/lib/libc_r.so
/usr/lib/libc_r.so.7
/usr/lib32/libc_r.so.5
/usr/src/lib/libc_r/libc_r.so
/usr/src/lib/libc_r/libc_r.so.7
```

How to resolve this issue. why ldd command shows like that. what is the solution for this ??

Please help me...

Thanks in advance


----------



## fronclynne (Jul 16, 2010)

It looks like you need to install misc/compat6x.  That should give you a /usr/local/lib32/compat/libc_r.so.6.

If not, you'll probably have to manually download the i386 compat 6.x package and extract the libc_r.so.6 file and manually copy it to where you need it and rehash your shared lib directories via (something like) `# ldconfig -32 -elf -m /path/to/new/lib/` (note that this may not actually work for various reasons).


----------



## narendra1310 (Jul 17, 2010)

*/libexec/ld-elf.so.1: ./bin/MyTextExe: Undefined symbol "__h_error"*

Hi, 

After installing compat6x. I run my exe , but still it is throwing some error shown below.


```
/libexec/ld-elf.so.1: ./bin/MyTextExe: Undefined symbol "__h_error"
```

[cmd=]freebsd7bit64img# locate libc_r.so.6[/cmd]

```
/usr/home/test/libc_r.so.6
/usr/home/test/mathu/libc_r.so.6
/usr/lib/libc_r.so.6
/usr/local/lib/compat/libc_r.so.6
/usr/local/lib32/compat/libc_r.so.6
/usr/ports/misc/compat6x/work/compat6x-amd64-6.3.602114.200711/lib/libc_r.so.6
/usr/ports/misc/compat6x/work/compat6x-amd64-6.3.602114.200711/lib32/libc_r.so.6
```

Please help me regarding.......


----------



## DutchDaemon (Jul 17, 2010)

Have you tried adding /usr/home/test/ to your lib path with ldconfig(8) -m ?


----------



## narendra1310 (Jul 19, 2010)

No use.


```
freebsd7bit64img# ldconfig -32 -elf -m /usr/home/test/
ldconfig: /usr/home/test/: ignoring directory not owned by root
```

The library 'libc_r.so.6' located at /usr/home/test/ is manually copied from 32bit Freebsd7 machine.


```
freebsd7bit64img# ./bin/MyTestExe
/libexec/ld-elf.so.1: ./bin/StoreGrid: Undefined symbol "__h_error"
```
 
My guess is that the above error is due to some headers missing or some devel packages dependencies to be install. It mean that exe is looking for a proper library, but the exe or library 'libc_r.so.6' in-turn depends on other libs which are missing in the system or due tp path problem.

Please reflect on it....


----------

