summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-06-28 17:46:28 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-06-28 17:49:27 (GMT)
commit0ba6f323f310f982fa96da69fd3fd02e202a042b (patch)
tree43ebabf0151b7390bdddf487da55cc0c72d6dc88
parenta9177328bcac8960ebb19be7b709faaa216ee9d3 (diff)
downloadQt-0ba6f323f310f982fa96da69fd3fd02e202a042b.zip
Qt-0ba6f323f310f982fa96da69fd3fd02e202a042b.tar.gz
Qt-0ba6f323f310f982fa96da69fd3fd02e202a042b.tar.bz2
Fix detection of the ELF interpreter on Linux.
The path /lib/ld-linux.so.2 is correct for i386 only, possibly some other archs. But on x86-64, it's usually ld-linux-x86-64.so and it can be in either /lib or /lib64.
-rw-r--r--src/corelib/global/global.pri7
-rw-r--r--src/corelib/global/qlibraryinfo.cpp7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 8991379..0fe757d 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -1,5 +1,4 @@
# Qt kernel library base module
-linux-g++*:QMAKE_LFLAGS += -Wl,-e,qt_core_init_boilerplate
HEADERS += \
global/qglobal.h \
@@ -19,3 +18,9 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
+
+linux-g++*:!static {
+ QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
+ prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
+ DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
+}
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 62c9459..cc5fb48 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -483,16 +483,15 @@ QLibraryInfo::location(LibraryLocation loc)
QT_END_NAMESPACE
-#if defined(Q_CC_GNU) && defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) && !defined(QT_BOOTSTRAPPED)
-
+#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)
# include <stdio.h>
# include <stdlib.h>
extern const char qt_core_interpreter[] __attribute__((section(".interp")))
- = "/lib/ld-linux.so.2";
+ = ELF_INTERPRETER;
extern "C"
-void qt_core_init_boilerplate()
+void qt_core_boilerplate()
{
printf("This is the QtCore library version " QT_VERSION_STR "\n"
"Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\n"