Package: libmysqlclient-dev Version: 5.1.30-2 Tags: patch Severity: serious Justification: Violation of MUST in Debian Policy section 10.2
Hello, This bug is related to #457915. Currently Debian Policy section 10.2 states: "As to the static libraries, the common case is not to have relocatable code, since there is no benefit, unless in specific cases; therefore the static version must not be compiled with the -fPIC flag. Any exception to this rule should be discussed on the mailing list [EMAIL PROTECTED], and the reasons for compiling with the -fPIC flag must be recorded in the file README.Debian" libmysqld.a is a static library and it is built with -fPIC only on amd64, but that is not described in README.Debian. Also please do not treat a single arch specially since that makes absolutely no sense. You either build with -fPIC on all arches or none or build both PIC and nonPIC versions on all arches (which I'm suggesting). Therefore this bug is also a request to provide both -fPIC and non-fPIC versions of libmysqld.a. I have even written a patch for this (debdiff attached). I need libmysqld to be linked into dynamic library [1][2], but I can't use it until it is built without -fPIC on other arches. The changes make mysql build twice without and with -fPIC respectively in separate build directories (the 2nd time only libmysqld and its dependencies are built). Then both libmysqld.a (nonPIC version) and libmysqld_pic.a (PIC version) are installed to libmysqlclient-dev. As a side effect of using out- of-source-tree builds, hack in clean target is no longer needed. Patch 02 fixes FTBFS of libmysqld examples due to undefined symbol. The only remaining part for you is to create a README.Debian. Justification is of -fPIC version is simple: libmysqld_pic.a is needed to be able to include it into shared libraries, which is a perfectly valid use case for libmysqld. Since you still provide nonPIC libmysqld.a, Debian Policy is not violated. P.S. libmysqld_pic.a and libmysqld.a are around 16MB each and they increase package size by 4MBs each. So it makes sense to split them both into their own package (libmysqld). #457915: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457915 1. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501495 2. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508399 -- Modestas Vainius <[EMAIL PROTECTED]>
diff -u mysql-dfsg-5.1-5.1.30/debian/control mysql-dfsg-5.1-5.1.30/debian/control --- mysql-dfsg-5.1-5.1.30/debian/control +++ mysql-dfsg-5.1-5.1.30/debian/control @@ -74,7 +74,7 @@ innotop and mysqlreport. Package: mysql-server-5.1 -Architecture: any +Architecture: any Suggests: tinyca Recommends: mailx, libhtml-template-perl Pre-Depends: mysql-common (>= ${source:Version}), adduser (>= 3.40), debconf diff -u mysql-dfsg-5.1-5.1.30/debian/changelog mysql-dfsg-5.1-5.1.30/debian/changelog --- mysql-dfsg-5.1-5.1.30/debian/changelog +++ mysql-dfsg-5.1-5.1.30/debian/changelog @@ -1,3 +1,12 @@ +mysql-dfsg-5.1 (5.1.30-3~pre1) UNRELEASED; urgency=low + + * Build both -fPIC (libmysql_pic.a) and non -fPIC (libmysqld.a). Switch to + out-of-source true build mode was a side effect of this change. + * Add 02_no_builtin_ndbcluster_plugin.dpatch patch to fix FTBFS in libmysqld + examples due to undefined symbol 'builtin_ndbcluster_plugin'. + + -- Modestas Vainius <[EMAIL PROTECTED]> Thu, 11 Dec 2008 00:36:09 +0200 + mysql-dfsg-5.1 (5.1.30-2) experimental; urgency=low * Drop MySQL Cluster support, it's deprecated since 5.1.24-RC. diff -u mysql-dfsg-5.1-5.1.30/debian/rules mysql-dfsg-5.1-5.1.30/debian/rules --- mysql-dfsg-5.1-5.1.30/debian/rules +++ mysql-dfsg-5.1-5.1.30/debian/rules @@ -42,10 +42,9 @@ TESTSUITE_FAIL_CMD=exit 1 endif -ifeq ($(findstring $(ARCH), amd64),$(ARCH)) - FORCE_FPIC_CFLAGS=-fPIC - FORCE_FPIC=--with-pic --with-lib-ccflags="-fPIC" -endif +BUILDDIR = builddir +BUILDDIR_PIC = builddir-pic +builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) # This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf # so it is disabled by default although, according to MySQL, it brings >10% @@ -54,21 +53,27 @@ USE_STATIC_MYSQLD=--with-mysqld-ldflags=-all-static endif + +configure-stamp-pic: FORCE_FPIC_CFLAGS=-fPIC +configure-stamp-pic: FORCE_FPIC=--with-pic --with-lib-ccflags="-fPIC" + configure: patch configure-stamp -configure-stamp: - @echo "RULES.configure-stamp" +configure-pic: patch configure-stamp-pic +configure-stamp configure-stamp-pic: + @echo "RULES.$@" dh_testdir ifneq ($(ARCH_OS),hurd) if [ ! -d /proc/self ]; then echo "/proc IS NEEDED" 1>&2; exit 1; fi endif + ( test -d $(builddir) || mkdir $(builddir) ) && cd $(builddir) && \ sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/bin:/usr/bin"} \ CC=$${MYSQL_BUILD_CC:-gcc} \ CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O3 -DBIG_JOINS=1 ${FORCE_FPIC_CFLAGS}"} \ CXX=$${MYSQL_BUILD_CXX:-g++} \ CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fno-exceptions -fno-rtti ${FORCE_FPIC_CFLAGS}"} \ - ./configure \ + ../configure \ --build=${DEB_BUILD_GNU_TYPE} \ --host=${DEB_HOST_GNU_TYPE} \ \ @@ -111,25 +116,48 @@ # # --with-debug - touch configure-stamp + touch $@ -build: build-stamp +build: build-stamp build-stamp-pic + build-stamp: configure + @echo "RULES.$@" dh_testdir - $(MAKE) $(MAKE_J) + cd $(builddir) && $(MAKE) $(MAKE_J) ifeq ($(findstring $(DEB_BUILD_OPTIONS),nocheck),) if [ ! -f testsuite-stamp ] ; then \ - $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; \ + cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; \ fi endif touch testsuite-stamp touch build-stamp + +MAKE_PIC = cd $(builddir) && $(MAKE) $(MAKE_J) + +build-stamp-pic: configure-pic + @echo "RULES.$@" + # Build libmysqld dependencies + $(MAKE_PIC) -C include + $(MAKE_PIC) -C sql link_sources + $(MAKE_PIC) -C libmysql link_sources + $(MAKE_PIC) -C strings + $(MAKE_PIC) -C regex + $(MAKE_PIC) -C mysys + $(MAKE_PIC) -C dbug + $(MAKE_PIC) -C vio + $(MAKE_PIC) -C storage + $(MAKE_PIC) -C extra/yassl + $(MAKE_PIC) -C cmd-line-utils + $(MAKE_PIC) -C sql lex_hash.h + # Build libmysqld itself + $(MAKE_PIC) -C libmysqld + touch $@ clean: clean-patched unpatch rm -rf debian/patched @@ -137,41 +165,22 @@ @echo "RULES.clean-patched" dh_testdir dh_testroot - rm -f configure-stamp - rm -f build-stamp + rm -f configure-stamp* + rm -f build-stamp* rm -f testsuite-stamp [ ! -f Makefile ] || $(MAKE) clean [ ! -d mysql-test/var ] || rm -rf mysql-test/var - - # We like to see how long this is neccessary - @echo "CRUFT BEGIN" - @find -type l -print0 | xargs --no-run-if-empty -0 rm -v - @find -name .deps -type d -print0 | xargs --no-run-if-empty -0 rm -rfv - @rm -vrf ndb/docs/.doxy* ndb/docs/*html ndb/docs/*pdf innobase/autom4te.cache - @for i in \ - readline/Makefile \ - sql-bench/Makefile \ - scripts/make_win_binary_distribution \ - scripts/mysqlbug \ - sql/gen_lex_hash \ - sql/lex_hash.h \ - strings/ctype_autoconf.c \ - config.log \ - config.cache \ - ; \ - do \ - rm -vf $$i; \ - done - @echo "CRUFT END" + + rm -rf $(BUILDDIR) $(BUILDDIR_PIC) debconf-updatepo dh_clean -v - + install: -install: build - @echo "RULES.install" +install install-pic: build + @echo "RULES.$@" dh_testdir dh_testroot dh_clean -k @@ -186,7 +195,7 @@ ln -s mysqlmanager.1 $(TMP)/usr/share/man/man1/mysqlmanagerc.1 # make install (trailing slash needed for innobase) - $(MAKE) install DESTDIR=$(TMP)/ + cd $(builddir) && $(MAKE) install DESTDIR=$(TMP)/ # After installing, remove rpath to make lintian happy. set +e; \ @@ -208,8 +217,10 @@ fi # libmysqlclient-dev: forgotten header file since 3.23.25? - cp include/my_config.h $(TMP)/usr/include/mysql/ + cp $(BUILDDIR)/include/my_config.h $(TMP)/usr/include/mysql/ cp include/my_dir.h $(TMP)/usr/include/mysql/ + # install libmysqld built with -FPIC + install -m 0644 -o root -g root $(BUILDDIR_PIC)/libmysqld/libmysqld.a $(TMP)/usr/lib/mysql/libmysqld_pic.a # mysql-common: We now provide our own config file. install -d $(TMP)/etc/mysql @@ -222,14 +233,14 @@ install -m 0644 -D debian/additions/innotop/InnoDBParser.pm $(TMP)/usr/share/perl5/InnoDBParser.pm # mysql-server - install -m 0755 scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe + install -m 0755 $(BUILDDIR)/scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe mkdir -p $(TMP)/usr/share/doc/mysql-server-5.1/examples mv $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mysql-server-5.1/examples/ rm -vf $(TMP)/usr/share/mysql/mi_test_all* \ $(TMP)/usr/share/mysql/mysql-log-rotate \ $(TMP)/usr/share/mysql/mysql.server \ $(TMP)/usr/share/mysql/binary-configure - nm -n sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mysql-server-5.1/mysqld.sym.gz + nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mysql-server-5.1/mysqld.sym.gz install -m 0755 debian/additions/echo_stderr $(TMP)/usr/share/mysql/ install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/ install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/ diff -u mysql-dfsg-5.1-5.1.30/debian/patches/00list mysql-dfsg-5.1-5.1.30/debian/patches/00list --- mysql-dfsg-5.1-5.1.30/debian/patches/00list +++ mysql-dfsg-5.1-5.1.30/debian/patches/00list @@ -1,5 +1,6 @@ 01_MAKEFILES__Docs_Images_Makefile.in.dpatch 01_MAKEFILES__Docs_Makefile.in.dpatch +02_no_builtin_ndbcluster_plugin.dpatch 33_scripts__mysql_create_system_tables__no_test.dpatch 38_scripts__mysqld_safe.sh__signals.dpatch 41_scripts__mysql_install_db.sh__no_test.dpatch only in patch2: unchanged: --- mysql-dfsg-5.1-5.1.30.orig/debian/patches/02_no_builtin_ndbcluster_plugin.dpatch +++ mysql-dfsg-5.1-5.1.30/debian/patches/02_no_builtin_ndbcluster_plugin.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_MAKEFILES__Docs_Makefile.in.dpatch by <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Creates Docs/Makefile.in + [EMAIL PROTECTED]@ + +--- old/sql/sql_builtin.cc ++++ new/sql/sql_builtin.cc +@@ -22,6 +22,6 @@ + + struct st_mysql_plugin *mysqld_builtins[]= + { +- builtin_binlog_plugin, builtin_partition_plugin, builtin_csv_plugin, builtin_heap_plugin, builtin_myisam_plugin, builtin_myisammrg_plugin, builtin_ndbcluster_plugin,(struct st_mysql_plugin *)0 ++ builtin_binlog_plugin, builtin_partition_plugin, builtin_csv_plugin, builtin_heap_plugin, builtin_myisam_plugin, builtin_myisammrg_plugin, (struct st_mysql_plugin *)0 + }; +
signature.asc
Description: This is a digitally signed message part.