guedes / ldap_fdw

A LDAP Foreign Data Wrapper for PostgreSQL
31 stars 11 forks source link

Won't compile with 9.2 on RHEL 6.3 #2

Closed dveeden closed 11 years ago

dveeden commented 11 years ago
# make
cp sql/ldap_fdw.sql sql/ldap_fdw--0.0.2.sql
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.2/include/server -I/usr/pgsql-9.2/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/ldap_fdw.o src/ldap_fdw.c
src/ldap_fdw.c:44: warning: useless storage class specifier in empty declaration
src/ldap_fdw.c:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/ldap_fdw.c: In function ‘ldap_fdw_handler’:
src/ldap_fdw.c:122: error: ‘FdwRoutine’ has no member named ‘PlanForeignScan’
src/ldap_fdw.c:122: error: ‘ldap_plan’ undeclared (first use in this function)
src/ldap_fdw.c:122: error: (Each undeclared identifier is reported only once
src/ldap_fdw.c:122: error: for each function it appears in.)
src/ldap_fdw.c: At top level:
src/ldap_fdw.c:171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/ldap_fdw.c: In function ‘ldap_begin’:
src/ldap_fdw.c:229: warning: implicit declaration of function ‘ldap_init’
src/ldap_fdw.c:229: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:245: warning: implicit declaration of function ‘ldap_simple_bind_s’
src/ldap_fdw.c:255: warning: passing argument 1 of ‘get_str_attributes’ from incompatible pointer type
src/ldap_fdw.c:108: note: expected ‘char **’ but argument is of type ‘char * (*)[256]’
src/ldap_fdw.c:257: warning: implicit declaration of function ‘ldap_search_s’
src/ldap_fdw.c: In function ‘ldap_iterate’:
src/ldap_fdw.c:321: warning: implicit declaration of function ‘ldap_get_values’
src/ldap_fdw.c:321: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c: In function ‘ldap_rescan’:
src/ldap_fdw.c:346: warning: unused variable ‘festate’
src/ldap_fdw.c: In function ‘ldap_get_options’:
src/ldap_fdw.c:471: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:472: warning: assignment makes pointer from integer without a cast
make: *** [src/ldap_fdw.o] Error 1

# rpm -q postgresql92-devel make gcc openldap-devel
postgresql92-devel-9.2.2-1PGDG.rhel6.x86_64
make-3.81-20.el6.x86_64
gcc-4.4.6-4.el6.x86_64
openldap-devel-2.4.23-26.el6_3.2.x86_64
dveeden commented 11 years ago

With pgxn it also fails.

# export PATH="$PATH:/usr/pgsql-9.2/bin"
# pgxn install ldap_fdw
INFO: best version: ldap_fdw 0.0.2
INFO: saving /tmp/tmpkrJm5r/ldap_fdw-0.0.2.zip
INFO: unpacking: /tmp/tmpkrJm5r/ldap_fdw-0.0.2.zip
INFO: building extension
cp sql/ldap_fdw.sql sql/ldap_fdw--0.0.2.sql
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.2/include/server -I/usr/pgsql-9.2/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/ldap_fdw.o src/ldap_fdw.c
src/ldap_fdw.c:44: warning: useless storage class specifier in empty declaration
src/ldap_fdw.c:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/ldap_fdw.c: In function ‘ldap_fdw_handler’:
src/ldap_fdw.c:122: error: ‘FdwRoutine’ has no member named ‘PlanForeignScan’
src/ldap_fdw.c:122: error: ‘ldap_plan’ undeclared (first use in this function)
src/ldap_fdw.c:122: error: (Each undeclared identifier is reported only once
src/ldap_fdw.c:122: error: for each function it appears in.)
src/ldap_fdw.c: At top level:
src/ldap_fdw.c:171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/ldap_fdw.c: In function ‘ldap_begin’:
src/ldap_fdw.c:229: warning: implicit declaration of function ‘ldap_init’
src/ldap_fdw.c:229: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:245: warning: implicit declaration of function ‘ldap_simple_bind_s’
src/ldap_fdw.c:255: warning: passing argument 1 of ‘get_str_attributes’ from incompatible pointer type
src/ldap_fdw.c:108: note: expected ‘char **’ but argument is of type ‘char * (*)[256]’
src/ldap_fdw.c:257: warning: implicit declaration of function ‘ldap_search_s’
src/ldap_fdw.c: In function ‘ldap_iterate’:
src/ldap_fdw.c:321: warning: implicit declaration of function ‘ldap_get_values’
src/ldap_fdw.c:321: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c: In function ‘ldap_rescan’:
src/ldap_fdw.c:346: warning: unused variable ‘festate’
src/ldap_fdw.c: In function ‘ldap_get_options’:
src/ldap_fdw.c:471: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:472: warning: assignment makes pointer from integer without a cast
gmake: *** [src/ldap_fdw.o] Error 1
ERROR: command returned 2: gmake PG_CONFIG=/usr/pgsql-9.2/bin/pg_config all
dveeden commented 11 years ago

It works on Ubuntu 12.04 LTS with gcc 4.6.3. (using pgxn) On RHEL6.3 I used gcc 4.4.6.

dveeden commented 11 years ago

Compile on RHEL6 with 9.2 fails. It does compile with 9.1 (as shown below).

# make
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.1/include/server -I/usr/pgsql-9.1/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/ldap_fdw.o src/ldap_fdw.c
src/ldap_fdw.c:44: warning: useless storage class specifier in empty declaration
src/ldap_fdw.c: In function ‘ldap_begin’:
src/ldap_fdw.c:229: warning: implicit declaration of function ‘ldap_init’
src/ldap_fdw.c:229: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:245: warning: implicit declaration of function ‘ldap_simple_bind_s’
src/ldap_fdw.c:255: warning: passing argument 1 of ‘get_str_attributes’ from incompatible pointer type
src/ldap_fdw.c:108: note: expected ‘char **’ but argument is of type ‘char * (*)[256]’
src/ldap_fdw.c:257: warning: implicit declaration of function ‘ldap_search_s’
src/ldap_fdw.c: In function ‘ldap_iterate’:
src/ldap_fdw.c:321: warning: implicit declaration of function ‘ldap_get_values’
src/ldap_fdw.c:321: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c: In function ‘ldap_rescan’:
src/ldap_fdw.c:346: warning: unused variable ‘festate’
src/ldap_fdw.c: In function ‘ldap_get_options’:
src/ldap_fdw.c:471: warning: assignment makes pointer from integer without a cast
src/ldap_fdw.c:472: warning: assignment makes pointer from integer without a cast
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fpic -L/usr/pgsql-9.1/lib -L/usr/lib64 -Wl,--as-needed  -shared -o src/ldap_fdw.so src/ldap_fdw.o
rm src/ldap_fdw.o
dveeden commented 11 years ago

The callback routines have changed between 9.1 and 9.1 http://www.postgresql.org/docs/9.1/static/fdw-callbacks.html http://www.postgresql.org/docs/9.2/static/fdw-callbacks.html

dveeden commented 11 years ago

mysql_fdw uses "#if (PG_VERSION_NUM >= 90200)"

guedes commented 11 years ago

Could you try to compile it again? Notice that this is a very very WIP yet, the output format will change and many other thing are coming soon.

:)

dveeden commented 11 years ago

It does compile. There are no errors, only 2 warnings. This is RHEL6.3 with PostgreSQL 9.2

# make
cp sql/ldap_fdw.sql sql/ldap_fdw--0.0.2.sql
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.2/include/server -I/usr/pgsql-9.2/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/ldap_fdw.o src/ldap_fdw.c
src/ldap_fdw.c:489: warning: ‘_get_str_attributes’ defined but not used
src/ldap_fdw.c:508: warning: ‘_name_str_case_cmp’ defined but not used
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -shared -o ldap_fdw.so src/ldap_fdw.o -L/usr/pgsql-9.2/lib -L/usr/lib64 -Wl,--as-needed  -lldap 
guedes commented 11 years ago

Thanks! That warnings will be fixed soon.