linker dependencies when making static build

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

linker dependencies when making static build

ville
Hi,

I wonder if I'm building postfix wrong, but since it is configured to
build with gcc
and the mysql c connector seems to contain c++ code it finally fails to
link due to
lack of new and delete operators and some pthread stuff.
If I add -lstdc++ in the cmdline and -lpthread in the makedefs, it'll
link just fine.

make makefiles OPT='-static' 'CCARGS=-DHAS_MYSQL
-I/data/libs/mysql_connector_install/include/'
'AUXLIBS_MYSQL=-L/data/libs/mysql_connector_install/lib/ -lmysqlclient
-lz -lm -lstdc++'

Maybe the above method is not the proper way of building postfix
statically?

Ville
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: linker dependencies when making static build

Wietse Venema
ville:

> Hi,
>
> I wonder if I'm building postfix wrong, but since it is configured to
> build with gcc
> and the mysql c connector seems to contain c++ code it finally fails to
> link due to
> lack of new and delete operators and some pthread stuff.
> If I add -lstdc++ in the cmdline and -lpthread in the makedefs, it'll
> link just fine.
>
> make makefiles OPT='-static' 'CCARGS=-DHAS_MYSQL
> -I/data/libs/mysql_connector_install/include/'
> 'AUXLIBS_MYSQL=-L/data/libs/mysql_connector_install/lib/ -lmysqlclient
> -lz -lm -lstdc++'
>
> Maybe the above method is not the proper way of building postfix
> statically?

Yes, don't do OPT=-static

Instead, follow INSTALL instructions.

make makefiles shared=no CCARGS... AUXLIBS...

        Wietse
Loading...