in reply to Re: DBD::Sybase make fails because of incompatible shared object(.so)
in thread DBD::Sybase - 'make' fails because of incompatible shared object(.so)

Thanks!

I went through the link you shared and there somebody suggested to add the following -

You might need this "add -DSYB_LP64" in the Makefile for 64-bit.

So i modified the following in Makefile, not sure if this what he meant -

EXTRALIBS = -L/opt/sap/OCS-16_0/lib -lsybct -lsybcs -lsybtcl -lsybcomn + -lsybintl -lsybblk -DSYB_LP64 LDLOADLIBS = -L/opt/sap/OCS-16_0/lib -lsybct -lsybcs -lsybtcl -lsybcom +n -lsybintl -lsybblk -ldl -lm -DSYB_LP64
But it didn't work.

How to set LP64 flag in Makefile.PL? Not sure where to enable LP64. Also, I tried modifying the CONFIG file which is placed in the same folder where Makefile.PL and added "BUILD_TYPE=64" even that didn't work.

Though i was able to by-pass the error using a dirty hack, which is by replacing all the .so file with 64 bit version of .so file and the make went through fine. During "make test" half of the test failed and "make install" succeeded. And my perl script also compiled.

But still i want to know the right way to fix this.

Replies are listed 'Best First'.
Re^3: DBD::Sybase make fails because of incompatible shared object(.so)
by Corion (Patriarch) on Sep 25, 2015 at 17:27 UTC

    Matching the Makefile is a good approach if you don't find the place in Makefile.PL where the libraries and command line switches are added.

    From your description it seems as if you only added -DSYS_LP64 but omitted -llibsybtcl64. Most likely, you will also need to remove -lsybctl .

    My guess is that you will need to change all mentions of -lsyb* to -lsyb*64 so the build process picks up the 64-bit versions of the libraries.

      Thanks @corion & @Anonymous Monk

      'make' was successful once i modified the following entries in Makefile to -

      EXTRALIBS = -L/opt/sap/OCS-16_0/lib -lsybct64 -lsybcs64 -lsybtcl64 -ls +ybcomn64 -lsybintl64 -lsybblk64 -DSYB_LP64 LDLOADLIBS = -L/opt/sap/OCS-16_0/lib -lsybct64 -lsybcs64 -lsybtcl64 -l +sybcomn64 -lsybintl64 -lsybblk64 -ldl -lm -DSYB_LP64

      It is now picking up all the 64 bit .so files. It was complaining for the following files -

      - libsybct64.so/libsybct.so - libsybcs64.so/libsybcs.so - libsybtcl64.so/libsybtcl.so - libsybcomn64.so/libsybcomn.so - libsybintl64.so/libsybintl.so - libsybblk64.so/libsybblk.so

      Even though my issue is resolved, out of curiosity i was wondering what changes needs to be done to 'Makefile.PL' to generate correct 'Makefile'.

      Also why one should modify these files, shouldn't it automatically understand that it is a 64 bit machine and the perl module should look for 64 bit version of .so file.

        Have you searched Makefile.PL for example for sybintl ? It seems to have only one occurrence. I would assume that this would be a proper place to make the change.

        As to the need of modification, as Makefile.PL is a (Perl) program like many others, it is most likely that it simply doesn't support the detection and adaption to the bitness.

Re^3: DBD::Sybase make fails because of incompatible shared object(.so)
by Anonymous Monk on Sep 26, 2015 at 00:09 UTC

    So did you check which files are 64 bit versions (like libsybtcl64 ) and make sure they're added to LIBS of ExtUtils::MakeMaker?

    Also, in addition to what corion said, in the sybase Makefile.PL, it tries to determine when to add -DSYB_LP64 and when to omit it .... so you can also simply edit Makefile.PL right before WriteMakefile() to make the changes you need, this survives make clean