Skip to content

Commit

Permalink
Fix bug 927073 - Binary compatibility broken for maintenance releases…
Browse files Browse the repository at this point in the history
… due to strict version-script. r=glandium
  • Loading branch information
kewisch committed Oct 29, 2013
1 parent 7cf26f1 commit 2842a71
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 6 deletions.
19 changes: 19 additions & 0 deletions config/Moz/Milestone.pm
Expand Up @@ -138,6 +138,25 @@ sub getMilestoneAB {
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)
#
Expand Down
11 changes: 9 additions & 2 deletions config/milestone.pl
Expand Up @@ -21,6 +21,7 @@
$opt_debug
$opt_template
$opt_uaversion
$opt_symbolversion
$opt_help
);

Expand All @@ -30,7 +31,7 @@

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();
Expand Down Expand Up @@ -75,13 +76,19 @@
# (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
;
}
2 changes: 2 additions & 0 deletions configure.in
Expand Up @@ -1748,6 +1748,7 @@ 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`
Expand All @@ -1759,6 +1760,7 @@ 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)

Expand Down
19 changes: 19 additions & 0 deletions js/src/config/Moz/Milestone.pm
Expand Up @@ -138,6 +138,25 @@ sub getMilestoneAB {
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)
#
Expand Down
11 changes: 9 additions & 2 deletions js/src/config/milestone.pl
Expand Up @@ -21,6 +21,7 @@
$opt_debug
$opt_template
$opt_uaversion
$opt_symbolversion
$opt_help
);

Expand All @@ -30,7 +31,7 @@

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();
Expand Down Expand Up @@ -75,13 +76,19 @@
# (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
;
}
2 changes: 2 additions & 0 deletions js/src/configure.in
Expand Up @@ -235,10 +235,12 @@ 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(,)
Expand Down
2 changes: 1 addition & 1 deletion js/src/moz.build
Expand Up @@ -21,7 +21,7 @@ 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'

Expand Down
2 changes: 1 addition & 1 deletion toolkit/library/Makefile.in
Expand Up @@ -121,7 +121,7 @@ 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
Expand Down

0 comments on commit 2842a71

Please sign in to comment.