Bug #65660 OSX 32-bit ODBC installer appears to install 64-bit driver
Submitted: 18 Jun 2012 16:36 Modified: 29 May 2013 11:43
Reporter: Maury Markowitz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.11 OS:MacOS
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[18 Jun 2012 16:36] Maury Markowitz
Description:
I am trying to debug ODBC on OSX 10.7.4, which is more difficult than one might expect due to differences in 32/64 bit words and the need for *every* part of the stack to operate in the same mode. So when iODBC complained that the ODBC library I had was the wrong one, I checked in lipo and saw this...

Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib	libmyodbc5.so
Maurys-MacBook-Air-2:lib maury$ lipo -i libmyodbc5.so
Non-fat file: libmyodbc5.so is architecture: x86_64

Well ok, if it's 64-bit and doesn't like it, I guess I need the 32-bit version for some reason. Ok, so I...

Maurys-MacBook-Air-2:lib maury$ sudo rm libmyodbc5.so
Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib

Then I download the 32-bit installer and run it, and then I get...

Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib	libmyodbc5.so

Good so far...

Maurys-MacBook-Air-2:lib maury$ lipo -i libmyodbc5.so
Non-fat file: libmyodbc5.so is architecture: x86_64

Ok, that's not right

How to repeat:
Clean off any Connect/ODBC you might have, download the 32-bit version, and install.
[18 Jun 2012 17:31] Valeriy Kravchuk
What exact 32-bit binaries you had downloaded? With the following:

http://mysql.infocom.ua/Downloads/Connector-ODBC/5.1/mysql-connector-odbc-5.1.11-osx10.5-x...

I have no problem on Mac OS X 10.5.6:

macbook-pro:~ openxs$ file /usr/local/lib/libmyodbc5.so 
/usr/local/lib/libmyodbc5.so: Mach-O 64-bit bundle x86_64
macbook-pro:~ openxs$ sudo rm /usr/local/lib/libmyodbc5.so
Password:

Then I had installed 32-bit "over" previous installation of 64-bit (from the URL listed above), and:

macbook-pro:~ openxs$ ls /usr/local/lib/ | grep myodbc
libmyodbc5.so
macbook-pro:~ openxs$ file /usr/local/lib/libmyodbc5.so 
/usr/local/lib/libmyodbc5.so: Mach-O bundle i386
[18 Jun 2012 19:19] Maury Markowitz
Yes, I downloaded both:

mysql-connector-odbc-5.1.11-osx10.5-x86-32bit.dmg
mysql-connector-odbc-5.1.11-osx10.5-x86-64bit.dmg

I installed the 64 bit version and lipo'ed, then when that didn't work, the 32bit version and lipo'ed.

I'll try again and report back.
[18 Jun 2012 19:37] Maury Markowitz
Yeah, still having it...

Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib	libmyodbc5.so
Maurys-MacBook-Air-2:lib maury$ sudo rm libmyodbc5.so
Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib

[pause while I open the 32-bit pkg and run the installer...]

Maurys-MacBook-Air-2:lib maury$ ls
libfbclient.dylib	libmyodbc5.so
Maurys-MacBook-Air-2:lib maury$ lipo -i libmyodbc5.so
Non-fat file: libmyodbc5.so is architecture: x86_64
Maurys-MacBook-Air-2:lib maury$
[20 Jun 2012 8:15] Bogdan Degtyariov
Maury,

Both 32 and 64 bit install and work correctly in my MacOS 10.5.7.

Did you try downloading tar.gz packages?

mysql-connector-odbc-5.1.11-osx10.5-x86-32bit.tar.gz
mysql-connector-odbc-5.1.11-osx10.5-x86-64bit.tar.gz
[20 Jun 2012 17:07] Maury Markowitz
I just downloaded both tar balls, and they DO have the correct libraries within them...

Maurys-MacBook-Air-2:mysql-connector-odbc-5.1.11-osx10.6-x86-32bit maury$ cd libMaurys-MacBook-Air-2:lib maury$ lipo -i *
Non-fat file: libmyodbc5.so is architecture: i386

Maurys-MacBook-Air-2:mysql-connector-odbc-5.1.11-osx10.6-x86-64bit maury$ cd libMaurys-Maurys-MacBook-Air-2:lib maury$ lipo -i *
Non-fat file: libmyodbc5.so is architecture: x86_64

So, questions:

1) is there a way I can open the DMG without "running" it so I can run lipo on what's inside?

2) if I lipo these together into a single library, will it work properly?

3) (this is a lipo question, my apologies) can we lipo a PPC version into it as well?
[12 Jul 2012 7:25] Bogdan Degtyariov
Maury,

You can extract files from dmg package in macos.
To do so perform the following steps.

1. Download .dmg package (I placed it into ~/Download/myodbc directory)
2. Mount the package by double clicking on it
3. Find a pkg file into the mounted directory and summon the context menu
   (right-mouse click) and choose "Show package contents"
4. Go into Contents directory and Copy/Paste the file with the name
   Archive.pax.gz
5. Unpack files from this archive somewhere and use lipo or file utility
   to check libmyodbc5.so file.

Here are the results of my checks for all dmg 32 and 64 bit packages built
for MacOS 10.5 and 10.6:

$ lipo -detailed_info unpack/10.5/32/usr/local/lib/libmyodbc5.so 

input file unpack/10.5/32/usr/local/lib/libmyodbc5.so is not a fat file
Non-fat file: unpack/10.5/32/usr/local/lib/libmyodbc5.so is architecture: i386

$ lipo -detailed_info unpack/10.5/64/usr/local/lib/libmyodbc5.so 

input file unpack/10.5/64/usr/local/lib/libmyodbc5.so is not a fat file
Non-fat file: unpack/10.5/64/usr/local/lib/libmyodbc5.so is architecture: x86_64

$ lipo -detailed_info unpack/10.6/32/usr/local/lib/libmyodbc5.so 

input file unpack/10.6/32/usr/local/lib/libmyodbc5.so is not a fat file
Non-fat file: unpack/10.6/32/usr/local/lib/libmyodbc5.so is architecture: i386

$ lipo -detailed_info unpack/10.6/64/usr/local/lib/libmyodbc5.so 

input file unpack/10.6/64/usr/local/lib/libmyodbc5.so is not a fat file
Non-fat file: unpack/10.6/64/usr/local/lib/libmyodbc5.so is architecture: x86_64

As you can see all 32-bit packages have only 32-bit libraries and 64-bit packages contain only 64-bit libraries. So, everything is right.

I do not think that you can lipo a 32-bit library with a 64-bit library together.
[13 Aug 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 May 2013 11:43] Bogdan Degtyariov
I do not think it is a bug. Please let me know if you think otherwise.