Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#30248 closed defect (invalid)

wine-devel: libwine.1.dylib malformed object (unknown load command 4)

Reported by: taco.nieuwenhuis@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: jyrkiwahlstedt, macports@…, d.s.hunnisett@…
Port: wine-devel

Description

I used to be able to build wine under Snow Leopard on my MacBook Pro. Ever since I updated Macports (early July, so probably since version 1.9.2) wine no longer builds. Tried removing Wine and reinstalling it but didn't work. Also tried to fully remove Macports, reinstalling it and rebuilding wine from scratch but that didn't work either.

I have attached the log file. As far as I can see, the first error that occurs is found by searching for "ld: library not found"

Attachments (1)

main.log (2.1 MB) - added by taco.nieuwenhuis@… 10 years ago.

Change History (12)

Changed 10 years ago by taco.nieuwenhuis@…

Attachment: main.log added

comment:1 Changed 10 years ago by mf2k (Frank Schima)

Cc: jwa@… added
Owner: changed from macports-tickets@… to ryandesign@…
Port: wine-devel added

comment:2 Changed 10 years ago by ryandesign (Ryan Schmidt)

Summary: Error building wine under Snow Leopardwine-devel: ld: library not found for -lwine

Hmm, possibly a parallel build issue. (I see MacPorts has chosen to build with 5 parallel make jobs on your system.) Try using fewer jobs. It always works with 2 for me.

sudo port clean wine-devel
sudo port install wine-devel build.jobs=2

comment:3 Changed 10 years ago by ryandesign (Ryan Schmidt)

I received the following response by email:

From: taco.nieuwenhuis
Date: July 21, 2011 05:41:04 CDT
To: macports-dev
Cc: ryandesign, macports-tickets, jwa
Subject: Re: [MacPorts] #30248: wine-devel: ld: library not found for -lwine (was: Error building wine under Snow Leopard)

Hi!

Thanx a lot for your quick assistance. I followed the suggestion below and this was spot on: wine-devel compiled without problems. In fact it even did so under Lion!

Thanx again guys!!

comment:4 Changed 10 years ago by ryandesign (Ryan Schmidt)

Resolution: invalid
Status: newclosed
Summary: wine-devel: ld: library not found for -lwinewine-devel: libwine.1.dylib malformed object (unknown load command 4)

I no longer believe this is a parallel build issue. I originally thought that because I saw the error "library not found for -lwine", suggesting something was trying to use libwine.dylib before it had been built. But on closer inspection I see the log says:

:info:build cp -p libwine.1.0.dylib libwine.1.dylib && install_name_tool -id @executable_path/`../../tools/relpath /opt/local/bin /opt/local/lib`/libwine.1.dylib libwine.1.dylib || rm -f libwine.1.dylib
[...]
:info:build install_name_tool: object: libwine.1.dylib malformed object (unknown load command 4)

So it did try to build libwine.dylib earlier, but install_name_tool did not recognize it as a valid library, so it deleted the library, causing the "library not found" error later.

Googling this install_name_tool error turned up one case of a user who had somehow managed to replace their install_name_tool program with one from 2002, which was far too old to understand modern Mac OS X libraries. You said you were able to build wine now, but your original report said Snow Leopard, and your new message said Lion. If, in between the failed build and the successful build, you upgraded to Lion, you would have had to upgrade Xcode right? And reinstalling Xcode would have replaced install_name_tool with a correct version.

comment:5 Changed 10 years ago by taco.nieuwenhuis@…

I think you are right. First of all because I never experienced problems with too many parallel jobs before (never used anything but the default). And secondly because I indeed had reinstall Xcode as part of the upgrade to Lion. The puzzling thing is how install_name_tool got replaced in the first place. I'll try to find that out outside this forum though.

Thanx for the help!

comment:6 Changed 9 years ago by ryandesign (Ryan Schmidt)

Has duplicate #31126 (this time with wine-crossover-games).

comment:7 Changed 9 years ago by macports@…

I had this same issue. It appears that Snow Leopard must come with an old version of install_name_tool in /usr/bin and for whatever reason the latest XCode doesn't replace it with the new version.

I manually replaced mine with a symlink to the install_name_tool in /Developer/usr/bin and it resolved the problem

comment:8 in reply to:  7 ; Changed 9 years ago by ryandesign (Ryan Schmidt)

Cc: macports@… added

Replying to macports@…:

It appears that Snow Leopard must come with an old version of install_name_tool in /usr/bin and for whatever reason the latest XCode doesn't replace it with the new version.

No, that's not likely; if that were the case, we would have fielded bug reports about it from virtually every single person trying to use MacPorts on Snow Leopard over the past two years, and that has definitely not been the case. No, the problem is that you or some program you installed replaced your functional /usr/bin/install_name_tool with an ancient version that's not functional on Snow Leopard.

comment:9 in reply to:  8 Changed 9 years ago by macports@…

Replying to ryandesign@…:

No, that's not likely; if that were the case, we would have fielded bug reports about it from virtually every single person trying to use MacPorts on Snow Leopard over the past two years, and that has definitely not been the case. No, the problem is that you or some program you installed replaced your functional /usr/bin/install_name_tool with an ancient version that's not functional on Snow Leopard.

This was a reasonably fresh install of snow leopard (since i had to revert from lion) and not much else is installed at the moment.

It looked suspiciously like XCode 4.x (the non free version that most people probably aren't using) didn't replace any existing files in /usr/bin. I think XCode was probably the last thing I installed tho it's entirely possible I did install something else afterwards that broke it (or an update of something).

I'll have a look at it next time i do something stupid (like upgrade to lion) and have to reinstall.

comment:10 Changed 9 years ago by d.s.hunnisett@…

I have just installed xcode3.2.10 a432
This is putting the wrong version on

    -r-xr-xr-x  1 root  wheel  274512  3 Jul  2009 /usr/bin/install_name_tool

comment:11 in reply to:  10 Changed 9 years ago by ryandesign (Ryan Schmidt)

Cc: d.s.hunnisett@… added

Replying to d.s.hunnisett@…:

I have just installed xcode3.2.10 a432
This is putting the wrong version on

If that's true, you'll have to report the problem to Apple. I don't have access to pre-release versions of Xcode. With Xcode 3.2.6, I have the following:

$ ls -l /usr/bin/install_name_tool
-r-xr-xr-x  1 root  wheel  319744 Oct 24  2010 /usr/bin/install_name_tool

So to me it looks like your install_name_tool is out of date. I would try using Apple's developer tools uninstall script to remove all of Xcode, then installing Xcode again.

Note: See TracTickets for help on using tickets.