From 0ba6f323f310f982fa96da69fd3fd02e202a042b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 28 Jun 2009 19:46:28 +0200 Subject: 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. --- src/corelib/global/global.pri | 7 ++++++- src/corelib/global/qlibraryinfo.cpp | 7 +++---- 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 # include 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" -- cgit v0.12