From ccf74b592809e0c5a613eff27d6431a4c659e368 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 29 Jan 2016 13:27:53 -0800 Subject: Fix build on FreeBSD: 'environ' is not defined in a library On FreeBSD, this variable is defined as a common symbol in the object file /usr/lib/crt1.o, which is injected into the final application by the compiler. This means when linking any library, 'environ' cannot be found and we can't use -Wl,-no-undefined on FreeBSD. I don't know why this wasn't caught before. Most likely, we failed to pass the linker flag until some recent change to the buildsystem. qprocess_unix.cpp:279: undefined reference to `environ' Change-Id: I7a9e11d7b64a4cc78e24ffff142e02dbf188bca5 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen --- src/corelib/corelib.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 5cd0bde87b..ab3f29e2c7 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -27,6 +27,10 @@ ANDROID_PERMISSIONS = \ android.permission.INTERNET \ android.permission.WRITE_EXTERNAL_STORAGE +# QtCore can't be compiled with -Wl,-no-undefined because it uses the "environ" +# variable and on FreeBSD, this variable is in the final executable itself +freebsd: QMAKE_LFLAGS_NOUNDEF = + load(qt_module) load(qfeatures) -- cgit v1.2.3