# Finding which version of FreeBSD a port is compiled on



## erikf154 (Jan 13, 2010)

Is there a way of finding which version of freebsd (i.e. 7.2, 8.0 etc) a port package (.tbz) is compiled for/on?


----------



## SirDice (Jan 13, 2010)

You can try using *ldd*. Unpack the tgz and use it on the executables. Then have a look at the libc version.


----------



## erikf154 (Jan 13, 2010)

Thanks, but is there any easier way?


----------



## DutchDaemon (Jan 13, 2010)

Have someone else do it for you? It's not like this is difficult  Though libc will only give you the major version of FreeBSD, not the minor version. You can also compare the size of the .tbz against the package repositories on ftp.freebsd.org.


----------



## crsd (Jan 13, 2010)

Try running [cmd=""]file[/cmd] on executables from the package, like:

```
# tar xf irssi-devel.tbz bin/irssi
# file bin/irssi
bin/irssi: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
dynamically linked (uses shared libs), for FreeBSD 8.0 (800107), stripped
```


----------



## lme@ (Jan 13, 2010)

DutchDaemon said:
			
		

> Have someone else do it for you? It's not like this is difficult  Though libc will only give you the major version of FreeBSD, not the minor version.



Which normally shouldn't matter because of the ABI stability in a major branch.


----------



## DutchDaemon (Jan 13, 2010)

Sure, but the question of the OP does mention a minor version specifically, and you can't get that using this method. The file method will probably surrender that information.


----------



## billgates (Jan 26, 2010)

crsd said:
			
		

> ```
> # file bin/irssi
> bin/irssi: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
> dynamically linked (uses shared libs), for FreeBSD 8.0 (800107), stripped
> ```



Can someone explain what each of the things between comas mean?


----------



## tkjacobsen (Jan 26, 2010)

"man 1 file" gives a pretty good explanation.

but in short:
ELF 32-bit LSB executable, it's a 32 bit ELF binary
Intel 80386, it's compiled for i386
version 1 (FreeBSD), elf version 1 on freebsd 
dynamically linked (uses shared libs), the file is dynamically linked!
for FreeBSD 8.0 (800107), compiled for freebsd 8.0 
stripped, debugging symbols have been stripped out of the file.


----------



## phoenix (Jan 27, 2010)

The important bits are the *32-bit*, *Intel 80386*, and *for FreeBSD 8.0*.  Those three (actually really only the first and last are important) bits tell you it's a 32-bit FreeBSD 8.0 binary.


----------



## billgates (Jan 27, 2010)

FreeBSD 800107, what is 0107 ?
What does LSB stand for?


----------



## SirDice (Jan 27, 2010)

billgates said:
			
		

> What does LSB stand for?


IIRC it's Least Significant Byte and it's an indication of the endianness of the architecture. 

http://en.wikipedia.org/wiki/Endian


----------



## tangram (Jan 27, 2010)

billgates said:
			
		

> FreeBSD 800107, what is 0107 ?


That'a a _FreeBSD_version value. More at
Porter's Handbook Chapter 12.5 __FreeBSD_version values.

```
800107 	August 2, 2009 	8.0-CURRENT after making the newbus subsystem Giant free by adding the newbus sxlock and 8.0-RELEASE.
```


----------



## beeskpeck (Jun 6, 2012)

SirDice said:
			
		

> IIRC it's Least Significant Byte and it's an indication of the endianness of the architecture.
> 
> http://en.wikipedia.org/wiki/Endian





Nope, LSB stands for Linux Standard Base.

http://en.wikipedia.org/wiki/Linux_Standard_Base


----------



## kpa (Jun 6, 2012)

Except that in this case it does stand for Least Significant Byte first machine architecture, for comparison here is the same output for a FreeBSD 9.0 PowerPC binary of net/mtr-nox11:


```
# file mtr
mtr: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (FreeBSD), dynamically linked
 (uses shared libs), for FreeBSD 9.0 (900044), stripped
```

There you see "MSB executable", Most Significant Byte first machine architecture.

And for completeness I'd like to point out that FreeBSD is not Linux


----------

