summaryrefslogtreecommitdiff
path: root/build/win32
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2013-09-12 12:15:02 +0000
committerJeff Trawick <trawick@apache.org>2013-09-12 12:15:02 +0000
commit86335b8bb8d74e4f9ad59e5dd90932178dc3d0fa (patch)
tree519ccaccd334030bb01b975e9c0279b945634f5a /build/win32
parent731d18dd4c0684d30fdab327c5c052b141421cc6 (diff)
downloadhttpd-86335b8bb8d74e4f9ad59e5dd90932178dc3d0fa.tar.gz
BaseAddr.ref:
. Update sizes as necessary based on a 64-bit debug build with Visual Studio 2012. . Add missing modules mod_apreq, mod_authnz_fcgi, mod_dialup, mod_optional_fn_export, mod_optional_fn_import, mod_optional_hook_export, mod_optional_hook_import, and mod_policy. (The example mods aren't important, but adding them avoids having to treat those as exceptions in any sort of automatic update mechanism. Potential issues with the several modules that aren't currently buildable with the cmake-based solution have not been addressed.) fixBaseAddrs.pl: . New script to generate a new BaseAddr.ref based on Microsoft linker warnings about inadequate size or missing module. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1522544 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/win32')
-rw-r--r--build/win32/fixBaseAddrs.pl118
1 files changed, 118 insertions, 0 deletions
diff --git a/build/win32/fixBaseAddrs.pl b/build/win32/fixBaseAddrs.pl
new file mode 100644
index 0000000000..06b2f682ea
--- /dev/null
+++ b/build/win32/fixBaseAddrs.pl
@@ -0,0 +1,118 @@
+#!/usr/bin/perl -w
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# HOWTO use this to update BaseAddrs.ref:
+#
+# This takes the old BaseAddrs.ref and a build listing showing LNK4013
+# and LNK4198 errors and produces an updated BaseAddrs.ref with any
+# necessary changes for incorrect sizes or missing modules.
+#
+# Missing modules are added with a default size of 64K, so another
+# build is needed to determine if a non-default size is required for
+# newly added modules.
+
+use strict;
+
+my $oldref = shift;
+my $listing = shift;
+my $newref = shift;
+
+my $starting_addr = 0x6FF00000;
+my $default_size = 0x00010000;
+
+my @modnames = ();
+my @maxsizes = ();
+my @comments = ();
+my $in_defs = undef;
+open(F, "<$oldref") or die;
+while (<F>) {
+ my $l = $_;
+ chomp($l);
+ if (!$in_defs && length($l) != 0 && substr($l, 0, 1) ne ';') {
+ $in_defs = 1;
+ }
+
+ if ($in_defs) {
+ my @fields = split(/[ \t]+/, $l);
+ @modnames = (@modnames, $fields[0]);
+ @maxsizes = (@maxsizes, hex($fields[2]));
+ }
+ else {
+ @comments = (@comments, $l);
+ }
+}
+close(F) or die;
+
+my $curlib = undef;
+my %reported = ();
+open(F, "<$listing") or die;
+while (<F>) {
+ my $l = $_;
+ chomp($l);
+
+ if ($l =~ /Creating library (.*)\.lib/) {
+ if ($1 eq "libhttpd") {
+ $curlib = "$1.dll";
+ }
+ else {
+ $curlib = "$1.so";
+ }
+ }
+ elsif ($l =~ /warning LNK4013: image size (.*) exceeds/) {
+ my $mod = $curlib;
+ my $newsize = hex($1);
+ if (!$reported{$mod}) {
+ $reported{$mod} = 1;
+
+ # round to nearest 64K
+ $newsize = int(1 + $newsize / 0x00010000) * 0x00010000;
+ printf "$curlib size changes to %s (rounded to 0x%08X)\n", $1, $newsize;
+ my $i = 0;
+ while ($i < scalar(@modnames)) {
+ if ($modnames[$i] eq $mod) {
+ print " (from $maxsizes[$i])\n";
+ $maxsizes[$i] = $newsize;
+ last;
+ }
+ ++$i;
+ }
+ }
+ }
+ elsif ($l =~ /warning LNK4198: base key '(.*)' not found/) {
+ my $mod = $1;
+ if (!$reported{$mod}) {
+ $reported{$mod} = 1;
+ print "$mod must be added\n";
+ @modnames = (@modnames, $mod);
+ @maxsizes = (@maxsizes, $default_size);
+ }
+ }
+}
+close(F) or die;
+
+open(F, ">$newref") or die;
+
+print F join("\n", @comments);
+print F "\n";
+my $i = 0;
+my $curaddr = $starting_addr;
+while ($i < scalar(@modnames)) {
+ printf F "%-28s0x%08X 0x%08X\n", $modnames[$i], $curaddr, $maxsizes[$i];
+ $curaddr += $maxsizes[$i];
+ ++$i;
+}
+close(F) or die;