forked from qt-creator/qt-creator
Toolchain: Fix detection of static libraries
Fix detection of static libraries, add unit test with a known broken version. Task-number: QTCREATORBUG-4453 Reviewed-by: con
This commit is contained in:
@@ -545,7 +545,8 @@ QList<Abi> Abi::abisOfBinary(const QString &path)
|
|||||||
&& tmp.at(0).binaryFormat() != Abi::MachOFormat)
|
&& tmp.at(0).binaryFormat() != Abi::MachOFormat)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
f.seek(offset + (offset % 2)); // ar is 2 byte alligned
|
offset += (offset % 2); // ar is 2 byte alligned
|
||||||
|
f.seek(offset);
|
||||||
data = f.read(1024);
|
data = f.read(1024);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -598,10 +599,13 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
|
|||||||
<< (QStringList());
|
<< (QStringList());
|
||||||
|
|
||||||
QTest::newRow("static QtCore: win msvc2008")
|
QTest::newRow("static QtCore: win msvc2008")
|
||||||
<< QString::fromLatin1("%1/abi/static/win_msvc2008_release.lib").arg(prefix)
|
<< QString::fromLatin1("%1/abi/static/win-msvc2008-release.lib").arg(prefix)
|
||||||
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
|
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
|
||||||
|
QTest::newRow("static QtCore: win msvc2008 II")
|
||||||
|
<< QString::fromLatin1("%1/abi/static/win-msvc2008-release2.lib").arg(prefix)
|
||||||
|
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-64bit"));
|
||||||
QTest::newRow("static QtCore: win msvc2008 (debug)")
|
QTest::newRow("static QtCore: win msvc2008 (debug)")
|
||||||
<< QString::fromLatin1("%1/abi/static/win_msvc2008_debug.lib").arg(prefix)
|
<< QString::fromLatin1("%1/abi/static/win-msvc2008-debug.lib").arg(prefix)
|
||||||
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
|
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
|
||||||
QTest::newRow("static QtCore: mac (debug)")
|
QTest::newRow("static QtCore: mac (debug)")
|
||||||
<< QString::fromLatin1("%1/abi/static/mac-32bit-debug.a").arg(prefix)
|
<< QString::fromLatin1("%1/abi/static/mac-32bit-debug.a").arg(prefix)
|
||||||
|
|||||||
Reference in New Issue
Block a user