Bug 927073 - Binary compatibility broken for maintenance releases due to strict version-script. r=glandium, a=lsblakk
authorPhilipp Kewisch <mozilla@kewis.ch>
Mon, 18 Nov 2013 16:42:04 -0500
changeset 148673 0fa56f18ff991d674b66b2c65ef13371bb5a2ad9
parent 148672 b2b9f0b2902096a443f28b69a27bbd78ad0b1c73
child 148674 4e7d3877547d59319b8de7a0eb564cfda36e709e
push id68
push userryanvm@gmail.com
push dateMon, 18 Nov 2013 21:42:19 +0000
reviewersglandium, lsblakk
bugs927073
milestone24.1.1
Bug 927073 - Binary compatibility broken for maintenance releases due to strict version-script. r=glandium, a=lsblakk
config/Moz/Milestone.pm
config/milestone.pl
configure.in
js/src/Makefile.in
js/src/config/Moz/Milestone.pm
js/src/config/milestone.pl
js/src/configure.in
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 (defined(@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
@@ -1798,16 +1798,17 @@ if test "$MOZ_CUSTOM_STDINT_H"; then
   AC_MSG_RESULT(using $MOZ_CUSTOM_STDINT_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
 
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -9,17 +9,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 
 TOPLEVEL_BUILD := 1
 
 run_for_side_effects := $(shell echo "MAKE: $(MAKE)")
 include $(DEPTH)/config/autoconf.mk
 
 ifdef JS_STANDALONE
-LIBRARY_NAME	= mozjs-@MOZJS_MAJOR_VERSION@.@MOZJS_MINOR_VERSION@@MOZJS_ALPHA@
+LIBRARY_NAME	= mozjs-@MOZILLA_SYMBOLVERSION@
 else
 LIBRARY_NAME	= mozjs
 endif
 
 STATIC_LIBRARY_NAME = js_static
 MSVC_ENABLE_PGO := 1
 LIBS		= $(NSPR_LIBS)
 
--- 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 (defined(@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
@@ -217,16 +217,17 @@ 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_SUBST(MOZILLA_SYMBOLVERSION)
 
 # Separate version into components for use in shared object naming etc
 changequote(,)
--- 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 \