8210438: [Linux] jpackager fails to build with older compilers JDK-8200758-branch
authorherrick
Mon, 17 Sep 2018 09:29:21 -0400
branchJDK-8200758-branch
changeset 56885 4c56efca06ca
parent 56884 0b2da0fd5363
child 56886 f5b66a48b87b
8210438: [Linux] jpackager fails to build with older compilers Submitted-by: almatvee Reviewed-by: herrick, kcr
make/lib/Lib-jdk.packager.gmk
src/jdk.packager/share/native/library/common/PosixPlatform.cpp
--- a/make/lib/Lib-jdk.packager.gmk	Mon Sep 17 09:28:19 2018 -0400
+++ b/make/lib/Lib-jdk.packager.gmk	Mon Sep 17 09:29:21 2018 -0400
@@ -51,10 +51,12 @@
     CFLAGS_windows :=  -nologo -EHsc -D_WINDOWS -DUNICODE -D_UNICODE -DWIN32 -D_LITTLE_ENDIAN -DWIN32_LEAN_AND_MEAN, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LIBS := $(LIBCXX), \
     LIBS_windows := user32.lib shell32.lib advapi32.lib ole32.lib, \
+    LIBS_linux := -ldl -lpthread, \
     CFLAGS_linux :=  -Wextra -Wformat -Wformat-security -c -fPIC, \
-    LDFLAGS_macosx := -ldl -dynamiclib -framework Cocoa -stdlib=libc++, \
-    LDFLAGS_linux :=  -ldl -shared -lpthread -static-libstdc++, \
+    LDFLAGS_macosx := -dynamiclib -stdlib=libc++, \
+    LIBS_macosx := -ldl -framework Cocoa, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 ))
 
@@ -83,10 +85,11 @@
     DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
     LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_macosx := -framework Cocoa -stdlib=libstdc++, \
+    LDFLAGS_macosx := -stdlib=libstdc++, \
+    LIBS_macosx := -framework Cocoa, \
     LIBS := $(LIBCXX), \
     LIBS_solaris :=  -lc, \
-    LDFLAGS_linux :=  -ldl -static-libstdc++, \
+    LIBS_linux := -ldl, \
     LIBS_windows :=  user32.lib shell32.lib advapi32.lib, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 ))
--- a/src/jdk.packager/share/native/library/common/PosixPlatform.cpp	Mon Sep 17 09:28:19 2018 -0400
+++ b/src/jdk.packager/share/native/library/common/PosixPlatform.cpp	Mon Sep 17 09:29:21 2018 -0400
@@ -38,6 +38,9 @@
 #include <sys/sysctl.h>
 #include <sys/file.h>
 #include <sys/stat.h>
+#ifdef LINUX
+#include <sys/wait.h>
+#endif
 #include <errno.h>
 #include <limits.h>
 #include <pwd.h>
@@ -372,7 +375,7 @@
     pid_t wpid = 0;
 
 #ifdef LINUX
-    wait();
+    wpid = wait(&status);
 #endif
 #ifdef MAC
     wpid = wait(&status);