Skip to content

Commit

Permalink
Merge branch 'master' of scm.dev.troll.no:qt/qt-earth-team into symbi…
Browse files Browse the repository at this point in the history
…an-socket-engine

Conflicts:
	src/s60installs/bwins/QtCoreu.def
	src/s60installs/bwins/QtGuiu.def
	src/s60installs/bwins/QtNetworku.def
	src/s60installs/eabi/QtCoreu.def
	src/s60installs/eabi/QtGuiu.def
	src/s60installs/eabi/QtNetworku.def
	src/s60installs/eabi/QtOpenVGu.def
	tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
  • Loading branch information
Shane Kearns committed Apr 11, 2011
2 parents 847df81 + dd60cf7 commit 1062da1
Show file tree
Hide file tree
Showing 1,259 changed files with 141,684 additions and 89,281 deletions.
2 changes: 1 addition & 1 deletion .commit-template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---|

#Task-number:
Reviewed-by: pending
#Reviewed-by:

# ==================================[ please wrap at 72 characters ]===|
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ examples/*/*/*
examples/*/*/*[.]app
!examples/declarative/*
!examples/tutorials/*
!examples/tutorials/*/*
!examples/ja_JP/*/*
demos/*/*
!demos/spectrum/*
Expand Down
41 changes: 23 additions & 18 deletions bin/createpackage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
use File::Path;
# use CWD abs_bath, which is exported only on request
use Cwd 'abs_path';

use File::Copy;

sub Usage() {
print <<ENDUSAGESTRING;
Expand All @@ -84,6 +84,8 @@ ()
[-g|gcce-is-armv5] = Convert gcce platform to armv5.
[-d|dont-patch] = Skip automatic patching of capabilities and pkg file if default certificate
is used. Instead non-self-signable capabilities just cause warnings.
[-t|tmp-dir <path>] = Specifies temporary directory to be used for package creation.
Defaults to 'createpackage_tmp' under same directory as templatepkg.
Where parameters are as follows:
templatepkg = Name of .pkg file template
target = Either debug or release
Expand Down Expand Up @@ -130,6 +132,7 @@ ()
my $onlyUnsigned = "";
my $convertGcce = "";
my $dontPatchCaps = "";
my $tempPackageDir = "";

unless (GetOptions('i|install' => \$install,
'p|preprocess' => \$preprocessonly,
Expand All @@ -139,7 +142,8 @@ ()
's|stub' => \$stub,
'n|sisname=s' => \$signed_sis_name,
'g|gcce-is-armv5' => \$convertGcce,
'd|dont-patch' => \$dontPatchCaps,)) {
'd|dont-patch' => \$dontPatchCaps,
't|tmp-dir=s' => \$tempPackageDir,)) {
Usage();
}

Expand Down Expand Up @@ -190,18 +194,22 @@ ()
my $passphrase;
$passphrase = $ARGV[4] or $passphrase = "";

if ($tempPackageDir eq "") {
my ($templateVolume, $templatePath, $templateFileName) = File::Spec->splitpath($templatepkg);
$tempPackageDir = File::Spec->catpath($templateVolume, $templatePath."createpackage_tmp", "");
}

mkpath($tempPackageDir);

# Generate output pkg basename (i.e. file name without extension)
my $pkgoutputbasename = $templatepkg;
my $preservePkgOutput = "";
$pkgoutputbasename =~ s/_template/_$targetplatform/g;
$pkgoutputbasename =~ s/_installer\.pkg/_installer___temp\.pkg/g;
if ($pkgoutputbasename eq $templatepkg) {
$preservePkgOutput = "1";
}
$pkgoutputbasename =~ s/\.pkg//g;

# Store output file names to variables
my $pkgoutput = $pkgoutputbasename.".pkg";
my ($dummy1, $dummy2, $pkgoutput) = File::Spec->splitpath($pkgoutputbasename.".pkg");
$pkgoutput = $tempPackageDir."/".$pkgoutput;
my $sisoutputbasename;
if ($signed_sis_name eq "") {
$sisoutputbasename = $pkgoutputbasename;
Expand Down Expand Up @@ -300,9 +308,7 @@ ()
if (!$onlyUnsigned) {
unlink $signed_sis_name;
}
if (!$preservePkgOutput) {
unlink $pkgoutput;
}
unlink $pkgoutput;

# Preprocess PKG

Expand Down Expand Up @@ -334,6 +340,11 @@ ()
close OUTPUT;

if ($preprocessonly) {
# Copy preprocessed file from tmp dir to pkg file dir
my ($templateVolume, $templatePath, $templateFileName) = File::Spec->splitpath($templatepkg);
my ($dummy1, $dummy2, $copyFileName) = File::Spec->splitpath($pkgoutput);
my $copyTarget = File::Spec->catpath($templateVolume, $templatePath, $copyFileName);
copy($pkgoutput, $copyTarget) or die "Preprocessed pkg file '$pkgoutput' cannot be copied.";
exit;
}

Expand All @@ -354,7 +365,7 @@ ()
system ("$patch_capabilities -c $pkgoutput") and print ("Warning: Package check for self-signing viability failed. Installing the package on a device will most likely fail!\n\n");
} else {
print("Auto-patching self-signed package.\n");
system ("$patch_capabilities $pkgoutput") and die ("ERROR: Automatic patching failed");
system ("$patch_capabilities -t $tempPackageDir $pkgoutput") and die ("ERROR: Automatic patching failed");
}
}

Expand All @@ -377,9 +388,6 @@ ()
print ("\nUnsigned package creation failed!\n");
}

if (!$preservePkgOutput) {
unlink $pkgoutput;
}
print ("\n");
exit;
}
Expand All @@ -405,10 +413,7 @@ ()
print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n");
}

# remove temporary pkg and unsigned sis
if (!$preservePkgOutput) {
unlink $pkgoutput;
}
# remove temporary unsigned sis
if (!$preserveUnsigned) {
unlink $unsigned_sis_name;
}
Expand Down
82 changes: 71 additions & 11 deletions bin/elf2e32_qtwrapper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,59 @@
my $runCount = 0;
my $returnCode = 0;

# For debugging. Make it nonzero to give verbose output.
my $debugScript = 1;
my @usedDefFiles;
sub recordDefFile {
return if (!$debugScript);

my ($msg, $file) = @_;
my $content = "$msg, $file:\n";
my $defFileFd;
if (!open($defFileFd, "< $file")) {
print("Warning: Could not open $file (for debug analysis)\n");
return;
}
while (<$defFileFd>) {
$content .= $_;
}

push(@usedDefFiles, $content);
}
sub printRecordedDefFiles {
return if (!$debugScript);

foreach (@usedDefFiles) {
print ("$_\n");
}
}

sub missingSymbolMismatch
{
my $missingSymbolSum = $_[0];

printRecordedDefFiles;

print("Bug in the native elf2e32 tool: Number of missing symbols does not\n");
print("match number of removed symbols in the output DEF file.\n\n");

print("Original elf2e32 output:\n");
print(" $missingSymbolSum Frozen Export\(s\) missing from the ELF file\n\n");

print("However $defoutput[1] contains more missing entries than that.\n\n");

print("This needs to be fixed manually in the DEF file.\n");
exit(2);
}

if ($debugScript) {
print("PATH: $ENV{PATH}\n");
print("EPOCROOT: $ENV{EPOCROOT}\n");
}

while (1) {
if (++$runCount > 2) {
printRecordedDefFiles if ($debugScript);
print("Internal error in $0, link succeeded, but exports may be wrong.\n");
last;
}
Expand All @@ -96,6 +147,8 @@

my %fixupSymbols;
my $foundBrokenSymbols = 0;
my $missingSymbolSum = 0;
my $missingSymbolCount = 0;
my $errors = 0;
while (<$elf2e32Pipe>) {
print;
Expand All @@ -104,12 +157,18 @@
} elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
$fixupSymbols{$1} = 1;
$foundBrokenSymbols = 1;
} elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
} elsif (/([0-9]+) Frozen Export\(s\) missing from the ELF file/io) {
$missingSymbolSum = $1;
$foundBrokenSymbols = 1;
}
}
close($elf2e32Pipe);

if ($debugScript) {
recordDefFile("Run no $runCount, elf2e32 DEF file input", "$definput[1]");
recordDefFile("Run no $runCount, elf2e32 DEF file output", "$defoutput[1]");
}

if ($errors) {
$returnCode = 1;
last;
Expand All @@ -125,7 +184,7 @@
}
open($newDefFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
print($tmpDefFile "EXPORTS\n");
print($tmpDefFile "EXPORTS\n") or die("Could not write to temporary DEF file: $!");
$fixupFile = "$defoutput[1].tmp";
while (1) {
my $origDefLine;
Expand Down Expand Up @@ -209,24 +268,25 @@
} elsif ($defLine =~ s/; MISSING://) {
# Auto-absent symbols.
$extraData .= " ABSENT";
if (++$missingSymbolCount > $missingSymbolSum) {
missingSymbolMismatch($missingSymbolSum);
}
}
print($tmpDefFile "\t$sym \@ $ordinal $extraData\n");
print($tmpDefFile "\t$sym \@ $ordinal $extraData\n") or die("Could not write to temporary DEF file: $!");
}
print($tmpDefFile "\n");
print($tmpDefFile "\n") or die("Could not write to temporary DEF file: $!");
close($origDefFile) if ($definput[1]);
close($newDefFile);
close($tmpDefFile);

$definput[1] = "$defoutput[1].tmp";

if (!$foundBrokenSymbols || $errors) {
last;
}

print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
} else {
}
if (!$foundBrokenSymbols || $errors) {
last;
}

print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
};

if ($fixupFile) {
Expand Down Expand Up @@ -260,6 +320,6 @@
}

if ($differenceFound) {
copy($tmpdso[1], $dso[1]);
copy($tmpdso[1], $dso[1]) or die("Could not copy $tmpdso[1] to $dso[1]: $!");
}
}
50 changes: 37 additions & 13 deletions bin/patch_capabilities.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

use File::Copy;
use File::Spec;
use File::Path;

sub Usage() {
print("This script can be used to set capabilities of all binaries\n");
Expand All @@ -63,11 +64,13 @@ ()
print(" symbian-sbsv2 platform, 'target-platform' is REQUIRED. ***\n\n");
print(" *** NOTE2: When patching gcce binaries built with symbian-sbsv2 toolchain,\n");
print(" armv5 must be specified as platform.\n");
print("\nUsage: patch_capabilities.pl [-c] pkg_filename [target-platform [capability list]]\n");
print("\nUsage: patch_capabilities.pl [-c|-t tmp_path] pkg_filename [target-platform [capability list]]\n");
print("\nE.g. patch_capabilities.pl myapp_template.pkg release-armv5 \"All -TCB\"\n");
print("\nThe parameter -c can be used to just check if package is compatible with self-signing\n");
print("without actually doing any patching.\n");
print("Explicit capability list cannot be used with -c parameter.\n");
print("\nThe parameter -t can be used to specify a dir under which the temporary files are created.\n");
print("Defaults to 'patch_capabilities_tmp' under the path to pkg file.\n");
exit();
}

Expand Down Expand Up @@ -101,13 +104,26 @@ ($)
my $pkgFileName = shift(@ARGV);
my $justCheck = "";
my $msgPrefix = "Patching:";
my $tempPatchPath = "";

if ($pkgFileName eq "-c") {
$pkgFileName = shift(@ARGV);
$justCheck = true;
$msgPrefix = "Warning:";
}

if ($pkgFileName eq "-t") {
$tempPatchPath = shift(@ARGV);
$pkgFileName = shift(@ARGV);
}

my ($pkgVolume, $pkgPath, $pkgPlainFileName) = File::Spec->splitpath($pkgFileName);
if ($tempPatchPath eq "") {
$tempPatchPath = File::Spec->catpath($pkgVolume, $pkgPath."patch_capabilities_tmp", "");
}

mkpath($tempPatchPath);

# These variables will only be set for template .pkg files.
my $target;
my $platform;
Expand Down Expand Up @@ -165,8 +181,9 @@ ($)

# Start with no binaries listed.
my @binaries = ();
my $binariesDelimeter = "///";

my $tempPkgFileName = $pkgFileName."_@@TEMP@@";
my $tempPkgFileName = $tempPatchPath."/__TEMP__".$pkgPlainFileName;

if (!$justCheck) {
unlink($tempPkgFileName);
Expand Down Expand Up @@ -216,19 +233,23 @@ ($)
$sourcePath =~ s/\$\(TARGET\)/$target/gm;
}

my ($dummy1, $dummy2, $binaryBaseName) = File::Spec->splitpath($sourcePath);

if ($justCheck) {
push (@binaries, $sourcePath);
push (@binaries, $binaryBaseName.$binariesDelimeter.$sourcePath);
} else {
# Change the source file name (but only if not already patched)
# Copy original files over to patching dir
# Patching dir will be flat to make it cleanable with QMAKE_CLEAN, so path
# will be collapsed into the file name to avoid name collisions in the rare
# case where custom pkg rules are used to install files with same names from
# different directories (probably using platform checks to choose only one of them.)
my $patchedSourcePath = $sourcePath;
if ($patchedSourcePath !~ m/_patched_caps/)
{
$newLine =~ s/(^.*)(\.dll|\.exe)(.*)(\.dll|\.exe)/$1_patched_caps$2$3$4/i;
$patchedSourcePath =~ s/(^.*)(\.dll|\.exe)/$1_patched_caps$2/i;
$patchedSourcePath =~ s/[\/\\:]/_/g;
$patchedSourcePath = "$tempPatchPath/$patchedSourcePath";
$newLine =~ s/^.*(\.dll|\.exe)(.*)(\.dll|\.exe)/\"$patchedSourcePath$2$3/i;

copy($sourcePath, $patchedSourcePath) or die "$sourcePath cannot be copied for patching.";
}
push (@binaries, $patchedSourcePath);
copy($sourcePath, $patchedSourcePath) or die "$sourcePath cannot be copied for patching.";
push (@binaries, $binaryBaseName.$binariesDelimeter.$patchedSourcePath);
}
}
}
Expand All @@ -250,10 +271,13 @@ ($)
my $baseCommandToExecute = "${epocToolsDir}elftran -vid 0x0 -capability \"%s\" ";

# Actually set the capabilities of the listed binaries.
foreach my $binaryPath(@binaries)
foreach my $binariesItem(@binaries)
{
$binariesItem =~ m|^(.*)$binariesDelimeter(.*)$|;
my $binaryBaseName = $1;
my $binaryPath = $2;

# Create the command line for setting the capabilities.
my ($binaryVolume, $binaryDirs, $binaryBaseName) = File::Spec->splitpath($binaryPath);
my $commandToExecute = $baseCommandToExecute;
my $executeNeeded = "";
if (@capabilitiesSpecified)
Expand Down
6 changes: 0 additions & 6 deletions config.profiles/symbian/layers.sysdef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
<module name="qtexamples">
<unit unitID="qtdo.qt.examples" mrp="" bldFile="&layer_real_source_path;/examples" name="qtexamples" proFile="examples.pro" qmakeArgs="-r" filter="qtexamples"/>
</module>
<module name="qttestsauto">
<unit unitID="qtdo.qt.testsauto" mrp="" bldFile="&layer_real_source_path;/tests/auto" name="qttestsauto" proFile="qtpauto.pro" qmakeArgs="-r" filter="qttestsauto"/>
</module>
<module name="qttestsbenchmarks">
<unit unitID="qtdo.qt.testsbenchmarks" mrp="" bldFile="&layer_real_source_path;/tests/benchmarks" name="qttestsbenchmarks" proFile="benchmarks.pro" qmakeArgs="-r" filter="qttestsbenchmarks"/>
</module>
</layer>
</systemModel>
</SystemDefinition>
Loading

0 comments on commit 1062da1

Please sign in to comment.