Fix bug 927073 - Binary compatibility broken for maintenance releases due to strict version-script. r=glandium
authorPhilipp Kewisch <mozilla@kewis.ch>
Tue, 29 Oct 2013 21:48:28 +0100
changeset 152903 9e197c3158b0e214723aa90cd942b4e7715cde14
parent 152902 e2508d56d93ee088051ae449271f59497bac0523
child 152904 93f195bf9008e1f9662ebf783248fe8bc4c36516
push id25562
push userkwierso@gmail.com
push dateFri, 01 Nov 2013 01:00:51 +0000
treeherdermozilla-central@4813677c42bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs927073
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix bug 927073 - Binary compatibility broken for maintenance releases due to strict version-script. r=glandium
config/Moz/Milestone.pm
config/milestone.pl
configure.in
js/src/config/Moz/Milestone.pm
js/src/config/milestone.pl
js/src/configure.in
js/src/moz.build
toolkit/library/Makefile.in
--- a/config/Moz/Milestone.pm
+++ b/config/Moz/Milestone.pm
@@ -134,16 +134,35 @@ sub getMilestoneAB {
   }
   
   if ($milestoneAB =~ /a/) { return "alpha"; }
   if ($milestoneAB =~ /b/) { return "beta"; }
   return "final";
 }
 
 #
+# Usage:  getMilestoneABWithNum($milestoneFile)
+# Returns the alpha and beta tag with its number (a1, a2, b3, ...)
+#
+sub getMilestoneABWithNum {
+  my $milestoneABNum;
+  if (defined($Moz::Milestone::milestone)) {
+    $milestoneABNum = $Moz::Milestone::milestone;
+  } else {
+    $milestoneABNum = $_[0];
+  }
+
+  if ($milestoneABNum =~ /([ab]\d+)/) {
+    return $1;
+  } else {
+    return "";
+  }
+}
+
+#
 # build_file($template_file,$output_file)
 #
 sub build_file($$) {
   my @FILE;
   my @MILESTONE_PARTS;
   my $MINI_VERSION = 0;
   my $MICRO_VERSION = 0;
   my $OFFICIAL = 0;
--- a/config/milestone.pl
+++ b/config/milestone.pl
@@ -16,26 +16,27 @@ use vars qw(
             $MILESTONE
             $MILESTONE_NUM
             @MILESTONE_PARTS
             $MINI_VERSION
             $MICRO_VERSION
             $opt_debug
             $opt_template
             $opt_uaversion
+            $opt_symbolversion
             $opt_help
             );
 
 $SCRIPTDIR = $0;
 $SCRIPTDIR =~ s/[^\/]*$//;
 push(@INC,$SCRIPTDIR);
 
 require "Moz/Milestone.pm";
 
-&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
+&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion', 'symbolversion');
 
 if (defined($opt_help)) {
     &usage();
     exit;
 }
 
 if (defined($opt_template)) {
     @TEMPLATE_FILE = @ARGV;
@@ -70,18 +71,24 @@ if (@TEMPLATE_FILE) {
       warn("$0:  No such file $TFILE!\n");
     }
   }
 } elsif(defined($opt_uaversion)) {
   # Only expose the major milestone in the UA string, hide the patch level
   # (bugs 572659 and 870868).
   my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . ".0";
   print "$uaversion\n";
+} elsif(defined($opt_symbolversion)) {
+  # Only expose major milestone and alpha version. Used for symbol versioning
+  # on Linux.
+  my $symbolversion = Moz::Milestone::getMilestoneMajor($milestone) .
+                      Moz::Milestone::getMilestoneABWithNum($milestone);
+  print "$symbolversion\n";
 } else {
   print "$milestone\n";
 }
 
 sub usage() {
   print <<END
-`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion`  # will build file list from .tmpl files
+`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion --symbolversion`  # will build file list from .tmpl files
 END
     ;
 }
--- a/configure.in
+++ b/configure.in
@@ -1743,27 +1743,29 @@ if test "$MOZ_CUSTOM_INTTYPES_H"; then
   AC_MSG_RESULT(using $MOZ_CUSTOM_INTTYPES_H)
 else
   AC_MSG_RESULT(none specified)
 fi
 
 dnl Get mozilla version from central milestone file
 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
+MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion`
 
 dnl Get version of various core apps from the version files.
 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
 
 if test -z "$FIREFOX_VERSION"; then
     AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
 fi
 
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
+AC_DEFINE_UNQUOTED(MOZILLA_SYMBOLVERSION,"$MOZILLA_SYMBOLVERSION")
 
 MOZ_DOING_LTO(lto_is_enabled)
 
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 
 case "$target" in
--- a/js/src/config/Moz/Milestone.pm
+++ b/js/src/config/Moz/Milestone.pm
@@ -134,16 +134,35 @@ sub getMilestoneAB {
   }
   
   if ($milestoneAB =~ /a/) { return "alpha"; }
   if ($milestoneAB =~ /b/) { return "beta"; }
   return "final";
 }
 
 #
+# Usage:  getMilestoneABWithNum($milestoneFile)
+# Returns the alpha and beta tag with its number (a1, a2, b3, ...)
+#
+sub getMilestoneABWithNum {
+  my $milestoneABNum;
+  if (defined($Moz::Milestone::milestone)) {
+    $milestoneABNum = $Moz::Milestone::milestone;
+  } else {
+    $milestoneABNum = $_[0];
+  }
+
+  if ($milestoneABNum =~ /([ab]\d+)/) {
+    return $1;
+  } else {
+    return "";
+  }
+}
+
+#
 # build_file($template_file,$output_file)
 #
 sub build_file($$) {
   my @FILE;
   my @MILESTONE_PARTS;
   my $MINI_VERSION = 0;
   my $MICRO_VERSION = 0;
   my $OFFICIAL = 0;
--- a/js/src/config/milestone.pl
+++ b/js/src/config/milestone.pl
@@ -16,26 +16,27 @@ use vars qw(
             $MILESTONE
             $MILESTONE_NUM
             @MILESTONE_PARTS
             $MINI_VERSION
             $MICRO_VERSION
             $opt_debug
             $opt_template
             $opt_uaversion
+            $opt_symbolversion
             $opt_help
             );
 
 $SCRIPTDIR = $0;
 $SCRIPTDIR =~ s/[^\/]*$//;
 push(@INC,$SCRIPTDIR);
 
 require "Moz/Milestone.pm";
 
-&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
+&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion', 'symbolversion');
 
 if (defined($opt_help)) {
     &usage();
     exit;
 }
 
 if (defined($opt_template)) {
     @TEMPLATE_FILE = @ARGV;
@@ -70,18 +71,24 @@ if (@TEMPLATE_FILE) {
       warn("$0:  No such file $TFILE!\n");
     }
   }
 } elsif(defined($opt_uaversion)) {
   # Only expose the major milestone in the UA string, hide the patch level
   # (bugs 572659 and 870868).
   my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . ".0";
   print "$uaversion\n";
+} elsif(defined($opt_symbolversion)) {
+  # Only expose major milestone and alpha version. Used for symbol versioning
+  # on Linux.
+  my $symbolversion = Moz::Milestone::getMilestoneMajor($milestone) .
+                      Moz::Milestone::getMilestoneABWithNum($milestone);
+  print "$symbolversion\n";
 } else {
   print "$milestone\n";
 }
 
 sub usage() {
   print <<END
-`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion`  # will build file list from .tmpl files
+`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion --symbolversion`  # will build file list from .tmpl files
 END
     ;
 }
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -230,20 +230,22 @@ else
     MOZ_ANDROID_NDK
 fi
 
 dnl ==============================================================
 dnl Get mozilla version from central milestone file
 dnl ==============================================================
 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
+MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion`
 
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
+AC_DEFINE_UNQUOTED(MOZILLA_SYMBOLVERSION,"$MOZILLA_SYMBOLVERSION")
 
 # Separate version into components for use in shared object naming etc
 changequote(,)
 MOZJS_MAJOR_VERSION=`echo $MOZILLA_VERSION | sed "s|\(^[0-9]*\)\.[0-9]*.*|\1|"`
 MOZJS_MINOR_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.\([0-9]*\).*|\1|"`
 MOZJS_PATCH_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9]*[^0-9]*||"`
 IS_ALPHA=`echo $MOZILLA_VERSION | grep '[ab]'`
 
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -16,17 +16,17 @@ if CONFIG['JS_NATIVE_EDITLINE']:
 if not CONFIG['JS_DISABLE_SHELL']:
     DIRS += ['shell']
 
 TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
 
 MODULE = 'js'
 
 if CONFIG['JS_STANDALONE']:
-    LIBRARY_NAME = 'mozjs-%s.%s%s' % (CONFIG['MOZJS_MAJOR_VERSION'], CONFIG['MOZJS_MINOR_VERSION'], CONFIG['MOZJS_ALPHA'])
+    LIBRARY_NAME = 'mozjs-%s' % CONFIG['MOZILLA_SYMBOLVERSION']
 else:
     LIBRARY_NAME = 'mozjs'
 
 CONFIGURE_SUBST_FILES += [
     'devtools/rootAnalysis/Makefile',
     'js-confdefs.h',
 ]
 
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -116,17 +116,17 @@ endif
 
 ifeq (Linux,$(OS_ARCH))
 ifneq (Android,$(OS_TARGET))
 OS_LIBS += -lrt
 EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript
 
 symverscript: symverscript.in
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-		-DVERSION="$(LIBRARY_NAME)$(MOZILLA_VERSION)" $< > $@
+		-DVERSION="$(LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)" $< > $@
 
 EXTRA_DEPS += symverscript
 endif
 endif
 
 STATIC_LIBS += \
   xpcom_core \
   ucvutil_s \