List:Commits« Previous MessageNext Message »
From:tim Date:February 14 2008 9:05am
Subject:bk commit into 5.0 tree (tsmith:1.2578) BUG#21158
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tsmith.  When tsmith does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-14 01:05:25-07:00, tsmith@stripped +1 -0
  Bug #21158 mysql_config doesn't include -lmygcc
  
  Add -lmygcc to mysql_config output for libs, libs_r, and embedded_libs.
  
  Required when linking against our static libs, if yassl is used, and gcc
  used to build library is significantly different from that which is using
  the library.

  scripts/mysql_config.sh@stripped, 2008-02-14 01:05:23-07:00, tsmith@stripped +11
-0
    Add -lmygcc to --libs, --libs_r, and --embedded-libs output, if libmygcc.a
    is found in the pkglibdir.
    
    This works around a problem when linking against the static client
    libs which were built with a different GCC than the current compiler.
    In this case, without -lmygcc, several builtin functions (e.g.,
    __pure_virtual, __builtin_delete) are left undefined.  Currently it
    is yassl which pulls in these symbols.
    
    This isn't a problem when linking against shared libraries, or when
    using the same compiler version.
    
    Currently it shows up with libs built on build.mysql.com with gcc 2.95.3,
    when using them on more recent systems.
    
    
    Also strip the -mcpu, -mtune, and -march cflags.  The calling package can
    determine what optimization parameters to choose.

diff -Nrup a/scripts/mysql_config.sh b/scripts/mysql_config.sh
--- a/scripts/mysql_config.sh	2007-09-28 10:52:17 -06:00
+++ b/scripts/mysql_config.sh	2008-02-14 01:05:23 -07:00
@@ -107,6 +107,16 @@ libs="$libs @openssl_libs@ @STATIC_NSS_F
 libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ "
 embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@
@innodb_system_libs@ @openssl_libs@ "
 
+if [ -r "$pkglibdir/libmygcc.a" ]; then
+  # When linking against the static library with a different version of GCC
+  # from what was used to compile the library, some symbols may not be defined
+  # automatically.  We package the libmygcc.a from the build host, to provide
+  # definitions for those.  Bugs 4921, 19561, 19817, 21158, etc.
+  libs="$libs -lmygcc "
+  libs_r="$libs_r -lmygcc "
+  embedded_libs="$embedded_libs -lmygcc "
+fi
+
 cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
 include="-I$pkgincludedir"
 
@@ -116,6 +126,7 @@ include="-I$pkgincludedir"
 for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
               DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
               DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \
+              'mtune=[-A-Za-z0-9]*' 'mcpu=[-A-Za-z0-9]*' 'march=[-A-Za-z0-9]*' \
               Xa xstrconst "xc99=none" \
               unroll2 ip mp restrict
 do
Thread
bk commit into 5.0 tree (tsmith:1.2578) BUG#21158tim14 Feb 2008