MySQL library initialization failed (on "init")

Dima Panov Fluffy at fluffy.khv.ru
Sat Oct 3 13:47:42 UTC 2009


On Saturday 03 October 2009 23:59:30 Jeff Mitchell wrote:
> Thomas Klausner wrote:
> > Hi!
> >
> > I'm trying to get a working package for amarok-2.2.0 for NetBSD
> > pkgsrc.
> 
> Thomas,
> 
> This might be similar to a (different) problem the FreeBSD guys were
> having, related to a line in the main CMakeLists.txt file.
> 
> There's this section, which I'll explain below:
> 
> if (CMAKE_COMPILER_IS_GNUCXX)
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
>     if( NOT WIN32 AND NOT APPLE )
>         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
>     endif( NOT WIN32 AND NOT APPLE )
> endif (CMAKE_COMPILER_IS_GNUCXX)
> 
> The -Wl,--as-needed is there because the patch that originated with the
> Gentoo folks and spread around to other Linux distros to get -fPIC
> working on x86_64 is apparently very hacky, because a result of this
> patch being applied is that on both x86_64 and x86_32, there is a good
> chance of having a very similar problem to the one you're having, where
> the mysqle plugin cannot be loaded/initialized.
> 
> Now, I'll be the first to admit that this is kind of strange because
> normally you expect -Wl,--as-needed to break things, not fix them -- but
> in this case it's absolutely true, and was a fix that was working across
> Linux distros. As a result, I put it into our CMakeLists file so that
> all of our SVN/Git users would be able to actually compile and run
> Amarok, and haven't heard of any issues until recently.
> 
> What I didn't expect is that it would break things on at least FreeBSD
> and probably now NetBSD, since you guys are also using GCC. So I'm going
> to change the CMakeLists to only activate that if finds that it's
> running on Linux.
> 
> If you want to test it and let me know how it goes, that would be great.
> Change the lines from
> 
> if( NOT WIN32 AND NOT APPLE )
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
> endif( NOT WIN32 AND NOT APPLE )
> 
> to
> 
> if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
> endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> 
> You'll need a full rebuild (from a clean build dir) afterwards. Let me
> know how it goes!

Confirmed, this works on FreeBSD.

-- 
Dima "Red Fox" Panov @ Home | C73E 2B72 1FFD 61BD E206 1234 A626 76ED 93E3 B018
Khabarovsk, Russia          | 2D30 2CCB 9984 130C 6F87 BAFC FB8B A09D D539 8F29
KDE at FreeBSD Team | FreeBSD committer since 10.08.2009 | FreeBSD since Sept 1995
Twitter.com:fluffy_khv | Skype:dima.panov | Jabber.org:fluffy.khv | ICQ:1745024
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/amarok/attachments/20091004/89258b9e/attachment.sig>


More information about the Amarok mailing list