MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:marc.alff Date:January 24 2007 3:26am
Subject:bk commit into 5.1 tree (malff:1.2380) BUG#21029
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marcsql. When marcsql 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, 2007-01-23 20:26:47-07:00, malff@weblab.(none) +4 -0
  Bug#21029 (Dependencies between sql_yacc.cc and dependent headers not detected)
  
  The build scripts in general, using automake, autoconf, etc, contain several
  special commands and work around all related to the way the bison code in the
  parser is built, for sql/sql_yacc.yy. These work arounds, accumulated over
  time during development, ultimately cause the build scripts to be unstable
  and cause build defects by not enforcing dependencies.
  
  This fix simplifies the build process and aligns it with the automake tooling,
  which provides native support for bison and *.yy files.
  
  In particular, the following problem have been fixed:
  - dependencies with sql_yacc.cc were not honored (Bug 21029), leading to
    corrupted builds,
  - the work around introduced by Bug 24557, to cleanup the generated files
    sql_yacc.h and sql_yacc.cc, has been removed,
  - the generated makefile, in a source distribution, used to destroy the files
    sql_yacc.h and sql_yacc.cc on a 'make clean' target. This has been fixed:
    these files are now removed by make maintainer-clean.
  - The root cause of the problem found with gcc 4.1 (see Bug 24619) has been
    clearly documented, and the "sed" hack has been replaced by a cleaner
    work around, when building the code with bison 1.875.
  - Removed the file sql/sql_yacc.yy.bak, added by WL 3031 by accident.
  - Removed the unnecessary AM_YFLAG= --debug introduced by WL 3432, since
    the compiling option DBUG_OFF takes precedence when setting YYDEBUG.
  
  =============================================================================
  Note: everything below this line is for review only, it will be cut
  from the final CSET comments when the patch is pushed.
  
  The build platform used to test this fix was:
  Linux 2.6.15-gentoo-r7, AMD x86_64
  GNU M4 1.4.7
  GNU Autoconf 2.60
  GNU automake 1.9.6
  GNU Make 3.81
  GNU Bison 2.2
  GCC 4.1.1 (Gentoo 4.1.1-r1)
  
  Build performed:
  
  ./BUILD/compile-dist
  --> builds properly
  make distcheck
  --> builds properly (it involves a VPATH build)
  
  ./sql/.deps/sql_yacc.Po
  --> properly generated, including the content
  
  ./sql/Makefile.in, ./sql/Makefile
  --> contain dependencies for sql_yacc.h and sql_yacc.cc
  
  touch include/hash.h
  make
  --> does not rebuild sql_yacc.h, sql_yacc.output, sql_yacc.cc
  --> rebuilds sql_yacc.o, then dependent binaries
  
  touch sql/sql_yacc.yy
  make
  --> rebuilds sql_yacc.{h|cc}, then sql_yacc.o, then dependent files
  
  in the sql sub directory:
  make clean
  --> does not remove sql_yacc.h and sql_yacc.cc
  --> does remove sql_yacc.output
  
  make distclean
  --> keeps sql_yacc.{h|cc}
  
  ./BUILD/compile-dist
  make
  make maintainer-clean:
  --> removes sql_yacc.{h|cc}
  
  After un installing bison 2.2 and installing bison 1.875 instead,
  
  ./BUILD/compile-dist
  --> builds properly
  
  Verified that the bison 1.875 generated code does contain a broken
  construct with __attribute__ ((unused)),
  verified that GCC 4.1.1 fails without the work around implemented
  in sql_yacc.yy, and verified that the build is performed properly
  with the work around.
  
  make distcheck
  --> builds properly.

  BitKeeper/deleted/.del-sql_yacc.yy.bak@stripped, 2007-01-23 16:03:20-07:00, malff@weblab.(none) +0 -0
    Rename: sql/sql_yacc.yy.bak -> BitKeeper/deleted/.del-sql_yacc.yy.bak

  Makefile.am@stripped, 2007-01-23 20:26:44-07:00, malff@weblab.(none) +0 -8
    General cleanup of the build process for sql_yacc.yy

  sql/Makefile.am@stripped, 2007-01-23 20:26:44-07:00, malff@weblab.(none) +6 -22
    General cleanup of the build process for sql_yacc.yy

  sql/sql_yacc.yy@stripped, 2007-01-23 20:26:44-07:00, malff@weblab.(none) +22 -0
    General cleanup of the build process for sql_yacc.yy

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	malff
# Host:	weblab.(none)
# Root:	/home/marcsql/TREE/mysql-5.1-21029

--- 1.108/Makefile.am	2007-01-23 20:26:54 -07:00
+++ 1.109/Makefile.am	2007-01-23 20:26:54 -07:00
@@ -41,14 +41,6 @@ BUILT_SOURCES = linked_client_sources li
 CLEANFILES = $(BUILT_SOURCES)
 DISTCLEANFILES = ac_available_languages_fragment
 
-# Our current filtering of "sql_yacc.cc" in "sql/Makefile.am" creates
-# a problem, if a VPATH build and "sql_yacc.cc" was part of the source
-# distribution we end up with one "sql_yacc.cc" in the source tree,
-# and one in the build tree. This breaks "distcleancheck", until this
-# is sorted out we redefine the find that scans for files not removed
-
-distcleancheck_listfiles = find . -name sql_yacc.cc -o -type f -print
-
 linked_include_sources:
 	cd include; $(MAKE) link_sources
 	echo timestamp > linked_include_sources

--- 1.170/sql/Makefile.am	2007-01-23 20:26:54 -07:00
+++ 1.171/sql/Makefile.am	2007-01-23 20:26:54 -07:00
@@ -121,13 +121,14 @@ DEFS =			-DMYSQL_SERVER \
 			-DLIBDIR="\"$(MYSQLLIBdir)\"" \
 			@DEFS@
 
-BUILT_DIST_SRC =	sql_yacc.cc sql_yacc.h
-BUILT_SOURCES =		$(BUILT_DIST_SRC) lex_hash.h
-EXTRA_DIST =		udf_example.c udf_example.def $(BUILT_DIST_SRC) \
+BUILT_MAINT_SRC =	sql_yacc.cc sql_yacc.h
+BUILT_SOURCES =		$(BUILT_MAINT_SRC) lex_hash.h
+EXTRA_DIST =		udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
 			nt_servc.cc nt_servc.h message.mc CMakeLists.txt \
 			udf_example.c udf_example.def
-CLEANFILES =        	lex_hash.h sql_yacc.cc sql_yacc.h sql_yacc.output
-AM_YFLAGS =		-d --debug --verbose
+CLEANFILES =        	lex_hash.h sql_yacc.output
+MAINTAINERCLEANFILES =  $(BUILT_MAINT_SRC)
+AM_YFLAGS =		-d --verbose
 
 mysql_tzinfo_to_sql.cc:
 	rm -f mysql_tzinfo_to_sql.cc
@@ -147,23 +148,6 @@ link_sources: mysql_tzinfo_to_sql.cc
 
 mysql_tzinfo_to_sql.o:	$(mysql_tzinfo_to_sql_SOURCES)
 			$(CXXCOMPILE) -c $(INCLUDES) -DTZINFO2SQL $<
-
-# Try to get better dependencies for the grammar. Othervise really bad
-# things like different grammars for different pars of MySQL can
-# happen if you are unlucky.
-sql_yacc.cc:	sql_yacc.yy
-
-sql_yacc.h:	sql_yacc.yy
-
-# Be careful here, note that we use VPATH and might or might not have
-# a pregenerated "sql_yacc.cc" in $(srcdir) or one we just built in
-# $(builddir). And it has to work if $(srcdir) == $(builddir).
-sql_yacc.o:	sql_yacc.cc sql_yacc.h $(HEADERS)
-		@SED@ -e 's/__attribute__ ((__unused__))//' $< > sql_yacc.cc-new
-		@MV@ sql_yacc.cc-new sql_yacc.cc
-		@echo "Note: The following compile may take a long time."
-		@echo "If it fails, re-run configure with --with-low-memory"
-		$(CXXCOMPILE) $(LM_CFLAGS) -c sql_yacc.cc
 
 # FIXME seems like now "lex_hash.h" differs depending on configure
 # flags, so can't pregenerate and include in source TAR. Revert to

--- 1.529/sql/sql_yacc.yy	2007-01-23 20:26:54 -07:00
+++ 1.530/sql/sql_yacc.yy	2007-01-23 20:26:54 -07:00
@@ -54,6 +54,28 @@ const LEX_STRING null_lex_str={0,0};
     YYABORT;				\
   }
 
+/*
+  Work around for broken code generated by bison 1.875.
+
+  The code generated by bison 1.875a and later, bison 2.1 and bison 2.2 is ok.
+  With bison 1.875 however, the generated code contains:
+<pre>
+  yyerrlab1:
+  #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+    __attribute__ ((__unused__))
+  #endif
+</pre>
+  This usage of __attribute__ is illegal, so we remove it.
+  See the following references for details:
+  http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00014.html
+  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14273
+*/
+
+#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+#undef __attribute__
+#define __attribute__(X)
+#endif
+
 /* Helper for parsing "IS [NOT] truth_value" */
 inline Item *is_truth_value(THD *thd, Item *A, bool v1, bool v2)
 {
Thread
bk commit into 5.1 tree (malff:1.2380) BUG#21029marc.alff24 Jan