QProcess/FreeBSD: remove the workaround allowing undefined symbols
On FreeBSD, the environ variable doesn't come from libc, but is instead inserted during linking. See ccf74b592809e0c5a613eff27d6431a4c659e368 (5.6) for more information. But instead of allowing undefined symbols in QtCore, let's use a weakref to environ so this one symbol is allowed to be undefined. It won't be, but the linker doesn't know. FreeBSD appears to be the only BSD to require this. We used to apply the same linker option to OpenBSD in Qt 5, but neither the OpenBSD or nor the NetBSD ports trees[1][2] carry a patch for this, so I don't think it's necessary. [1] https://github.com/openbsd/ports/tree/master/x11/qt6/qtbase/patches [2] https://github.com/NetBSD/pkgsrc/tree/trunk/x11/qt6-qtbase/patches Change-Id: I63b988479db546dabffcfffd17661c839014771a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 166e7922695e9b145e0ce33e3674a1716021a1e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4feb6662dc
commit
0b8d30efec
@ -469,14 +469,6 @@ qt_internal_extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQU
|
||||
"/BASE:0x67000000"
|
||||
)
|
||||
|
||||
# QtCore can't be compiled with -Wl,-no-undefined because it uses the
|
||||
# "environ" variable and FreeBSD does not include a weak symbol for it
|
||||
# in libc.
|
||||
qt_internal_extend_target(Core CONDITION FREEBSD
|
||||
LINK_OPTIONS
|
||||
"LINKER:--warn-unresolved-symbols"
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_xmlstream
|
||||
SOURCES
|
||||
serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h
|
||||
|
@ -52,6 +52,11 @@
|
||||
# define O_PATH 0
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_FREEBSD
|
||||
__attribute__((weak))
|
||||
#endif
|
||||
extern char **environ;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
@ -80,10 +85,6 @@ struct PThreadCancelGuard
|
||||
|
||||
#if !defined(Q_OS_DARWIN)
|
||||
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
extern char **environ;
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
|
||||
QProcessEnvironment QProcessEnvironment::systemEnvironment()
|
||||
{
|
||||
QProcessEnvironment env;
|
||||
|
Loading…
x
Reference in New Issue
Block a user