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:31:07 -0500
changeset 166519 bc542226210744ae19a81c47589b9b57d80e7c96
parent 166518 c0c46ae54ed7bf3b2768e7ed3d5b7a9b5b810937
child 166520 de6d1ca54ab24b621208ec29adba240c8c895913
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, lsblakk
bugs927073
milestone27.0a2
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/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,16 +1743,17 @@ 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
 
--- 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
@@ -231,16 +231,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/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']
 
 # Changes to internal header files, used externally, massively slow down
 # browser builds.  Don't add new files here unless you know what you're
 # doing!
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -114,17 +114,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 \