Linking libraries for compat_linux

Chris eagletree at
Fri Dec 19 17:46:15 UTC 2008

I've bumped into a library I can't resolve and I must have a disconnect
in how the linux_compat works because I can't see how it could be  
I have the following:
* compat_linux enabled in the kernel,
* /usr/ports/emulators/linux_base_fc7
* sysctl kern.fallback_elf_brand=3
* rpm2cpio to alter rpms
* cpio to create the directories and place the files where they  
belong in /compat/linux.

I have a program that now has all it's libraries resolved but one in
preparation to attempt to run the Linux Quickbooks install on FreeBSD.
The ldd output, prior to installing /usr/ports/devel/fam (a required  
library) looks like this.

ldd ./opt/qbes7/util/qbmonitord
./opt/qbes7/util/qbmonitord: => not found => /lib/ (0x28072000) => /usr/lib/ (0x28088000) => /lib/ (0x28171000) => /lib/ (0x28198000) => /lib/ (0x281a4000)
         /lib/ (0x28054000)

I install fam to get rid of the not found, perform the following link:
	ln /usr/local/lib/ /compat/linux/lib/

and then I get this:

ldd ./opt/qbes7/util/qbmonitord
./opt/qbes7/util/qbmonitord: error while loading shared libraries: / 
lib/ ELF file OS ABI invalid
./opt/qbes7/util/qbmonitord: exit status 127

which kind of makes sense since this library is not a linux library.  
I'd read
that I don't need to brandelf -t linux a library but I tried that  
realizing it was likely meaningless (or harmful). It didn't help of  

My next thought was to try and get a binary from a linux  
but stopped when it occurred to me that it would be illogical since  
fam uses
kqueue on FreeBSD rather than something called imon. imon is not  
for FreeBSD so a linux version shouldn't be able to function if it  
expects that. On
FreeBSD, fam configures itself to not use imon.

What is the appropriate course of action to get a linux flavor shared  
for fam (or anything which runs into such conflicts) that will work  
on FreeBSD
yet be recognized as suitable for linux under the compat mode?

More information about the freebsd-questions mailing list