I make a module for apache, and use gcc for compile:
gcc \
$(apr-1-config --cflags) \
$(apr-1-config --includes) \
$(python3.6-config --cflags) \
-fPIC -DSHARED_MODULE \
-I/usr/include/httpd/ \
-c mod_demo.c
But when I try to link the python libraries it does not work:
ld \
$(apr-1-config --link-ld) \
$(python3.6-config --ldflags) \
-Bshareable \
-o mod_demo.so \
mod_demo.o
The output message is:
ld: -linker not found.
What is the problem?. The flags are:
[root@demo demo]# python3.6-config --ldflags
-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
If write the flags without -Xlinker, it works fine:
ld \
$(apr-1-config --link-ld) \
-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -export-dynamic \
-Bshareable \
-o mod_demo.so \
mod_demo.o
How to use native flags from python3.6-config
?, what is the problem for -Xlinker
?