MySQL library initialization failed (on "init")
Jeff Mitchell
mitchell at kde.org
Sat Oct 3 12:59:30 UTC 2009
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!
Thanks,
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/amarok/attachments/20091003/8670b4e1/attachment.sig>
More information about the Amarok
mailing list