configure: error: c++ preprocessor "/lib/cpp" fails sanity check

Hello.

I try to compile faad audio library.

But after ./configure, there is that error message :

configure: error: c++ preprocessor "/lib/cpp" fails sanity check


gcc was installed with: pkg install gcc

What is wrong ?

Thanks.

Fre;D
 
/lib/cpp is a Linuxism as far as I know and to compile the source you'll have to do some patching to work around those. What prevents you from using the audio/faad port?
 
kpa -> Many thanks for your light.
What prevents you from using the audio/faad port?

Ok, I will (try) to explain the problem.

faad audio-library uses a other library -> libmp4ff.

In FreeBSD package: faad2-2.7_5,1.txz there is:
libfaad.so.2.0.0 -> the main dynamic library.
libmp4ff.a -> the static library used by libfaad.so.2.0.0 .

My audio suite needs both dynamic libraries.
https://github.com/fredvs/uos

To make a static library -> dynamic, you may use that code:
gcc -shared -o libmp4ff.so.0.0.0 -Wl,--whole-archive libmp4ff.a -Wl,--no-whole-archive

Sadly, libmp4ff.a given in FreeBSD package was compiled without -fPIC, so gcc refuse to make a dynamic library.

It is the reason why I (try to) recompile the library, but with this:
./configure CFLAGS=-fPIC --with-mp4v2 --enable-shared
make clean


But without luck (see first topic).

Maybe I must do a other way ?

Thanks.

Fre;D
 
But libmp4ff.a is compiled with -fPIC? Just look at the port Makefile and work/faad2-2.7/common/mp4ff/Makefile.am (after make patch).

Can't you do this instead to get a dynamic library?
Code:
ar x /usr/local/lib/libmp4ff.a
cc -shared -o libmp4ff.so *.o
 
Can't you do this instead to get a dynamic library?
Code:
ar x /usr/local/lib/libmp4ff.a
cc -shared -o libmp4ff.so *.o

ar x /usr/local/lib/libmp4ff.a--> OK

cc -shared -o libmp4ff.so *.o--> cc is not found-installed (how to do it?),
so I try with:
gcc -shared -o libmp4ff.so *.o--> gcc: No match
so I try with:
gcc -shared -o /usr/local/lib/libmp4ff.so *.o--> gcc: No match
so I try with:
gcc -shared -o /usr/local/lib/libmp4ff.a *.o--> gcc: No match

;-(

Thanks.
 
ar x /usr/local/lib/libmp4ff.a--> OK

cc -shared -o libmp4ff.so *.o--> cc is not found-installed (how to do it?), so I try with:
gcc -shared -o libmp4ff.so *.o--> "rodatta" can not be used when making a shared object, recompile with -fPIC

;-(

Thanks.
What FreeBSD version are you on? cc should be available on all supported versions.
 
What FreeBSD version are you on? cc should be available on all supported versions.
FreeBSD 10.1.

Indeed strange that gcc is installed and cc not...

But I have to confess that is is from my own distribution.
Maybe I forgot to install cc?

How can it be done?

Thanks.
 
How the heck is that system installed? The vanilla 10.1 definitely has /usr/bin/cc and that is Clang. Anything in your /etc/make.conf or /etc/src.conf? Is this system updated/upgraded using freebsd-update(8) or using sources?
 
Hello.

OK, switched to a other "official" FreeBSD machine (Ghost) and with cc installed, your tip works perfectly.
I will test the result-library libmp4ff.so now.

How the heck is that system installed? The vanilla 10.1 definitely has /usr/bin/cc and that is Clang. Anything in your /etc/make.conf or /etc/src.conf? Is this system updated/upgraded using freebsd-update(8) or using sources?

It is this distro.

Huh, could it be possible to a add a clang, or cc package, like you did for gcc?
pkg install clang ?

Other suggestion: you added libmp4ff.a in the patch.
That is great! But, be crazy, add libmp4ff.so too, end users need this one, not the static.
And you will be more generous than Linux that, also, only gives the static library.
And obliges, poor end users, to make by they-self static->dynamic.

By the way: many thanks and always solutions with FreeBSD. :)

Fre;D
 
Last edited:
But, be crazy, add libmp4ff.so too, end users need this one, not the static.
And you will be more generous than Linux that, also, only gives the static library.
And obliges, poor end users, to make by they-self static->dynamic.
It might happen if you submit a patch to audio/faad ;)
 
It might happen if you submit a patch to audio/faad ;)

Of course, I will do it with great pleasure.

But, before to sent the patch,... it must work.

And, sadly, after test of the the result-library libm4ff.so , there are not only good news.

The library can be loaded with LoadLibrary() but fail to GetProcAdress(), this for each exported method.

The good news is that with libfaad.so provided by the patch, GetProcAdress() is working for all exported methods.

Do you have a idea how to create a dynamic library from a static and export the methods too?

Does it exist a utility in FreeBSD to check a library, to see the exported methods?

Many Thanks.

Fre;D
 
might be helpful: nm -D --defined-only libmp4ff.so

Yep ->

aac_freebsd.jpg


So, it seems that the methods are exported.

Sadly, all GetProcAdress() fail, for example : GetProcAdress('mp4ff_open_read') -> pointer is nil.

And for libfaad.so, all GetProcAdress() work.

I loose, I do not find the solution.

;-(

Fre;D
 
It might happen if you submit a patch to audio/faad ;)

Hello.

There in fpc-forum, they find the solution : use dlsym() in place of GetProcAdress()

So this dynamic libm4ff.so in attachment could be used for the patch.
Tested with perfect result on FreeBSD 10.1/2

Fre;D
 

Attachments

  • libmp4ff.so.0.0.0.zip
    21.3 KB · Views: 133
Back
Top